Custom Python Model runned with no description
![Kouegou Kamen](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar4.png)
Kouegou Kamen
Dataiku DSS Core Concepts, Registered Posts: 6 ✭✭✭✭
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
-
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 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,598 Neuron
@Boris
,That sounds wonderful. Would you be willing to share an updated code snip-it showing how you solved this issue?