Skip to main content

106 posts tagged with "MLOps"

MLOps, Practices and Tools for Tracking, Versioning, Deploying and Monitoring Machine Learning Models

View All Tags

How to Create Nested Runs in MLflow

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

When one experiment is really several runs, such as trying three settings to compare them, MLflow can group them: start a parent run, then start each child run inside it with nested=True. The UI then shows the children folded under their parent instead of as loose runs. This guide compares three settings of a classifier as children of one parent, with real output from MLflow 3.18.0.

How to Log Every Candidate of a Grid Search in MLflow with max_tuning_runs

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

When autologging records a GridSearchCV search, it creates child runs only for the 5 best candidates by default, ranked by cross-validation score. The others still appear in the parent's cv_results.csv, but not as runs you can sort and compare. mlflow.sklearn.autolog(max_tuning_runs=...) sets that number, or removes the limit with None. This guide runs the same 8-candidate search both ways, with real output from MLflow 3.18.0.

How to Log a GridSearchCV Search in MLflow with Parent and Child Runs

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

A hyperparameter search trains the same model many times, once per combination of settings. With autologging on, MLflow records a GridSearchCV search as one tidy group: a parent run for the search as a whole, with the best settings, and a child run for each candidate, with its cross-validation scores. This guide records a four-candidate search, with real output from MLflow 3.18.0.

How to Turn On Autologging in MLflow

· 9 min read
Jagdish Kumawat
Founder @ Dewiride

Writing mlflow.log_param and mlflow.log_metric for every setting and score gets long. MLflow can do it for you: turn on autologging before you train, and every fit records its parameters, training metrics, tags, dataset and model on its own. This guide turns it on for a scikit-learn model, then looks at what it recorded, with real output from MLflow 3.18.0.

Fixed: "Failed to resolve installed pip version" When MLflow Saves a Model

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

Every time MLflow saved a model in my uv project, it warned: WARNING mlflow.utils.environment: Failed to resolve installed pip version. ``pip`` will be added to conda.yaml environment spec without a version specifier. MLflow records the pip version of your environment in the model's environment files, and environments created by uv have no pip. Adding pip to the project, uv add --dev pip, gave MLflow a version to record and removed the warning.

Fixed: "Saving scikit-learn models in the pickle or cloudpickle format requires exercising caution" in MLflow

· 8 min read
Jagdish Kumawat
Founder @ Dewiride

Turning on MLflow's scikit-learn autologging printed a warning with every saved model: WARNING mlflow.sklearn: Saving scikit-learn models in the pickle or cloudpickle format requires exercising caution. Autologging saves models with cloudpickle unless you say otherwise, and a pickled model can run code when it's loaded. Passing serialization_format="skops" to mlflow.sklearn.autolog() saves the model in the skops format, which the warning itself recommends, and the warning is gone.

Fixed: MLflow Autolog's training_recall_score Is the Same as training_accuracy_score

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

On a yes/no model, MLflow's autologging logged a training_recall_score of 0.9044006069802731, the very same number as training_accuracy_score. That's no coincidence: without pos_label, autologging averages precision, recall and F1 over both classes, weighted by how common each is, and weighted recall always equals accuracy. With mlflow.sklearn.autolog(pos_label=1), it logs the scores of the "yes" class instead, which told a very different story: a recall of 0.27.

Fixed: MLflow Autologging Encountered a Warning: "Hint: Inferred schema contains integer column(s)"

· 8 min read
Jagdish Kumawat
Founder @ Dewiride

The first time I ran a hyperparameter search with MLflow's scikit-learn autologging, the output repeated the same long warning four times: WARNING mlflow.utils.autologging_utils: MLflow autologging encountered a warning: "... UserWarning: Hint: Inferred schema contains integer column(s)." The search finished fine. The cause was four columns of whole numbers in the training data, and reading them as decimals, float64, made all four warnings go away.

MLflow Tutorial for Machine Learning in Python — Part 4: Search and Filter Runs

· 26 min read
Jagdish Kumawat
Founder @ Dewiride

After three parts, the house price experiment holds a dozen runs, and the questions change from "did it log?" to "which one is best, and why?". MLflow answers them with search: filters on metrics, parameters, status and datasets, in the UI and from Python. In this part you'll search the experiment's runs, add a command that ranks the finished runs by validation error, let the server find runs by name, and clear out a run that never finished.