Changed to Cython implementation for the loss functions and impurity measures of
CSLogitClassifier,CSBoostClassifier,CSTreeClassifier, andCSForestClassifier. This improves the training time and memory efficiency of these models significantly. Training time speedups observed were up to 300x forCSTreeClassifierandCSForestClassifier, 30x forCSLogitClassifier, and 1.5x forCSBoostClassifierdepending on the dataset size and parameters.Changed arguments to
CSTreeClassifier,CSForestClassifier, andCSBaggingClassifierto be in line with scikit-learn's decision tree and ensemble models.CSForestClassifier, andCSBaggingClassifierno longer support stacking combination method. UseStackingClassifierinstead for stacking.Extracted the construction of the cost matrix into a separate class
CostMatrixaway fromMetricto allow reusing the cost matrix in custom metrics.ProfLogitClassifierno longer uses the EMPC metric by default. Users now need to explicitely pass a loss to the model.CSLogitClassifierno longer accepts any callable as loss function. Users now need to pass aMetricinstance for a custom loss function.savings_scoreandexpected_savings_scorenow accept two more baseline options'one'and'zero'to always predict the positive and negative class, respectively.Metrics with with the
Savingsstrategy now also accepts baseline options likesavings_scoreandexpected_savings_score.Models which use a
Metricinstance as their loss function with theCostorSavingsstrategy as their loss function now are pickleable. TheMaxProfitstrategy will be updated to be pickleable in a future release.Models which use a
Metricinstance as their loss function can now request arguments necessary for the metric to be passed during the fit method through Metadata Routing.Fix
CSLogitClassifiernot properly calculating gradient penalty.Fix default values not being properly when using aliases in
CostMatrix.Fix
Metricthrowing errors when certain terms cancelled out.