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

Make Predictions from a GaussianMixture Object

Description

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

Usage

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

Arguments

model

R6Class object
A 'GaussianMixture' 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 not provided, it defaults to all non-ID columns.

Value

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

See Also

hanaml.GaussianMixture

Examples

## Not run: 
#'Perform the predict on DataFrame data2 using "GaussianMixture" objectc gmm:

> data2$Collect()
 ID  X1   X2   X3
 0  0.10  0.10  1
 1  0.11  0.10  1
 2  0.10  0.11  1
 3  0.11  0.11  1
 4  0.12  0.11  1

> fitted <- predict(model = gmm, data = data2)
> fitted$Collect()
      ID  CLUSTER_ID  PROBABILITY
       0     0            1
       1     0            1
       2     0            0
       3     0            0
       4     0            0
       0     1            0
       1     1            0
       2     1            1
       3     1            1
       4     1            1

## End(Not run)

[Package hana.ml.r version 1.0.8 Index]