Saving Model Results from Python Recipe

Options
nsrishan
nsrishan Registered Posts: 7 ✭✭✭

Hello,

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

model.fit(X_res, 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)

print(f1_score,acc,prec,recall)

tracker.stop()

return f1, acc, prec, recall

Answers

Setup Info
    Tags
      Help me…