Survey banner
Switching to Dataiku - a new area to help users who are transitioning from other tools and diving into Dataiku! CHECK IT OUT

Saving Model Results from Python Recipe

Level 2
Saving Model Results from Python Recipe


First time working on a dataiku project. I've created a Python recipe after importing my data that does data cleaning, train/test split and has a model function that returns model results. I am trying to write it all through python and not utilize other recipes. Would there be a way from this to document the results of the model for model comparisons through Python?

def model(X_train, y_train, X_test, y_test, model):

model = model, y_res)
y_pred = model.predict(X_test)

f1 = f1_score(y_test, y_pred, average="macro")
acc = accuracy_score(y_test, y_pred)
prec = precision_score(y_test, y_pred, average=None)
recall = recall_score(y_test, y_pred, average=None)



return f1, acc, prec, recall




0 Kudos
1 Reply

Hi @nsrishan

The results of your model can be stored in an output dataset. Then you can use this dataset as an input in another Python recipe to compare the results of the model.

Examples of how to write the data in a dataset are here:  
What type of data does your model return?