Skip to main content

375 posts tagged with "Python"

Python Programming Language

View All Tags

How to Check a File's SHA-256 Hash in Python

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

A SHA-256 hash is a file's fingerprint: 64 characters that change completely if even one byte of the file changes. Publishers print it next to their downloads so you can check that the file you got is complete and untouched. Python computes it with hashlib.file_digest; this guide hashes a small file and checks it against an expected value, with real output from Python 3.15.2.

How to Download a File in Python with urllib

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

Python can download a file without installing anything: urllib.request.urlopen opens the web address, and shutil.copyfileobj copies what it reads into a file on your disk. This guide downloads a small web page to example.html, then shows what happens when the file you ask for isn't there, with real output from Python 3.15.2.

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

· 27 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.

How to Include Deleted Runs in an MLflow Search in Python

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

A deleted MLflow run isn't gone: it's in the deleted stage, and mlflow.search_runs() simply leaves it out by default. To find deleted runs, to restore one or to check what a cleanup removed, tell the search which runs to look at with run_view_type. This guide searches three runs, one of them deleted, in all three views, with real output from MLflow 3.18.0.

How to Restore a Deleted Run in MLflow

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

Deleting a run in MLflow doesn't erase it: the run moves to a deleted stage, out of sight but with all its data. Until someone removes it for good with mlflow gc, you can bring it back exactly as it was. This guide restores three deleted runs, one in the UI, one in Python and one from a terminal, with real screens and output from MLflow 3.18.0.

How to Delete a Run in MLflow

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

Experiments collect runs you don't need: drafts, test runs, runs that crashed. Deleting them keeps the runs table and every search focused on the ones that matter. In MLflow, deleting moves a run aside rather than erasing it, so a mistake can be undone. This guide deletes three draft runs, one with each of the three ways MLflow offers, with real screens and output from MLflow 3.18.0.

How to Find Failed Runs in MLflow

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

A training script that crashes halfway leaves its MLflow run behind with whatever it logged so far, marked as failed. Those runs can look like results: a half-trained model's score sits next to the finished ones. This guide makes one run fail, shows how it appears in the runs table, and finds it, or leaves it out, with a search on the run's status, in the UI and in Python, with MLflow 3.18.0.

How to Search MLflow Runs by Dataset

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

When a run records the data it trained on with mlflow.log_input(), you can search runs by that data: every run trained on a given dataset, or only those that used exactly the same rows. MLflow offers three dataset fields to search: the name you gave the dataset, its digest, a short fingerprint of its contents, and the context it was used in. This guide searches three runs by each, with real results from MLflow 3.18.0.

How to Find an MLflow Run by Name

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Run names are what you see in the MLflow UI, but most MLflow functions want a run ID. Searching with attributes.run_name turns one into the other: an exact name, a pattern, or a name in any capitalisation. Names aren't unique, though, so getting "the" run takes one more step. This guide finds runs by name four ways and picks the newest of two runs that share a name, with real results from MLflow 3.18.0.

How to Search MLflow Runs by Parameter Value

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Parameters are the settings a run was trained with, such as a model type or a tree depth, and searching by them answers "which runs used this setting?". MLflow stores every parameter as text, which shapes every search: values go in quotes, a setting of None is the text 'None', and > and < don't work. This guide searches three runs by parameter four ways, with real results from MLflow 3.18.0.