DataPredict

API Reference - Models - KMedoids

KMedoids is an unsupervised machine learning model that assigns data points to clusters by selecting representative points, called medoids, as cluster centers. It then predicts the cluster membership of new data points based on their distances to the medoids.

Stored Model Parameters

Contains a matrix.

Constructors

new()

Create new model object. If any of the arguments are nil, default argument values for that argument will be used.

KMedoids.new(maximumNumberOfIterations: integer, numberOfClusters: integer, distanceFunction: string, setTheCentroidsDistanceFarthest: boolean): ModelObject

Parameters:

Returns:

Functions

setParameters()

Set model’s parameters. When any of the arguments are nil, previous argument values for that argument will be used.

KMedoids:setParameters(maximumNumberOfIterations: integer, numberOfClusters: integer, distanceFunction: string, setTheCentroidsDistanceFarthest: boolean)

Parameters:

train()

Train the model.

KMedoids:train(featureMatrix: Matrix)

Parameters:

Returns:

predict()

Predict which clusters does it belong to for a given data.

KMedoids:predict(featureMatrix: Matrix, returnOriginalOutput: boolean): integer, number -OR-

Parameters:

Returns:

Inherited From