Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on December 30, 2022 3:00PM
Likes: 0
Replies: 2
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
Hi @Antal
,
You can use get_predictor() on clustering models starting in DSS 11.1! Here is an example:
I would suggest upgrading to the latest release if you are able to.
Thanks,
Sarina
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!