Batch Processing¶
Algorithm Input¶
The K-Means clustering algorithm accepts the input described
below. Pass the Input ID
as a parameter to the methods that
provide input for your algorithm.
Input ID |
Input |
---|---|
|
Pointer to the \(n \times p\) numeric table with the data to be clustered. |
|
Pointer to the \(nClusters \times p\) numeric table with the initial centroids. |
Note
The input for data
and inputCentroids
can be an object of any class derived from NumericTable
.
Algorithm Parameters¶
The K-Means clustering algorithm has the following parameters:
Parameter |
Default Value |
Description |
---|---|---|
|
|
The floating-point type that the algorithm uses for intermediate computations. Can be |
|
|
Available computation methods for K-Means clustering: For CPU:
For GPU:
|
|
Not applicable |
The number of clusters. Required to initialize the algorithm. |
|
Not applicable |
The number of iterations. Required to initialize the algorithm. |
|
\(0.0\) |
The threshold for termination of the algorithm. |
|
\(1.0\) |
The weight to be used in distance calculation for binary categorical features. |
|
|
The measure of closeness between points (observations) being clustered. The only distance type supported so far is the Euclidean distance. |
DEPRECATED: USE INSTEAD: |
|
A flag that enables computation of assignments, that is, assigning cluster indices to respective observations. |
|
|
The 64-bit integer flag that specifies which extra characteristics of the K-Means algorithm to compute. Provide one of the following values to request a single characteristic or use bitwise OR to request a combination of the characteristics:
|
Algorithm Output¶
The K-Means clustering algorithm calculates the result described
below. Pass the Result ID
as a parameter to the methods that access
the results of your algorithm.
Result ID |
Result |
---|---|
|
Pointer to the \(nClusters \times p\) numeric table with the cluster centroids,
computed when Note By default, this result is an object of the |
|
Pointer to the \(n \times 1\) numeric table with
assignments of cluster indices to feature vectors in the input data,
computed when Note By default, this result is an object of the |
|
Pointer to the \(1 \times 1\) numeric table with the minimum value of the objective function
obtained at the last iteration of the algorithm, might be inexact.
When Note By default, this result is an object of the |
|
Pointer to the \(1 \times 1\) numeric table with the actual number of iterations done by the algorithm. Note By default, this result is an object of the |
Note
You can skip update of centroids and objectiveFunction in the
result and compute assignments using original inputCentroids.
To do this, set resultsToEvaluate
flag only to computeAssignments
and maxIterations
to zero.