From bdcb3f768d5ccf670c09db86f3fc69778cc01cc9 Mon Sep 17 00:00:00 2001 From: Felix Wick Date: Wed, 27 Dec 2023 07:51:56 +0100 Subject: [PATCH] release prep --- cyclic_boosting/__init__.py | 2 +- docs/source/introduction.md | 3 ++- docs/source/tutorial.md | 22 +++++++++++++++++++++- pyproject.toml | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/cyclic_boosting/__init__.py b/cyclic_boosting/__init__.py index 652f100..a251920 100644 --- a/cyclic_boosting/__init__.py +++ b/cyclic_boosting/__init__.py @@ -99,4 +99,4 @@ "pipeline_CBGenericClassifier", ] -__version__ = "1.2.5" +__version__ = "1.3.0" diff --git a/docs/source/introduction.md b/docs/source/introduction.md index 830f5e8..7db441a 100644 --- a/docs/source/introduction.md +++ b/docs/source/introduction.md @@ -43,7 +43,8 @@ possible to use another loss function (also possible for classification tasks). An important example for this is optimizing for an arbitrary quantile (e.g., the median), aka [quantile regression](https://cyclic-boosting.readthedocs.io/en/latest/cyclic_boosting.html#module-cyclic_boosting.generic_loss). By means of several estimated quantiles, one can also approximate full -individual probability distributions via [quantile matching](https://cyclic-boosting.readthedocs.io/en/latest/cyclic_boosting.html#module-cyclic_boosting.quantile_matching). +individual probability distributions via [quantile matching](https://cyclic-boosting.readthedocs.io/en/latest/cyclic_boosting.html#module-cyclic_boosting.quantile_matching) +(especially Quantile-Parameterized Distributions). Classification -------------- diff --git a/docs/source/tutorial.md b/docs/source/tutorial.md index 1a66b47..976e474 100644 --- a/docs/source/tutorial.md +++ b/docs/source/tutorial.md @@ -149,7 +149,8 @@ CB_est.get_feature_contributions(X_test) Below you can find an example of a quantile regression model for three different quantiles, with a subsequent quantile matching (to get a full individual probability distribution from the estimated quantiles) by means of a -quantile-parameterized distribution for an arbitrary test sample: +Johnson Quantile-Parameterized Distribution (J-QPD) for an arbitrary test +sample: ```python from cyclic_boosting.pipelines import pipeline_CBMultiplicativeQuantileRegressor from cyclic_boosting.quantile_matching import J_QPD_S @@ -169,3 +170,22 @@ yhat_qhigh = CB_est_qhigh.predict(X_test) j_qpd_s_42 = J_QPD_S(0.2, yhat_qlow[42], yhat_qmedian[42], yhat_qhigh[42]) yhat_42_percentile95 = j_qpd_s_42.ppf(0.95) ``` + +There is also a ready-made end-to-end practical training chain, employing +quantile transformations to impose constraints on the target range (for bound +or semi-bound scenarios) and maintain the order of symmetric-percentile triplet +predictions (from an arbitrary quantile regression method, not restricted to +Cyclic Boosting) used for J-QPD: +```python +from cyclic_boosting.pipelines import pipeline_CBAdditiveQuantileRegressor +from cyclic_boosting.quantile_matching import QPD_RegressorChain + +est = QPD_RegressorChain( + pipeline_CBAdditiveQuantileRegressor(quantile=0.5), + pipeline_CBAdditiveQuantileRegressor(quantile=0.5), + pipeline_CBAdditiveQuantileRegressor(quantile=0.5), + "S", +) +est.fit(X_train, y) +yhat_qlow, yhat_qmedian, yhat_qhigh, qpd = est.predict(X_test) +``` diff --git a/pyproject.toml b/pyproject.toml index 34431ea..1f439aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cyclic-boosting" -version = "1.2.5" +version = "1.3.0" description = "Implementation of Cyclic Boosting machine learning algorithms" authors = ["Blue Yonder GmbH"] packages = [{include = "cyclic_boosting"}]