new KMeansModel() → (nullable) {?}
A Java-friendly constructor that takes an Iterable of Vectors.
Parameters:
Name | Type | Description |
---|---|---|
{@module:eclairjs/mllib/linalg.Vector[]} |
clusterCenters |
Returns:
- Type
- ?
Methods
(static) load(sc, path) → {KMeansModel}
Parameters:
Name | Type | Description |
---|---|---|
sc |
module:eclairjs.SparkContext | |
path |
string |
Returns:
- Type
- KMeansModel
clusterCenters()
Returns:
{@module:eclairjs/mllib/linalg.Vector[]}
computeCost(data) → {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 |
Returns:
- Type
- number
k() → {number}
Total number of clusters.
Returns:
- Type
- number
predict0(point) → {number}
Returns the cluster index that a given point belongs to.
Parameters:
Name | Type | Description |
---|---|---|
point |
module:eclairjs/mllib/linalg.Vector |
Returns:
- Type
- number
predict1(points) → {module:eclairjs.RDD}
Maps given points to their cluster indices.
Parameters:
Name | Type | Description |
---|---|---|
points |
module:eclairjs.RDD |
Returns:
- Type
- module:eclairjs.RDD
predict2(points) → {module:eclairjs.RDD}
Maps given points to their cluster indices.
Parameters:
Name | Type | Description |
---|---|---|
points |
module:eclairjs.RDD |
Returns:
- Type
- module:eclairjs.RDD
save(sc, path)
Parameters:
Name | Type | Description |
---|---|---|
sc |
module:eclairjs.SparkContext | |
path |
string |
toPMML(pathopt, scopt) → {string}
Export the model to a local file in PMML format
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string |
<optional> |
|
sc |
module:eclairjs.SparkContext |
<optional> |
Export the model to a directory on a distributed file system in PMML format |
Returns:
Export the model as a String in PMML format
- Type
- string