ClusterKmeansResults

ClusterKmeansResults

Wrapper around the k-means clustering results on the Wasm heap, produced by clusterKmeans.

Classes

ClusterKmeansResults

Methods

centers(optionsopt) → {Float64Array|Float64WasmArray}

Source:
Parameters:
Name Type Attributes Default Description
options object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
copy boolean | string <optional>
true

Whether to copy the results from the Wasm heap, see possibleCopy.

Returns:

Array containing the cluster centers in column-major format, where rows are dimensions and columns are the clusters.

Type
Float64Array | Float64WasmArray

clusters(optionsopt) → {Int32Array|Int32WasmArray}

Source:
Parameters:
Name Type Attributes Default Description
options object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
copy boolean | string <optional>
true

Whether to copy the results from the Wasm heap, see possibleCopy.

Returns:

Array containing the cluster assignment for each cell.

Type
Int32Array | Int32WasmArray

free()

Source:
Returns:

Frees the memory allocated on the Wasm heap for this object. This invalidates this object and all references to it.

iterations() → {number}

Source:
Returns:

Number of refinement iterations performed by the algorithm.

Type
number

numberOfCells() → {number}

Source:
Returns:

Number of cells in the results.

Type
number

numberOfClusters() → {number}

Source:
Returns:

Number of clusters in the results.

Type
number

sizes(optionsopt) → {Int32Array|Int32WasmArray}

Source:
Parameters:
Name Type Attributes Default Description
options object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
copy boolean | string <optional>
true

Whether to copy the results from the Wasm heap, see possibleCopy.

Returns:

Array containing the number of cells in each cluster.

Type
Int32Array | Int32WasmArray

status() → {number}

Source:
Returns:

Status of the algorithm - anything other than zero usually indicates a problem with convergence.

Type
number