Skip to content

Predict clustering

inferencemodelscluster

Use a pretrained clustering model to predict new data.

Usually employed after the train_clustering step.

Prediction Model

To use this step successfully you need to make sure the dataset you're predicting on is as similar as possible to the one the model was trained on. We check that the necessary data types and columns are present, but you should pay attention to how you handled these in the recipe the model was generated. Any changes might lead to a significant degradation in model performance.

Usage


The following are the step's expected inputs and outputs and their specific types.

Step signature
predict_clustering(
    ds: dataset,
    model: model_clustering[ds]
) -> (predicted: category)

where the object {"param": value} is optional in most cases and if present may contain any of the parameters described in the corresponding section below.

Example

Example call (in recipe editor)
predict_clustering(ds, model) -> (data.predicted)

Inputs


ds: dataset

Contains the target column and the rest of the columns you wish to use in the model.


model: file:model_clustering[ds]

File containing the model used to make the prediction.

Outputs


predicted: column:category

Column containing the model predictions.