Class: KMeansModel

eclairjs/mllib/clustering. KMeansModel

new KMeansModel() → (nullable) {?}

A Java-friendly constructor that takes an Iterable of Vectors.
Parameters:
Name Type Description
{@module:eclairjs/mllib/linalg.Vector[]} clusterCenters
Source:
Returns:
Type
?

Methods

(static) load(sc, path) → {KMeansModel}

Parameters:
Name Type Description
sc module:eclairjs.SparkContext
path string
Source:
Returns:
Type
KMeansModel

clusterCenters()

Source:
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
Source:
Returns:
Type
number

k() → {number}

Total number of clusters.
Source:
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
Source:
Returns:
Type
number

predict1(points) → {module:eclairjs.RDD}

Maps given points to their cluster indices.
Parameters:
Name Type Description
points module:eclairjs.RDD
Source:
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
Source:
Returns:
Type
module:eclairjs.RDD

save(sc, path)

Parameters:
Name Type Description
sc module:eclairjs.SparkContext
path string
Source:

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
Source:
Returns:
Export the model as a String in PMML format
Type
string