Releases: ottenbreit-data-science/aplr
Releases · ottenbreit-data-science/aplr
Release list
10.24.1
Fixed
- Restored Safe Output Redirection in Python Fit Bindings: Fixed the regression in version
10.24.0where the nativefitbindings wrote C++ training output directly tostdoutinstead of redirecting it through Python. The fix restores a safe redirection guard so training output is captured correctly without bypassing the Python output stream.
10.24.0
Added
- Python 3.15 Support: Added compatibility with Python 3.15.
Fixed
- Corrected Hessian Usage and Hessian Calculations: Disabled Hessian-based updates for
binomialloss andlogitlink models because the non-Hessian formulation is more predictive in those settings. Also corrected the underlying Hessian calculations for the remaining supported cases. - Resolved Segmentation Fault in Python Fit Bindings: Removed the pybind11 output-redirection guard from the native
fitbindings because it caused a segmentation fault during training in the Python extension. As a result, C++ console output from the training process is emitted directly to the terminal instead of being captured/re-directed by Python.
Documentation
- Updated Examples and Presentation: Examples and the presentation have been updated to mention
penalty_for_non_linearityandpenalty_for_interactionsinstead ofnum_first_steps_with_linear_effects_onlyandboosting_steps_before_interactions_are_allowedrespectively. - API Reference: Updated the API reference with information on how to pass the custom function
calculate_custom_differentiate2_predictions_wrt_linear_predictor_function(second order differentiation).
10.23.0
Added
- Hessian-Based Optimization: Integrated second-order derivative information (Hessian) to accelerate convergence for models using non-MSE loss functions or non-identity link functions (e.g.,
logit,log). This improvement allows for more precise updates in each boosting step, often leading to better performance in fewer iterations. - Custom Hessian Support: Added the
calculate_custom_hessian_functionparameter toAPLRRegressor. Users can now provide a custom function to compute the second-order derivative for their own loss functions, ensuring that custom objectives also benefit from faster convergence.
Deprecated
faster_convergenceParameter: Thefaster_convergenceparameter inAPLRRegressoris now deprecated. It is superseded by the more robust and mathematically sound Hessian-based optimization, which is now the standard method for accelerating convergence in relevant tasks.
10.22.1
[10.22.1] - 2026-04-25
Fixed
- Preprocessing-Aware Fit Arguments: Fixed a bug where predictor-specific fit arguments were not correctly mapped to transformed columns when
preprocess=True. The model now correctly handles cases where raw features are expanded into multiple columns due to one-hot encoding or the addition of missing value indicator flags. This ensures that constraints (e.g., monotonicity), prioritization, and custom penalties/learning rates are properly applied to the resulting features. For monotonicity, constraints are applied to the primary numeric feature but specifically excluded (set to 0) for generated dummy columns and missing value flags. Affected arguments includeprioritized_predictors_indexes,monotonic_constraints,interaction_constraints,predictor_learning_rates,predictor_penalties_for_non_linearity,predictor_penalties_for_interactions, andpredictor_min_observations_in_split.
10.22.0
Added
- Sequential Tuning in
APLRTuner: Introduced a newsequential_tuningboolean parameter toAPLRTuner. WhenTrue, hyperparameters are tuned sequentially in the order they appear in theparametersdictionary, which can be significantly faster than a full grid search. This method avoids re-testing duplicate parameter combinations.
Changed
min_observations_in_splitParameter: Themin_observations_in_splitandpredictor_min_observations_in_splitparameters are now floats. The default formin_observations_in_splithas been updated to0.3. Values below 1.0 are interpreted as a power of the total number of training observations. For example, with 10,000 training observations, a value of0.5results in a minimum ofceil(10000**0.5) = 100observations.
Fixed
APLRClassifierType Handling: Fixed aTypeErrorinAPLRClassifierthat occurred when the target variableywas apandas.Seriesof integers. The model now correctly handles this input by converting it to the expected string format. This also resolves issues when usingAPLRTunerfor classification with apandas.Seriestarget.APLRClassifierList Handling: Improved robustness when the target variableyis a list. Previously, only the first element was checked to determine if conversion to string was necessary. Now, the entire list is checked, ensuring that mixed-type lists or lists where the first element is a string but others are not are correctly converted to strings.APLRTunerType Hinting: Corrected the type hint for theparametersargument inAPLRTunertoDict[str, List[Any]], accurately reflecting that it accepts lists of various value types (e.g., floats, integers, and strings).
10.21.0
Added
validation_ratioParameter: Addedvalidation_ratioto the constructor ofAPLRRegressorandAPLRClassifier. This parameter specifies the ratio of training observations used for validation. When specified,cv_foldsis ignored. This is useful for speeding up hyperparameter tuning.
Documentation
- Updated Examples: Examples have been updated to use
validation_ratiofor hyperparameter tuning by default, with an option to switch back to cross-validation. - API Reference: Updated documentation to reflect the new
validation_ratioparameter. - README: Restructured the README to improve navigation. Added a dedicated "Documentation" section consolidating resources, examples, and API references. Added a "Citation" section for the published article.
10.20.1
Fixed
- Backward Compatibility Regression: Fixed a regression introduced in version
10.20.0that caused anAttributeErrorwhen loading models saved with older versions of APLR.
10.20.0
Breaking Changes
- Model Compatibility: Due to the migration of the preprocessing engine from Python to C++, models saved with
aplrversions10.18.0through10.19.3are not compatible with version10.20.0if they were trained on data that triggered the Python-based preprocessing (e.g., apandas.DataFramewith categorical features or missing values). These older models may fail or produce unexpected results during prediction and must be retrained using version10.20.0or newer.
Changed
- Preprocessing Engine: The entire data preprocessing pipeline, including missing value imputation and one-hot encoding, has been moved from Python to C++ for improved robustness. This change ensures that all data transformations are handled within the core engine.
Added
preprocessParameter: A new boolean parameterpreprocesshas been added to theAPLRRegressorandAPLRClassifierconstructors.- When
True(default), the model automatically handles missing values and one-hot encodes categorical features inpandas.DataFrameinputs. - When
False, automatic preprocessing is disabled. In this mode, the inputXmust be a purely numericnumpy.ndarrayorpandas.DataFrame. This provides greater control for users who prefer to manage their own preprocessing pipelines and can result in performance gains and a lower memory footprint.
- When
10.19.3
Fixed
- Input Validation for
X_names: Resolved aValueErrorthat occurred when a NumPy array was passed to theX_namesparameter in thefitmethod. The input validation has been enhanced to gracefully handle any list-like iterable (including NumPy arrays and tuples), ensuring robust and predictable behavior when providing feature names for non-DataFrame inputs.
10.19.2
Fixed
- Memory Optimization: Optimized the Python preprocessing pipeline to fix a bug that caused unnecessary memory consumption. A "just-in-time" copy mechanism now prevents large data copies during both fitting and prediction, improving memory safety for all input types.
- Preprocessing Robustness: Addressed a
RuntimeWarning: Mean of empty slicethat occurred during median imputation in_preprocess_X_fitwhen a column contained only missing values. The median calculation now gracefully handles such cases. - Backward Compatibility: Improved
__setstate__to safely load older pickled models by initializing new preprocessing attributes to their correct default types (e.g.,[]), preventingTypeErrorexceptions.
Changed
- Code Quality and Maintainability: The entire Python preprocessing pipeline was refactored into a clean
fit/transformpattern. This separation of concerns removes boolean flags and significantly improves code clarity, making it easier to maintain and debug. - Type Hinting: Added comprehensive type hints to all preprocessing methods for better readability and to enable static analysis.
Documentation
- Updated API references and changelog for improved clarity and accuracy regarding the automatic preprocessing of
numpy.ndarrayandpandas.DataFrameinputs.