Package smile.clustering
Class Partitioning
java.lang.Object
smile.clustering.Partitioning
- All Implemented Interfaces:
Serializable
Clustering partitions. Partitioning methods classify the data points
into distinct non-overlapping groups.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]
group()
Returns the cluster labels of data points.int
group
(int i) Returns the cluster label of i-th data point.int
k()
Returns the number of clusters.int[]
size()
Returns the numbers of data points in each cluster.int
size
(int i) Returns the number of data points of i-th cluster.toString()
-
Constructor Details
-
Partitioning
public Partitioning(int k, int[] group) Constructor.- Parameters:
k
- the number of clusters.group
- the cluster labels.
-
-
Method Details
-
k
public int k()Returns the number of clusters.- Returns:
- the number of clusters.
-
group
public int[] group()Returns the cluster labels of data points.- Returns:
- the cluster labels of data points.
-
group
public int group(int i) Returns the cluster label of i-th data point.- Parameters:
i
- the index of data point.- Returns:
- the cluster label.
-
size
public int[] size()Returns the numbers of data points in each cluster.- Returns:
- the numbers of data points in each cluster.
-
size
public int size(int i) Returns the number of data points of i-th cluster.- Parameters:
i
- the index of cluster.- Returns:
- the number of data points in i-th cluster.
-
toString
-