BinClass.Evaluation (BinClass v0.3.0)

Copy Markdown View Source

Evaluates classifiers, positive-class probabilities, and calibrates decision thresholds.

Supports evaluating trained %BinClass.Classifier{} structs directly on raw text datasets, formatting evaluation reports, and performing fixed-threshold evaluation and calibration over probability rows.

Summary

Functions

Selects the best positive-class threshold for the supplied rows.

Evaluates a classifier, predictor, or probability rows.

Evaluates a classifier against a dataset of text and labels.

Formats an evaluation result into a human-readable text report.

Calibrates and compares named probability strategies.

Functions

calibrate(rows, opts \\ [])

Selects the best positive-class threshold for the supplied rows.

Accepts the same row accessors and objective options as evaluate/2, except for :threshold. Calibration requires at least one eligible example from each class.

evaluate(classifier_or_predictor_or_rows, data_or_opts \\ [], opts \\ [])

Evaluates a classifier, predictor, or probability rows.

When passed a %BinClass.Classifier{} or predictor function and a dataset, evaluates predictions on the dataset and returns comprehensive classification metrics.

When passed probability rows and options, evaluates the rows at a fixed threshold.

evaluate_dataset(classifier_or_predictor, data, opts \\ [])

Evaluates a classifier against a dataset of text and labels.

format_report(result)

Formats an evaluation result into a human-readable text report.

select(rows, opts)

Calibrates and compares named probability strategies.

The required :strategies option is a non-empty list of {strategy_name, probability_accessor} pairs. All other options are passed to calibrate/2. Equivalent strategies are resolved in favor of the first one supplied.