| hanaml.AffinityPropagation {hana.ml.r} | R Documentation |
hanaml.AffinityPropagation is a R wrapper for PAL Affinity Propagation algorithm.
hanaml.AffinityPropagation(conn.context,
data,
key,
features = NULL,
affinity,
n.clusters,
max.iter = NULL,
convergence.iter = NULL,
damping = NULL,
preference = NULL,
seed.ratio = NULL,
times = NULL,
minkowski.power = NULL,
thread.ratio = NULL)
conn.context |
|
data |
|
key |
|
features |
|
affinity |
No default value as it is mandatory. |
n.clusters |
|
max.iter |
|
convergence.iter |
|
damping |
|
preference |
|
seed.ratio |
|
times |
|
minkowski.power |
|
thread.ratio |
|
R6Class object.
An "AffinityPropagation" object with the following attributes:
labels : DataFrame
Label assigned to each sample,structured as follows:
- ID, record ID.
- CLUSTER_ID, the range is from 0 to n.clusters - 1.
statistics : DataFrame
Statistic value, structured as follows:
- STAT_NAME, Statistic name.
- STAT_VALUE, Statistic value.
## Not run:
Input DataFrame data:
> data$collect()
ID V1 V2
0 1 0.10 0.10
1 2 0.11 0.10
2 3 0.10 0.11
3 4 0.11 0.11
4 5 0.12 0.11
5 6 0.11 0.12
20 21 10.13 10.12
21 22 10.13 10.13
22 23 10.13 10.14
23 24 10.14 10.13
Create a AffinityPropagation instance:
> ap <- hanaml.AffinityPropagation(conn.context = conn,
data = data,
affinity = 'euclidean',
n.clusters = 0L,
max.iter = 500L,
convergence.iter = 100L,
damping = 0.9,
preference = 0.5,
times = 1L,
seed.ratio = 1,
minkowski.power = 0,
thread.ratio = 0)
Expected output:
> ap$labels$collect()
ID CLUSTER_ID
0 1 0
1 2 0
2 3 0
3 4 0
4 5 0
5 6 0
...
21 22 1
22 23 1
23 24 1
## End(Not run)