predict.Knn {hana.ml.r} | R Documentation |
Make Predictions from a "Knn" Object
## S3 method for class 'Knn' predict(model, data, key, features = NULL)
model |
|
data |
|
key |
|
features |
|
Predicted values are returned as a DataFrame, structured as follows.
result.df : DataFrame
Predicted result, structured as follows:
ID column, with same name and type as data's ID column.
Label column, with same name and type as training data's label column.
nearest.neighbors.df : DataFrame
The distance between each point in 'data' and its k nearest
neighbors in the training set. Only returned if stat.info is TRUE.
TEST_ + data's ID name, with same type as data's ID column, query data ID.
K, type INTEGER, K number.
TRAIN_ + training data's ID name, with same type as training data's ID column, neighbor point's ID.
DISTANCE, type DOUBLE, distance.
## Not run: Predict: > res <- predict(knn, pred.df, "ID") > res$Collect() ID TYPE 0 0 3 1 1 3 2 2 3 3 3 1 4 4 1 5 5 1 6 6 1 7 7 1 ## End(Not run)