Created
June 26, 2024 18:01
-
-
Save elijahbenizzy/ccfca4ea76a1041154f7d59a8f0ebf00 to your computer and use it in GitHub Desktop.
This file contains 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
with mlflow.start_run(): | |
lr = ElasticNet(alpha=alpha, l1_ratio=l1_ratio, random_state=42) | |
lr.fit(train_x, train_y) | |
predicted_qualities = lr.predict(test_x) | |
(rmse, mae, r2) = eval_metrics(test_y, predicted_qualities) | |
mlflow.log_param("alpha", alpha) | |
mlflow.log_param("l1_ratio", l1_ratio) | |
mlflow.log_metric("rmse", rmse) | |
mlflow.log_metric("r2", r2) | |
mlflow.log_metric("mae", mae) | |
mlflow.sklearn.log_model(lr, "model", registered_model_name="ElasticnetWineModel") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment