Changelog#

Unreleased#

0.11.1 (08-05-2026)#

  • Fix Fix empulse not running properly on scikit-learn versions lower than 1.6.

0.11.0 (08-05-2026)#

  • Feature Added ProfTreeClassifier to optimize a cost-sensitive metric using evolutionary trees (similar to ProfLogitClassifier).

  • Feature Added CSRateClassifier to optimize for a specific predicted positive rate.

  • Feature Allow CSThresholdClassifier to optimize the decision threshold at training time. Users can now either specify the decision threshold to use at prediction time or let the model choose the optimal threshold during training.

  • Feature (Experimental) When using the MaxProfit strategy, only one stochastic variable is present, and the cost/profit function is a polynomials of the stochastic variable: the metric will now be computed exactly instead of using numerical integration. This is currently supported for stochastic variables following the Normal, Log Normal, Uniform, Beta, Gamma, Chi Squared, Exponential, Weibull, Pareto, and Triangular distributions.

  • Feature (Experimental) Added support for the MaxProfit strategy metrics to be optimized through gradient descent methods in CSLogitClassifier and CSBoostClassifier. This is currently an experimental feature and is not recommended for use in production.

  • API Change Updated the ProfLogitClassifier interface to be more consistent with other models in the package. By default optimizes the maximum profit metric.

  • API Change CSLogitClassifier no longer takes a string argument for the loss function to be more consistent with other models in the package. Default value for the loss is None.

  • API Change MaxProfit now takes a numpy Generator instead of a RandomState instance.

  • Enhancement Metrics built with the MaxProfit strategy can now handle instance-dependent costs. They will automatically be averaged over the instances. Mathematically this is equivalent to recomputing the EMP score for each instance and then averaging the scores.

  • Enhancement Metrics built with the Cost and Savings strategies can now handle stochastic cost parameters. If the distribution allows it, the mean cost will be computed.

  • Fix Fix CSTreeClassifier and CSForestClassifier not properly training when costs were negative.

  • Fix Fix integration bounds inconsistently being calculated when the MaxProfit strategy was chosen.

  • Fix Fix CSBoostClassifier throwing errors when one or two of the Boosting libraries were not installed (XGBoost, LGBM & Catboost).

  • Fix Add __name__ attribute to Metric class to fix issues with scikit-learn compatibility.

  • Fix Fix metadata routing not working for scikit-learn>=1.8.0

  • Fix Fix MaxProfit strategy not calculating Log Normal distributed variables correctly when using quasi monte carlo.

  • Fix Fix some models not properly being able to be pickled when using a custom metric as the loss function.

  • Fix Fix some distributions not correctly computing the expected maximum profit score when using the MaxProfit strategy when using monte carlo or quasi monte carlo method.

0.10.4 (20-09-2025)#

0.9.0 (15-06-2025)#

  • Feature Added optimal_threshold and optimal_rate methods to calculate the optimal threshold(s) and optimal predicted positive rate for a given metric. This is useful for determining the best decision threshold and predicted positive rate for a cost-sensitive or value-driven model.

  • Feature CSTreeClassifier, CSForestClassifier, and CSBaggingClassifier can now take a Metric instance as their criterion to optimize.

  • Feature CSThresholdClassifier can now take a Metric instance to choose the optimal decision threshold.

  • Feature RobustCSClassifier can now take estimators with a Metric instance as the loss function or criterion. RobustCSClassifier will treat any cost marked as outlier sensitive. This can be done by using the mark_outlier_sensitive method.

  • Feature Allow savings metrics to be used in CSBoostClassifier and CSLogitClassifier as the objective function. Internally, the expected cost loss is used to train the model, since the expected savings score is just a transformation of the expected cost loss.

  • API Change kind argument to Metric has been replaced by strategy. The Metric class now takes a MetricStrategy instance. This change allows for more flexibility in defining the metric strategy. The currently available strategies are:

    • MaxProfit for the expected maximum profit score

    • Cost for the expected cost loss

    • Savings for the expected savings score

  • Fix Fix error when importing Empulse without any optional dependencies installed.

  • Fix Fix CSLogitClassifier not properly using the gradient when using a custom loss function from Metric.

  • Fix Fix models throwing errors when differently shaped costs are passed to the fit or predict method.

  • Fix Fix sympy distribution parameters not being properly translated to scipy distribution parameters when using the MaxProfit strategy (formerly kind=’max profit’) with the quasi monte-carlo integration method.

0.8.0 (01-06-2025)#

  • Feature CSBoostClassifier, CSLogitClassifier, and ProfLogitClassifier can now take a Metric instance as their loss function. Internally, the metric instance is converted to the appropriate loss function for the model. For more information, read the User Guide.

  • Feature Type hints are now available for all functions and classes.

  • Enhancement Add support for more than one stochastic variable when building maximum profit metrics with Metric

  • Enhancement Allow Metric to be used as a context manager. This ensures the metric is always built after defining the cost-benefit elements.

  • Fix Fix datasets not properly being packaged together with the package

  • Fix Fix RobustCSClassifier when array-like parameters are passed to fit method.

  • Fix Fix boosting models being biased towards the positive class.

0.7.0 (05-02-2025)#

  • Major Feature Add CSTreeClassifier, CSForestClassifier, and CSBaggingClassifier to support cost-sensitive decision tree and ensemble models

  • Enhancement Add support for scikit-learn 1.5.2 (previously Empulse only supported scikit-learn 1.6.0 and above).

  • API Change Removed the emp_score and emp functions from the metrics module. Use the Metric class instead to define custom expected maximum profit measures. For more information, read the User Guide.

  • API Change Removed numba as a dependency for Empulse. This will reduce the installation time and the size of the package.

  • Fix Fix Metric when defining stochastic variable with fixed values.

  • Fix Fix Metric when stochastic variable has infinite bounds.

  • Fix Fix CSThresholdClassifier when costs of predicting positive and negative classes are equal.

  • Fix Fix documentation linking issues to sklearn

0.6.0 (28-01-2025)#

  • Major Feature Add Metric to easily build your own value-driven and cost-sensitive metrics

  • Feature Add support for LightGBM and Catboost models in CSBoostClassifier and B2BoostClassifier

  • API Change make_objective_churn and make_objective_acquisition now take a model argument to calculate the objective for either XGBoost, LightGBM or Catboost models.

  • API Change XGBoost is now an optional dependency together with LightGBM and Catboost. To install the package with XGBoost, LightGBM and Catboost support, use the following command: pip install empulse[optional]

  • API Change Renamed y_pred_baseline and y_proba_baseline to baseline in savings_score and expected_savings_score. It now accepts the following arguments:

    • If 'zero_one', the baseline model is a naive model that predicts all zeros or all ones depending on which is better.

    • If 'prior', the baseline model is a model that predicts the prior probability of the majority or minority class depending on which is better (not available for savings score).

    • If array-like, target probabilities of the baseline model.

  • Feature Add parameter validation for all models and samplers

  • API Change Make all arguments of dataset loaders keyword-only

  • Fix Update the descriptions attached to each dataset to match information found in the user guide

  • Fix Improve type hints for functions and classes

0.5.2 (12-01-2025)#

  • Feature Allow savings_score and expected_savings_score to calculate the savings score over the baseline model instead of a naive model, by setting the y_pred_baseline and y_proba_baseline parameters, respectively.

  • Enhancement Reworked the user guide documentation to better explain the usage of value-driven and cost-sensitive models, samplers and metrics

  • API Change CSLogitClassifier and ProfLogitClassifier by default do not perform soft-thresholding on the regression coefficients. This can be enabled by setting the soft_threshold parameter to True.

  • Fix Prevent division by zero errors in expected_cost_loss

0.5.1 (05-01-2025)#

  • Fix Fixed documentation build issue

0.5.0 (05-01-2025)#