trained Model in Python Notebook

arash_fard
arash_fard Registered Posts: 1 ✭✭✭

I'm trying to call a model that was deployed on my flow in a Python Notebook.

The reason is to build a webapp.

to do so, I created a notebook where I generated new data and made a call to the model a follows :

m = dataiku.Model("4bJu8Aug")
my_predictor = m.get_predictor()

a new data is df.

my question is, which function I need to call to predict(df)?


Operating system used: windows

Answers

  • Sarina
    Sarina Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 317 Dataiker
    edited July 17

    Hi @arash_fard
    ,

    You can get the clf object and then use clf.predictor() like so:

    model = dataiku.Model('9pPIVJO4')
    p = model.get_predictor()
    clf = p._clf
    
    clf.predict(X_test)


    Just in case it's useful as well, if you are curious about a fuller example, you can click on Actions > Export to Jupyter notebook from your visual model to see more detailed steps.

    Let me know if this is not what you are looking for.

    Thank you,
    Sarina

Setup Info
    Tags
      Help me…