| hanaml.Knn {hana.ml.r} | R Documentation |
hanaml.Knn is a R wrapper for PAL Knn.
hanaml.Knn (conn.context, data = NULL, key = NULL, features = NULL,
label = NULL, n.neighbors = NULL, thread.ratio = NULL,
attribute.num = NULL, voting.type = NULL,
stat.info = TRUE, metric = NULL, minkowski.power = NULL,
algorithm = NULL)
conn.context |
|
data |
|
key |
|
features |
|
label |
|
n.neighbors |
|
thread.ratio |
Defaults to 0. |
attribute.num |
|
voting.type |
Defaults to 'distance-weighted'. |
stat.info |
Defaults to TRUE. |
metric |
Defaults to 'euclidean'. |
minkowski.power |
Defaults to 3.0. |
algorithm |
Defaults to 'brute-force'. |
R6Class object.
K-Nearest Neighbor (KNN) is a memory-based classification or regression method with no explicit training phase. It assumes similar instances should have similar labels or values.
A "Knn" object.
## Not run:
Training data:
> df$Collect()
ID X1 X2 TYPE
0 0 1.0 1.0 2
1 1 10.0 10.0 3
2 2 10.0 11.0 3
3 3 10.0 10.0 3
4 4 1000.0 1000.0 1
5 5 1000.0 1001.0 1
6 6 1000.0 999.0 1
7 7 999.0 999.0 1
8 8 999.0 1000.0 1
9 9 1000.0 1000.0 1
> knn <- hanaml.Knn(connection.context, df, key="ID", features=list("X1", "X2"),
label="TYPE" n.neighbors=3, voting.type="majority",
thread.ratio=0.1, stat.info=FALSE)
## End(Not run)