Skip to main content

153 posts tagged with "Python"

Python Programming Language

View All Tags

How to Train a Random Forest Regression Model with scikit-learn

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

A random forest is one of the most dependable models for tables of numbers. It trains many decision trees on random slices of the data and averages their answers, so one odd tree can't throw it off. This guide trains scikit-learn's RandomForestRegressor to predict house values, explains its main settings, and shows which features it relied on, with real output.

How to Split Data into Training and Test Sets with scikit-learn

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

A model always looks good on the data it learned from. To know how it does on new data, you hold some rows back and never show them to it during training: the test set. scikit-learn's train_test_split does that in one line. This guide splits the California Housing data, and shows what test_size and random_state really control, with real output.

How to Load the California Housing Dataset in Python with scikit-learn

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

The California Housing dataset is the classic dataset for learning regression: 20,640 districts, 8 numbers about each, and a house value to predict. scikit-learn downloads it for you with one function. This guide loads it as a pandas table, explains every column, shows where the download is kept, and points out the $500,000 cap that surprises people.

How to Add Tags to an MLflow Run

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Tags are labels on a run: the model type, the dataset, who owns it. Unlike parameters, you can change them later, and unlike metrics, they're text. MLflow also adds its own tags to every run, such as who ran it and which Git commit the code was at. This guide sets tags, overwrites one, adds a run description, and lists everything MLflow recorded, with real output from MLflow 3.18.0.

How to Log Metrics in MLflow

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

Metrics are the numbers a run produces: error scores, accuracy, a loss that falls during training. Unlike parameters, a metric can be logged many times, so MLflow keeps its whole history and draws it as a chart. This guide logs single values, a batch, and a metric at ten steps, reads the history back, and shows what happens when a value isn't a number.

How to Log Parameters in MLflow

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

Parameters are the settings that shape a run: the number of trees, a learning rate, which features you used. Logging them is what lets you answer "what was different about the good run?" later. This guide logs parameters one at a time and in a batch, shows how MLflow stores them, and runs into the one rule people trip over: a parameter can't change once it's logged.

How to Start, Name and End an MLflow Run

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

A run is one execution of your code that MLflow records: its settings, results and files. Everything you log goes into the active run, so how you start and end runs decides where your data lands. This guide starts runs four ways, names them, checks their status, and shows what MLflow does when your code fails halfway, with real output from MLflow 3.18.0.

How to Create and Set an MLflow Experiment

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

An MLflow experiment is a folder for related runs: one per project, or one per question you're trying to answer. Every run belongs to exactly one experiment. This guide creates experiments two ways, reads their ID and artifact location, shows the error you get for a duplicate name, and finds them in the UI, with real output from MLflow 3.18.0.

How to Turn Off MLflow Telemetry

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

Since version 3.2.0, open-source MLflow collects anonymous usage data by default: which features you use, your MLflow and Python versions, your operating system. It doesn't collect your data, parameters or file names, but you may still want it off. One environment variable turns it off for your scripts, the tracking server and the UI. This guide sets it on macOS, Linux and Windows, and proves it worked.