π analysis.classifierΒΆ
The ResponseCurveClassifier module within the analysis submodule of the MMM package
provides tools for classifying model results based on predefined criteria.
This can be useful for categorizing model performance, identifying key drivers,
or segmenting results for further analysis.
OverviewΒΆ
The module exposes a classifier class that:
Accepts model results and classification parameters
Applies classification rules to categorize results
Returns structured output for downstream analysis or reporting
Class ReferenceΒΆ
- class mmm.analysis.classifier.ResponseCurveClassifier(curve, low_ratio=0.3, high_ratio=0.7)ΒΆ
Classifies model results based on specified criteria.
- Parameters:
curve (Dict) β Configuration parameters for classification.
low_ratio (
float) β Threshold for classifying results as βunderspendβ. Default is 0.3.high_ratio (
float) β Threshold for classifying results as βsaturatedβ. Default is 0.7.
- classify()ΒΆ
Applies classification rules to the provided model results.
- Returns:
A dictionary containing classified results.
- Return type:
Dict
Result Example
{
"zones": [
"underspend", "underspend", ...,
"optimal", "optimal", ...,
"saturated", "saturated", ...
],
"marginal": [0.2, 0.4, ..., 0.5, 0.6, ..., 0.3, 0.1],
"thresholds": {
"low": 0.3,
"high": 0.7
}
}
NotesΒΆ
The classification logic is based on predefined thresholds for marginal returns, which can be customized as needed.
This module is designed to work with the output of MMM models, providing insights into the effectiveness of different marketing channels or tactics.
The results can be used to inform budget allocation decisions, optimize marketing strategies, or identify areas for improvement in the model.