hanaml.AffinityPropagation.Rdhanaml.AffinityPropagation is a R wrapper for SAP HANA PAL Affinity Propagation algorithm.
hanaml.AffinityPropagation( 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 )
| 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 |
|
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.
Input DataFrame data:
> data$Collect()
ID V1 V2
1 1 0.10 0.10
2 2 0.11 0.10
3 3 0.10 0.11
4 4 0.11 0.11
5 5 0.12 0.11
6 6 0.11 0.12
21 21 10.13 10.12
22 22 10.13 10.13
23 23 10.13 10.14
24 24 10.14 10.13
Call the function:
> ap <- hanaml.AffinityPropagation(data = data,
key = "ID",
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)
Output:
> ap$labels$collect()
ID CLUSTER_ID
1 1 0
2 2 0
3 3 0
4 4 0
5 5 0
6 6 0
......
22 22 1
23 23 1
24 24 1