Created
July 18, 2021 03:53
-
-
Save afcotroneo/df9af8d24e4c41bcbba12d409c6f0cf1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # get predictions | |
| y_pred = RFtree.predict(test_features) | |
| # compute accuracy metric, then log | |
| R2_score = r2_score(test_labels, y_pred) | |
| print("R2_Score: ", R2_score) | |
| mlflow.log_metric("r2", R2_score) | |
| # plot and save plot graphic linked to model run | |
| xgb.plot_importance(gbtree) | |
| plt.savefig("importance.png", dpi = 200, bbox_inches = "tight") | |
| mlflow.log_artifact("importance.png") | |
| # log model | |
| mlflow.sklearn.log_model(RFtree, "model") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment