predict.DBSCAN {hana.ml.r}R Documentation

Make Predictions from a "DBSCAN" Object

Description

Similar to other predict methods, this function predicts fitted values from a fitted "DBSCAN" object.

Usage

## S3 method for class 'DBSCAN'
predict(model, data, key, features = NULL, ...)

Arguments

model

R6Class object
A DBSCAN object for prediction.

data

DataFrame
data for prediction.

key

character
Name of the ID column..

features

character or list of characters, optional
Names of the feature columns.
If is not provided, it defaults to all non-ID columns.

Value

Predicted values are returned as a DataFrame, structured as follows.

See Also

hanaml.DBSCAN

Examples

## Not run: 
#'Perform the predict on DataFrame data2 using "DBSCAN" object dbscan:

> data2$Collect()
      ID  V000 V001  V002
   1   1  0.10  0.10  B
   2   2  0.11  0.10  A
   3   3  0.10  0.11  C
   4   4  0.11  0.11  B
   5   5  0.12  0.11  A
    ...
   28 28 16.11 16.11  A
   29 29 20.11 20.12  C
   30 30 15.12 15.11  A
> fitted <- predict(model = dbscan, data = data2)
> fitted$Collect()
      ID   CLUSTER_ID  DISTANCE
  1   1          0    0.000
  2   2          0    0.000
  3   3          0    0.000
  4   4          0    0.000
  5   5          0    0.000
  ...
  28 28         -1   11.950
  29 29         -1   21.374
  30 30         -1    9.960

## End(Not run)

[Package hana.ml.r version 1.0.8 Index]