Custom Python Model runned with no description

Options
Boris
Boris Dataiku DSS Core Concepts, Registered Posts: 6 ✭✭✭✭
edited July 16 in Using Dataiku

How can I explore a Custom ML model runned on Dataiku succesfully but with no description at the end ?

I have tried to deploy the model and import it in a python recipe to understand the configuration (best fit model, parameters,...) but I have a Dataiku object in the recipe, and I don't know the functions for dataiku object.

Here is the Gridsearch/ML model:

from sklearn.ensemble import RandomForestClassifier
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import RobustScaler
from sklearn.model_selection import GridSearchCV



# Pipeline definition with preprocessing ( Robustscaler)

randomF = {}

randomF['pipeline'] = Pipeline([
    ('scaler', RobustScaler()),
    ('rf', RandomForestClassifier())
])


randomF['hyperparameters'] = {}

randomF['hyperparameters']['rf__n_estimators'] = [50, 100, 150, 200]
randomF['hyperparameters']['rf__criterion']  =  ['gini', 'entropy']
randomF['hyperparameters']['rf__min_samples_split']  = [2 , 5]
randomF['hyperparameters']['rf__max_depth'] =  [20, 5, 10]
randomF['hyperparameters']['rf__min_samples_leaf'] =  [2,3]
randomF['hyperparameters']['rf__bootstrap'] = [True, False]
randomF['hyperparameters']['rf__class_weight']  =  [None, 'balanced', 'balanced_subsample']


randomF['gridsearch'] = GridSearchCV(randomF['pipeline'], 
                                    randomF['hyperparameters'],
                                    scoring = "neg_log_loss",
                                    cv = 5,
                                    n_jobs = -1,
                                    refit = True,
                                    fit_params=None,
                                    iid=True,
                                    verbose=0,
                                    pre_dispatch='2*n_jobs'
                                    )
clf = randomF['gridsearch']

Answers

  • Boris
    Boris Dataiku DSS Core Concepts, Registered Posts: 6 ✭✭✭✭
    Options

    I finally got the way using the dir commande in a python recipe, the attribute '._clf' give access to the trained model and all the sklearn characteristics.

  • tgb417
    tgb417 Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Frontrunner 2022 Finalist, Frontrunner 2022 Winner, Dataiku Frontrunner Awards 2021 Participant, Frontrunner 2022 Participant, Neuron 2023 Posts: 1,595 Neuron
    Options

    @Boris
    ,

    That sounds wonderful. Would you be willing to share an updated code snip-it showing how you solved this issue?

Setup Info
    Tags
      Help me…