Can't get the predictor from a clustering model handler using the python API

Antal
Antal Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 88 Neuron

I've been having success manipulating saved models using the python public API for both prediction and classification models to get more information from them and use the predictors in recipes.

But I'm having trouble doing the same with clustering models trained in VisualML and deployed to the flow.

I usually do

import dataiku
model = dataiku.Model("model_id")
predictor = model.get_predictor()

But with clustering models, I get an error.

If I look at

model._predictors

I also see a result of only

{}

It seems some parameter set is missing from the clustering model object to succesfully run the get_predictor() method. Is there another way that I can extract the sklearn predictor from a VisualML clustering model using the python API?


Operating system used: Windows 10

Best Answer

Answers

  • Antal
    Antal Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 88 Neuron

    Hi Sarina,

    That's great news!

    I was working on a workaround by loading the clusterer.pkl from the model directory on disk. But I had quite some trouble trying to reconstruct the data preprocessing scripts.

    Having a get_predictor() method is so much easier!

Setup Info
    Tags
      Help me…