new KMeansModel(clusterCenters)
A Java-friendly constructor that takes an Iterable of Vectors.
Parameters:
Name | Type | Description |
---|---|---|
clusterCenters |
Array.<Vector> |
- Source:
Methods
(static) load(sc, path) → {module:eclairjs/mllib/clustering.KMeansModel}
Parameters:
Name | Type | Description |
---|---|---|
sc |
module:eclairjs.SparkContext | |
path |
string |
- Source:
Returns:
clusterCenters() → {Promise.<Array.<Vector>>}
- Source:
Returns:
- Type
- Promise.<Array.<Vector>>
computeCost(data) → {Promise.<number>}
Return the K-means cost (sum of squared distances of points to their nearest center) for this
model on the given data.
Parameters:
Name | Type | Description |
---|---|---|
data |
module:eclairjs/rdd.RDD |
- Source:
Returns:
- Type
- Promise.<number>
k() → {Promise.<number>}
Total number of clusters.
- Source:
Returns:
- Type
- Promise.<number>
predict0(point) → {Promise.<number>}
Returns the cluster index that a given point belongs to.
Parameters:
Name | Type | Description |
---|---|---|
point |
module:eclairjs/mllib/linalg.Vector |
- Source:
Returns:
- Type
- Promise.<number>
predict1(points) → {module:eclairjs/rdd.RDD}
Maps given points to their cluster indices.
Parameters:
Name | Type | Description |
---|---|---|
points |
module:eclairjs/rdd.RDD |
- Source:
Returns:
predict2(points) → {JavaRDD}
Maps given points to their cluster indices.
Parameters:
Name | Type | Description |
---|---|---|
points |
JavaRDD |
- Source:
Returns:
- Type
- JavaRDD
save(sc, path) → {Promise.<Void>}
Parameters:
Name | Type | Description |
---|---|---|
sc |
module:eclairjs.SparkContext | |
path |
string |
- Source:
Returns:
A Promise that resolves to nothing.
- Type
- Promise.<Void>