2014-02-08 14:39:13 -05:00
|
|
|
---
|
|
|
|
layout: global
|
2014-05-18 20:00:57 -04:00
|
|
|
title: Clustering - MLlib
|
|
|
|
displayTitle: <a href="mllib-guide.html">MLlib</a> - Clustering
|
2014-02-08 14:39:13 -05:00
|
|
|
---
|
|
|
|
|
|
|
|
* Table of contents
|
|
|
|
{:toc}
|
|
|
|
|
|
|
|
|
2014-04-22 14:20:47 -04:00
|
|
|
## Clustering
|
2014-02-08 14:39:13 -05:00
|
|
|
|
|
|
|
Clustering is an unsupervised learning problem whereby we aim to group subsets
|
|
|
|
of entities with one another based on some notion of similarity. Clustering is
|
|
|
|
often used for exploratory analysis and/or as a component of a hierarchical
|
|
|
|
supervised learning pipeline (in which distinct classifiers or regression
|
2014-04-22 14:20:47 -04:00
|
|
|
models are trained for each cluster).
|
|
|
|
|
|
|
|
MLlib supports
|
2014-02-08 14:39:13 -05:00
|
|
|
[k-means](http://en.wikipedia.org/wiki/K-means_clustering) clustering, one of
|
|
|
|
the most commonly used clustering algorithms that clusters the data points into
|
2014-05-06 23:07:22 -04:00
|
|
|
predefined number of clusters. The MLlib implementation includes a parallelized
|
2014-02-08 14:39:13 -05:00
|
|
|
variant of the [k-means++](http://en.wikipedia.org/wiki/K-means%2B%2B) method
|
|
|
|
called [kmeans||](http://theory.stanford.edu/~sergei/papers/vldb12-kmpar.pdf).
|
|
|
|
The implementation in MLlib has the following parameters:
|
|
|
|
|
|
|
|
* *k* is the number of desired clusters.
|
|
|
|
* *maxIterations* is the maximum number of iterations to run.
|
|
|
|
* *initializationMode* specifies either random initialization or
|
|
|
|
initialization via k-means\|\|.
|
|
|
|
* *runs* is the number of times to run the k-means algorithm (k-means is not
|
|
|
|
guaranteed to find a globally optimal solution, and when run multiple times on
|
|
|
|
a given dataset, the algorithm returns the best clustering result).
|
2014-05-06 23:07:22 -04:00
|
|
|
* *initializationSteps* determines the number of steps in the k-means\|\| algorithm.
|
2014-02-08 14:39:13 -05:00
|
|
|
* *epsilon* determines the distance threshold within which we consider k-means to have converged.
|
|
|
|
|
2014-11-01 01:30:12 -04:00
|
|
|
### Examples
|
2014-02-08 14:39:13 -05:00
|
|
|
|
2014-04-22 14:20:47 -04:00
|
|
|
<div class="codetabs">
|
|
|
|
<div data-lang="scala" markdown="1">
|
2014-08-12 20:15:21 -04:00
|
|
|
The following code snippets can be executed in `spark-shell`.
|
2014-02-08 14:39:13 -05:00
|
|
|
|
2014-04-22 14:20:47 -04:00
|
|
|
In the following example after loading and parsing data, we use the
|
2014-05-18 20:00:57 -04:00
|
|
|
[`KMeans`](api/scala/index.html#org.apache.spark.mllib.clustering.KMeans) object to cluster the data
|
2014-02-08 14:39:13 -05:00
|
|
|
into two clusters. The number of desired clusters is passed to the algorithm. We then compute Within
|
|
|
|
Set Sum of Squared Error (WSSSE). You can reduce this error measure by increasing *k*. In fact the
|
|
|
|
optimal *k* is usually one where there is an "elbow" in the WSSSE graph.
|
|
|
|
|
|
|
|
{% highlight scala %}
|
|
|
|
import org.apache.spark.mllib.clustering.KMeans
|
[WIP] SPARK-1430: Support sparse data in Python MLlib
This PR adds a SparseVector class in PySpark and updates all the regression, classification and clustering algorithms and models to support sparse data, similar to MLlib. I chose to add this class because SciPy is quite difficult to install in many environments (more so than NumPy), but I plan to add support for SciPy sparse vectors later too, and make the methods work transparently on objects of either type.
On the Scala side, we keep Python sparse vectors sparse and pass them to MLlib. We always return dense vectors from our models.
Some to-do items left:
- [x] Support SciPy's scipy.sparse matrix objects when SciPy is available. We can easily add a function to convert these to our own SparseVector.
- [x] MLlib currently uses a vector with one extra column on the left to represent what we call LabeledPoint in Scala. Do we really want this? It may get annoying once you deal with sparse data since you must add/subtract 1 to each feature index when training. We can remove this API in 1.0 and use tuples for labeling.
- [x] Explain how to use these in the Python MLlib docs.
CC @mengxr, @joshrosen
Author: Matei Zaharia <matei@databricks.com>
Closes #341 from mateiz/py-ml-update and squashes the following commits:
d52e763 [Matei Zaharia] Remove no-longer-needed slice code and handle review comments
ea5a25a [Matei Zaharia] Fix remaining uses of copyto() after merge
b9f97a3 [Matei Zaharia] Fix test
1e1bd0f [Matei Zaharia] Add MLlib logistic regression example in Python
88bc01f [Matei Zaharia] Clean up inheritance of LinearModel in Python, and expose its parametrs
37ab747 [Matei Zaharia] Fix some examples and docs due to changes in MLlib API
da0f27e [Matei Zaharia] Added a MLlib K-means example and updated docs to discuss sparse data
c48e85a [Matei Zaharia] Added some tests for passing lists as input, and added mllib/tests.py to run-tests script.
a07ba10 [Matei Zaharia] Fix some typos and calculation of initial weights
74eefe7 [Matei Zaharia] Added LabeledPoint class in Python
889dde8 [Matei Zaharia] Support scipy.sparse matrices in all our algorithms and models
ab244d1 [Matei Zaharia] Allow SparseVectors to be initialized using a dict
a5d6426 [Matei Zaharia] Add linalg.py to run-tests script
0e7a3d8 [Matei Zaharia] Keep vectors sparse in Java when reading LabeledPoints
eaee759 [Matei Zaharia] Update regression, classification and clustering models for sparse data
2abbb44 [Matei Zaharia] Further work to get linear models working with sparse data
154f45d [Matei Zaharia] Update docs, name some magic values
881fef7 [Matei Zaharia] Added a sparse vector in Python and made Java-Python format more compact
2014-04-15 23:33:24 -04:00
|
|
|
import org.apache.spark.mllib.linalg.Vectors
|
2014-02-08 14:39:13 -05:00
|
|
|
|
|
|
|
// Load and parse the data
|
2014-07-13 22:27:43 -04:00
|
|
|
val data = sc.textFile("data/mllib/kmeans_data.txt")
|
[SPARK-1484][MLLIB] Warn when running an iterative algorithm on uncached data.
Add warnings to KMeans, GeneralizedLinearAlgorithm, and computeSVD when called with input data that is not cached. KMeans is implemented iteratively, and I believe that GeneralizedLinearAlgorithm’s current optimizers are iterative and its future optimizers are also likely to be iterative. RowMatrix’s computeSVD is iterative against an RDD when run in DistARPACK mode. ALS and DecisionTree are iterative as well, but they implement RDD caching internally so do not require a warning.
I added a warning to GeneralizedLinearAlgorithm rather than inside its optimizers, where the iteration actually occurs, because internally GeneralizedLinearAlgorithm maps its input data to an uncached RDD before passing it to an optimizer. (In other words, the warning would be printed for every GeneralizedLinearAlgorithm run, regardless of whether its input is cached, if the warning were in GradientDescent or other optimizer.) I assume that use of an uncached RDD by GeneralizedLinearAlgorithm is intentional, and that the mapping there (adding label, intercepts and scaling) is a lightweight operation. Arguably a user calling an optimizer such as GradientDescent will be knowledgable enough to cache their data without needing a log warning, so lack of a warning in the optimizers may be ok.
Some of the documentation examples making use of these iterative algorithms did not cache their training RDDs (while others did). I updated the examples to always cache. I also fixed some (unrelated) minor errors in the documentation examples.
Author: Aaron Staple <aaron.staple@gmail.com>
Closes #2347 from staple/SPARK-1484 and squashes the following commits:
bd49701 [Aaron Staple] Address review comments.
ab2d4a4 [Aaron Staple] Disable warnings on python code path.
a7a0f99 [Aaron Staple] Change code comments per review comments.
7cca1dc [Aaron Staple] Change warning message text.
c77e939 [Aaron Staple] [SPARK-1484][MLLIB] Warn when running an iterative algorithm on uncached data.
3b6c511 [Aaron Staple] Minor doc example fixes.
2014-09-25 19:11:00 -04:00
|
|
|
val parsedData = data.map(s => Vectors.dense(s.split(' ').map(_.toDouble))).cache()
|
2014-02-08 14:39:13 -05:00
|
|
|
|
|
|
|
// Cluster the data into two classes using KMeans
|
|
|
|
val numClusters = 2
|
[WIP] SPARK-1430: Support sparse data in Python MLlib
This PR adds a SparseVector class in PySpark and updates all the regression, classification and clustering algorithms and models to support sparse data, similar to MLlib. I chose to add this class because SciPy is quite difficult to install in many environments (more so than NumPy), but I plan to add support for SciPy sparse vectors later too, and make the methods work transparently on objects of either type.
On the Scala side, we keep Python sparse vectors sparse and pass them to MLlib. We always return dense vectors from our models.
Some to-do items left:
- [x] Support SciPy's scipy.sparse matrix objects when SciPy is available. We can easily add a function to convert these to our own SparseVector.
- [x] MLlib currently uses a vector with one extra column on the left to represent what we call LabeledPoint in Scala. Do we really want this? It may get annoying once you deal with sparse data since you must add/subtract 1 to each feature index when training. We can remove this API in 1.0 and use tuples for labeling.
- [x] Explain how to use these in the Python MLlib docs.
CC @mengxr, @joshrosen
Author: Matei Zaharia <matei@databricks.com>
Closes #341 from mateiz/py-ml-update and squashes the following commits:
d52e763 [Matei Zaharia] Remove no-longer-needed slice code and handle review comments
ea5a25a [Matei Zaharia] Fix remaining uses of copyto() after merge
b9f97a3 [Matei Zaharia] Fix test
1e1bd0f [Matei Zaharia] Add MLlib logistic regression example in Python
88bc01f [Matei Zaharia] Clean up inheritance of LinearModel in Python, and expose its parametrs
37ab747 [Matei Zaharia] Fix some examples and docs due to changes in MLlib API
da0f27e [Matei Zaharia] Added a MLlib K-means example and updated docs to discuss sparse data
c48e85a [Matei Zaharia] Added some tests for passing lists as input, and added mllib/tests.py to run-tests script.
a07ba10 [Matei Zaharia] Fix some typos and calculation of initial weights
74eefe7 [Matei Zaharia] Added LabeledPoint class in Python
889dde8 [Matei Zaharia] Support scipy.sparse matrices in all our algorithms and models
ab244d1 [Matei Zaharia] Allow SparseVectors to be initialized using a dict
a5d6426 [Matei Zaharia] Add linalg.py to run-tests script
0e7a3d8 [Matei Zaharia] Keep vectors sparse in Java when reading LabeledPoints
eaee759 [Matei Zaharia] Update regression, classification and clustering models for sparse data
2abbb44 [Matei Zaharia] Further work to get linear models working with sparse data
154f45d [Matei Zaharia] Update docs, name some magic values
881fef7 [Matei Zaharia] Added a sparse vector in Python and made Java-Python format more compact
2014-04-15 23:33:24 -04:00
|
|
|
val numIterations = 20
|
2014-02-08 14:39:13 -05:00
|
|
|
val clusters = KMeans.train(parsedData, numClusters, numIterations)
|
|
|
|
|
|
|
|
// Evaluate clustering by computing Within Set Sum of Squared Errors
|
|
|
|
val WSSSE = clusters.computeCost(parsedData)
|
|
|
|
println("Within Set Sum of Squared Errors = " + WSSSE)
|
|
|
|
{% endhighlight %}
|
2014-04-22 14:20:47 -04:00
|
|
|
</div>
|
2014-02-08 14:39:13 -05:00
|
|
|
|
2014-04-22 14:20:47 -04:00
|
|
|
<div data-lang="java" markdown="1">
|
2014-02-08 14:39:13 -05:00
|
|
|
All of MLlib's methods use Java-friendly types, so you can import and call them there the same
|
|
|
|
way you do in Scala. The only caveat is that the methods take Scala RDD objects, while the
|
|
|
|
Spark Java API uses a separate `JavaRDD` class. You can convert a Java RDD to a Scala one by
|
2014-10-15 00:37:51 -04:00
|
|
|
calling `.rdd()` on your `JavaRDD` object. A self-contained application example
|
2014-08-12 20:15:21 -04:00
|
|
|
that is equivalent to the provided example in Scala is given below:
|
2014-07-20 23:48:44 -04:00
|
|
|
|
|
|
|
{% highlight java %}
|
|
|
|
import org.apache.spark.api.java.*;
|
|
|
|
import org.apache.spark.api.java.function.Function;
|
|
|
|
import org.apache.spark.mllib.clustering.KMeans;
|
|
|
|
import org.apache.spark.mllib.clustering.KMeansModel;
|
|
|
|
import org.apache.spark.mllib.linalg.Vector;
|
|
|
|
import org.apache.spark.mllib.linalg.Vectors;
|
|
|
|
import org.apache.spark.SparkConf;
|
|
|
|
|
|
|
|
public class KMeansExample {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
SparkConf conf = new SparkConf().setAppName("K-means Example");
|
|
|
|
JavaSparkContext sc = new JavaSparkContext(conf);
|
|
|
|
|
|
|
|
// Load and parse data
|
|
|
|
String path = "data/mllib/kmeans_data.txt";
|
|
|
|
JavaRDD<String> data = sc.textFile(path);
|
|
|
|
JavaRDD<Vector> parsedData = data.map(
|
|
|
|
new Function<String, Vector>() {
|
|
|
|
public Vector call(String s) {
|
|
|
|
String[] sarray = s.split(" ");
|
|
|
|
double[] values = new double[sarray.length];
|
|
|
|
for (int i = 0; i < sarray.length; i++)
|
|
|
|
values[i] = Double.parseDouble(sarray[i]);
|
|
|
|
return Vectors.dense(values);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
[SPARK-1484][MLLIB] Warn when running an iterative algorithm on uncached data.
Add warnings to KMeans, GeneralizedLinearAlgorithm, and computeSVD when called with input data that is not cached. KMeans is implemented iteratively, and I believe that GeneralizedLinearAlgorithm’s current optimizers are iterative and its future optimizers are also likely to be iterative. RowMatrix’s computeSVD is iterative against an RDD when run in DistARPACK mode. ALS and DecisionTree are iterative as well, but they implement RDD caching internally so do not require a warning.
I added a warning to GeneralizedLinearAlgorithm rather than inside its optimizers, where the iteration actually occurs, because internally GeneralizedLinearAlgorithm maps its input data to an uncached RDD before passing it to an optimizer. (In other words, the warning would be printed for every GeneralizedLinearAlgorithm run, regardless of whether its input is cached, if the warning were in GradientDescent or other optimizer.) I assume that use of an uncached RDD by GeneralizedLinearAlgorithm is intentional, and that the mapping there (adding label, intercepts and scaling) is a lightweight operation. Arguably a user calling an optimizer such as GradientDescent will be knowledgable enough to cache their data without needing a log warning, so lack of a warning in the optimizers may be ok.
Some of the documentation examples making use of these iterative algorithms did not cache their training RDDs (while others did). I updated the examples to always cache. I also fixed some (unrelated) minor errors in the documentation examples.
Author: Aaron Staple <aaron.staple@gmail.com>
Closes #2347 from staple/SPARK-1484 and squashes the following commits:
bd49701 [Aaron Staple] Address review comments.
ab2d4a4 [Aaron Staple] Disable warnings on python code path.
a7a0f99 [Aaron Staple] Change code comments per review comments.
7cca1dc [Aaron Staple] Change warning message text.
c77e939 [Aaron Staple] [SPARK-1484][MLLIB] Warn when running an iterative algorithm on uncached data.
3b6c511 [Aaron Staple] Minor doc example fixes.
2014-09-25 19:11:00 -04:00
|
|
|
parsedData.cache();
|
2014-07-20 23:48:44 -04:00
|
|
|
|
|
|
|
// Cluster the data into two classes using KMeans
|
|
|
|
int numClusters = 2;
|
|
|
|
int numIterations = 20;
|
|
|
|
KMeansModel clusters = KMeans.train(parsedData.rdd(), numClusters, numIterations);
|
|
|
|
|
|
|
|
// Evaluate clustering by computing Within Set Sum of Squared Errors
|
|
|
|
double WSSSE = clusters.computeCost(parsedData.rdd());
|
|
|
|
System.out.println("Within Set Sum of Squared Errors = " + WSSSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{% endhighlight %}
|
2014-04-22 14:20:47 -04:00
|
|
|
</div>
|
2014-02-08 14:39:13 -05:00
|
|
|
|
2014-04-22 14:20:47 -04:00
|
|
|
<div data-lang="python" markdown="1">
|
2014-08-12 20:15:21 -04:00
|
|
|
The following examples can be tested in the PySpark shell.
|
2014-02-08 14:39:13 -05:00
|
|
|
|
2014-04-22 14:20:47 -04:00
|
|
|
In the following example after loading and parsing data, we use the KMeans object to cluster the
|
|
|
|
data into two clusters. The number of desired clusters is passed to the algorithm. We then compute
|
|
|
|
Within Set Sum of Squared Error (WSSSE). You can reduce this error measure by increasing *k*. In
|
|
|
|
fact the optimal *k* is usually one where there is an "elbow" in the WSSSE graph.
|
2014-02-08 14:39:13 -05:00
|
|
|
|
|
|
|
{% highlight python %}
|
|
|
|
from pyspark.mllib.clustering import KMeans
|
|
|
|
from numpy import array
|
|
|
|
from math import sqrt
|
|
|
|
|
|
|
|
# Load and parse the data
|
2014-07-13 22:27:43 -04:00
|
|
|
data = sc.textFile("data/mllib/kmeans_data.txt")
|
2014-02-08 14:39:13 -05:00
|
|
|
parsedData = data.map(lambda line: array([float(x) for x in line.split(' ')]))
|
|
|
|
|
|
|
|
# Build the model (cluster the data)
|
|
|
|
clusters = KMeans.train(parsedData, 2, maxIterations=10,
|
2014-04-22 14:20:47 -04:00
|
|
|
runs=10, initializationMode="random")
|
2014-02-08 14:39:13 -05:00
|
|
|
|
|
|
|
# Evaluate clustering by computing Within Set Sum of Squared Errors
|
|
|
|
def error(point):
|
|
|
|
center = clusters.centers[clusters.predict(point)]
|
|
|
|
return sqrt(sum([x**2 for x in (point - center)]))
|
|
|
|
|
|
|
|
WSSSE = parsedData.map(lambda point: error(point)).reduce(lambda x, y: x + y)
|
|
|
|
print("Within Set Sum of Squared Error = " + str(WSSSE))
|
|
|
|
{% endhighlight %}
|
2014-04-22 14:20:47 -04:00
|
|
|
</div>
|
2014-02-08 14:39:13 -05:00
|
|
|
|
2014-04-22 14:20:47 -04:00
|
|
|
</div>
|
2014-10-15 00:37:51 -04:00
|
|
|
|
|
|
|
In order to run the above application, follow the instructions
|
|
|
|
provided in the [Self-Contained Applications](quick-start.html#self-contained-applications)
|
|
|
|
section of the Spark
|
|
|
|
Quick Start guide. Be sure to also include *spark-mllib* to your build file as
|
|
|
|
a dependency.
|
2014-11-01 01:30:12 -04:00
|
|
|
|
|
|
|
## Streaming clustering
|
|
|
|
|
|
|
|
When data arrive in a stream, we may want to estimate clusters dynamically,
|
|
|
|
updating them as new data arrive. MLlib provides support for streaming k-means clustering,
|
|
|
|
with parameters to control the decay (or "forgetfulness") of the estimates. The algorithm
|
|
|
|
uses a generalization of the mini-batch k-means update rule. For each batch of data, we assign
|
|
|
|
all points to their nearest cluster, compute new cluster centers, then update each cluster using:
|
|
|
|
|
|
|
|
`\begin{equation}
|
|
|
|
c_{t+1} = \frac{c_tn_t\alpha + x_tm_t}{n_t\alpha+m_t}
|
|
|
|
\end{equation}`
|
|
|
|
`\begin{equation}
|
|
|
|
n_{t+1} = n_t + m_t
|
|
|
|
\end{equation}`
|
|
|
|
|
|
|
|
Where `$c_t$` is the previous center for the cluster, `$n_t$` is the number of points assigned
|
|
|
|
to the cluster thus far, `$x_t$` is the new cluster center from the current batch, and `$m_t$`
|
|
|
|
is the number of points added to the cluster in the current batch. The decay factor `$\alpha$`
|
|
|
|
can be used to ignore the past: with `$\alpha$=1` all data will be used from the beginning;
|
|
|
|
with `$\alpha$=0` only the most recent data will be used. This is analogous to an
|
|
|
|
exponentially-weighted moving average.
|
|
|
|
|
|
|
|
The decay can be specified using a `halfLife` parameter, which determines the
|
|
|
|
correct decay factor `a` such that, for data acquired
|
|
|
|
at time `t`, its contribution by time `t + halfLife` will have dropped to 0.5.
|
|
|
|
The unit of time can be specified either as `batches` or `points` and the update rule
|
|
|
|
will be adjusted accordingly.
|
|
|
|
|
|
|
|
### Examples
|
|
|
|
|
|
|
|
This example shows how to estimate clusters on streaming data.
|
|
|
|
|
|
|
|
<div class="codetabs">
|
|
|
|
|
|
|
|
<div data-lang="scala" markdown="1">
|
|
|
|
|
|
|
|
First we import the neccessary classes.
|
|
|
|
|
|
|
|
{% highlight scala %}
|
|
|
|
|
|
|
|
import org.apache.spark.mllib.linalg.Vectors
|
|
|
|
import org.apache.spark.mllib.regression.LabeledPoint
|
|
|
|
import org.apache.spark.mllib.clustering.StreamingKMeans
|
|
|
|
|
|
|
|
{% endhighlight %}
|
|
|
|
|
|
|
|
Then we make an input stream of vectors for training, as well as a stream of labeled data
|
|
|
|
points for testing. We assume a StreamingContext `ssc` has been created, see
|
|
|
|
[Spark Streaming Programming Guide](streaming-programming-guide.html#initializing) for more info.
|
|
|
|
|
|
|
|
{% highlight scala %}
|
|
|
|
|
|
|
|
val trainingData = ssc.textFileStream("/training/data/dir").map(Vectors.parse)
|
|
|
|
val testData = ssc.textFileStream("/testing/data/dir").map(LabeledPoint.parse)
|
|
|
|
|
|
|
|
{% endhighlight %}
|
|
|
|
|
|
|
|
We create a model with random clusters and specify the number of clusters to find
|
|
|
|
|
|
|
|
{% highlight scala %}
|
|
|
|
|
|
|
|
val numDimensions = 3
|
|
|
|
val numClusters = 2
|
|
|
|
val model = new StreamingKMeans()
|
|
|
|
.setK(numClusters)
|
|
|
|
.setDecayFactor(1.0)
|
|
|
|
.setRandomCenters(numDimensions, 0.0)
|
|
|
|
|
|
|
|
{% endhighlight %}
|
|
|
|
|
|
|
|
Now register the streams for training and testing and start the job, printing
|
|
|
|
the predicted cluster assignments on new data points as they arrive.
|
|
|
|
|
|
|
|
{% highlight scala %}
|
|
|
|
|
|
|
|
model.trainOn(trainingData)
|
|
|
|
model.predictOnValues(testData).print()
|
|
|
|
|
|
|
|
ssc.start()
|
|
|
|
ssc.awaitTermination()
|
|
|
|
|
|
|
|
{% endhighlight %}
|
|
|
|
|
|
|
|
As you add new text files with data the cluster centers will update. Each training
|
|
|
|
point should be formatted as `[x1, x2, x3]`, and each test data point
|
|
|
|
should be formatted as `(y, [x1, x2, x3])`, where `y` is some useful label or identifier
|
|
|
|
(e.g. a true category assignment). Anytime a text file is placed in `/training/data/dir`
|
|
|
|
the model will update. Anytime a text file is placed in `/testing/data/dir`
|
|
|
|
you will see predictions. With new data, the cluster centers will change!
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|