How do I apply a prediction using python

rkrause Registered Posts: 1 ✭✭✭

I have created a machine learning model and deployed it. It is a decision classifier. I used the predict recipe on a data set and received columns of probability for each possible classification plus the final prediction. Good stuff so far.

I'd like to work with the model in a python recipe. I want to apply the model of my choice to a data set of my choice and receive a result dataframe with the probabilities.

How is this done? I'm having trouble finding an example. My current roadblock is this, but I'm not sure it's even the right direction:

m = dataiku.Model('1PUZRzcO') #the id of one of my models
my_predictor = m.get_predictor()

Which gives an error:
ModuleNotFoundError: No module named 'sklearn.neural_network.multilayer_perceptron'


  • Clément_Stenac
    Clément_Stenac Dataiker, Dataiku DSS Core Designer Posts: 753 Dataiker


    You are on the right path. Your issue is likely that your Python recipe is not using the same code environment as the one that was used to train your model. You should use the same code environment to ensure that you have all the required packages, at the proper versions.

Setup Info
      Help me…