User Guide#

These pages cover each part of Empulse in depth: what every component does, the parameters that matter, and how it fits into a scikit-learn workflow.

They are written as reference material to dip into once you know roughly what you need. If you are new to the package, read the Quickstart first, then the Tutorial, which works through a complete problem end to end. Which tool do I need? maps common problems to the component that solves them.

The guide follows the order you actually work in. You write down what the outcomes are worth, turn that into a number, train on it, decide where to draw the line, and — if you would rather not touch the model at all — change the data instead. Every later stage consumes what the earlier ones produced, so reading top to bottom works; so does jumping straight to the stage you are stuck on.

A cost matrix combines with a strategy to make a metric, which is then used to evaluate, train and decide; the cost matrix also feeds resampling directly.

One definition, four uses. The stage numbers match the sections below.#

A cost matrix combines with a strategy to make a metric, which is then used to evaluate, train and decide; the cost matrix also feeds resampling directly.

One definition, four uses. The stage numbers match the sections below.#

1. Defining costs

Write down what each of the four outcomes is worth. Cost matrices, the two ways to hand those costs to an estimator, and how per-row values travel through pipelines.

Defining costs
2. Measuring in money

Turn a cost matrix into a number. The six strategies, what a Metric object can do, and the ready-made metrics for churn, acquisition and credit scoring.

Measuring in money
3. Training on costs

Classifiers that optimise business value during training instead of being scored on it afterwards: linear, boosting, trees and ensembles, minimax, and robustness to noisy costs.

Training on costs
4. Deciding who to act on

A score is not a decision. Calibration, and picking the cut-off — or the fraction of the population — that maximises value.

Deciding who to act on
5. Changing the data instead

Make any estimator cost-sensitive without touching its objective: class imbalance, cost-proportionate sampling and bias mitigation.

Changing the data instead
6. Datasets

Real-world cost-sensitive datasets for benchmarking, each shipping the cost matrix of the business problem it came from.

Datasets