1. Defining costs#

Everything in Empulse starts from one object: a CostMatrix recording what each of the four classification outcomes is worth. Metrics score with it, models train on it, samplers resample by it and the bundled datasets ship one.

This stage covers writing that matrix down, handing it to an estimator, and getting per-row cost values safely through a pipeline. Once you have a cost matrix, Measuring in money turns it into a number.

The cost matrix

The four outcomes, the cost/benefit sign convention, and the builder API — symbols, aliases, defaults and stochastic terms.

The cost matrix
Handing costs to an estimator

Plain fp_cost/fn_cost values or a full Metric as loss: which to use, and the rules that govern both.

Handing costs to an estimator
Costs that differ per row

Metadata routing carries per-instance values through pipelines, cross-validation folds and hyperparameter searches.

Costs that differ per row
Worked cost matrices

Complete examples built from business parameters, including uncertain parameters and mixture distributions.

Worked cost matrices