predict.GaussianMixture.RdSimilar to other predict methods, this function predicts fitted values from a fitted GaussianMixture object.
# S3 method for GaussianMixture predict(model, data, key, features = NULL, ...)
| model |
|
|---|---|
| data |
|
| key |
|
| features |
|
| ... | Reserved parameter. |
S3 methods
Predicted values are returned as a DataFrame, structured as follows.
ID column, with same name and type as data 's ID column.
Cluster_ID, type INTEGER, the assigned cluster ID.
PROBABILITY, type DOUBLE, Probability that the instance belong to a particular cluster.
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)
Output:
> fitted$Collect()
ID CLUSTER_ID PROBABILITY
1 0 0 1
2 1 0 1
3 2 0 0
4 3 0 0
5 4 0 0
6 0 1 0
7 1 1 0
8 2 1 1
9 3 1 1
10 4 1 1