kmodes_predict
Returns a list of all predicted clusters for the dataset and model parameters provided.
Syntax
pred = kmodes_predict(data,model)
Inputs
- data
- The dataset on which to perform k-modes prediction.
- model
- Type: struct
Outputs
- pred
- The predicted cluster number of each data point.
Example
Usage of kmodes_predict:
data = [1 0 1 2; 1 1 1 2; 1 1 2 0; 0 0 0 0; 0 0 1 2];
model = kmodes_fit(data);
pred = kmodes_predict(data, model)
pred = [Matrix] 5 x 1
2
2
1
3
2
Comments
The data set should not contain string categorical variables. If it does, you should convert or enumerate them before passing them into the function.