Skip to content

Commit

Permalink
Merge branch 'sktime:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
VascoSch92 authored May 20, 2024
2 parents 53d4171 + e0eb67c commit 3c619d2
Show file tree
Hide file tree
Showing 82 changed files with 9,151 additions and 2,006 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@
"contributions": [
"maintenance"
]
},
{
"login": "szepeviktor",
"name": "Viktor Szépe",
"avatar_url": "https://avatars.githubusercontent.com/u/952007?v=4",
"profile": "https://github.com/szepeviktor",
"contributions": [
"doc"
]
}
]
}
22 changes: 22 additions & 0 deletions .binder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This Dockerfile is used to build skpro when launching binder.
# Find out more at: https://mybinder.readthedocs.io/en/latest/index.html

FROM jupyter/scipy-notebook:python-3.11.6
# Set up user to avoid running as root
ARG NB_USER
ARG NB_UID
ENV USER ${NB_USER}
ENV HOME /home/${NB_USER}

# Binder will automatically clone the repo, but we need to make sure the
# contents of our repo are in the ${HOME} directory
COPY . ${HOME}
USER root
RUN chown -R ${NB_UID} ${HOME}

# Switch user and directory
USER ${USER}
WORKDIR ${HOME}

# Install extra requirements and skpro based on main branch
RUN pip install --upgrade pip --no-cache-dir && pip install .[binder]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<a href="https://skpro.readthedocs.io/en/latest"><img src="https://github.com/sktime/skpro/blob/main/docs/source/images/skpro-banner.png" width="500" align="right" /></a>

:rocket: **Version 2.2.2 out now!** [Read the release notes here.](https://skpro.readthedocs.io/en/latest/changelog.html).
:rocket: **Version 2.3.0 out now!** [Read the release notes here.](https://skpro.readthedocs.io/en/latest/changelog.html).

`skpro` is a library for supervised probabilistic prediction in python.
It provides `scikit-learn`-like, `scikit-base` compatible interfaces to:
Expand Down Expand Up @@ -59,7 +59,7 @@ We strongly believe in the value of sharing help publicly, as it allows a wider
| :woman_technologist: **Usage Questions** | [GitHub Discussions] · [Stack Overflow] |
| :speech_balloon: **General Discussion** | [GitHub Discussions] |
| :factory: **Contribution & Development** | `dev-chat` channel · [Discord] |
| :globe_with_meridians: **Community collaboration session** | [Discord] - Fridays 4 pm UTC, dev/meet-ups channel |
| :globe_with_meridians: **Community collaboration session** | [Discord] - Fridays 13 UTC, dev/meet-ups channel |

[github issue tracker]: https://github.com/sktime/skpro/issues
[github discussions]: https://github.com/sktime/skpro/discussions
Expand Down Expand Up @@ -89,7 +89,7 @@ and for interfacing popular second- and third-party components, such as [cyclic-
| **[Probabilistic tabular regression]** | maturing | [Tutorial](https://github.com/sktime/skpro/blob/main/examples/01_skpro_intro.ipynb) · [API Reference](https://skpro.readthedocs.io/en/latest/api_reference/regression.html) · [Extension Template](https://github.com/sktime/skpro/blob/main/extension_templates/regression.py) |
| **[Time-to-event (survival) prediction]** | experimental | [API Reference](https://skpro.readthedocs.io/en/latest/api_reference/survival.html) · [Extension Template](https://github.com/sktime/skpro/blob/main/extension_templates/survival.py) |
| **[Performance metrics]** | maturing | [API Reference](https://skpro.readthedocs.io/en/latest/api_reference/metrics.html) |
| **[Probability distributions]** | maturing | [API Reference](https://skpro.readthedocs.io/en/latest/api_reference/distributions.html) |
| **[Probability distributions]** | maturing | [Tutorial](https://github.com/sktime/skpro/blob/main/examples/03_skpro_distributions.ipynb) · [API Reference](https://skpro.readthedocs.io/en/latest/api_reference/distributions.html) · [Extension Template](https://github.com/sktime/skpro/blob/main/extension_templates/distributions.py) |

[Probabilistic tabular regression]: https://github.com/sktime/skpro/tree/main/skpro/regression
[Time-to-event (survival) prediction]: https://github.com/sktime/skpro/tree/main/skpro/survival
Expand Down
14 changes: 10 additions & 4 deletions build_tools/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@
from collections import defaultdict
from typing import Dict, List

import httpx
from dateutil import parser

HEADERS = {
"Accept": "application/vnd.github.v3+json",
}

if os.getenv("GITHUB_TOKEN") is not None:
HEADERS["Authorization"] = f"token {os.getenv('GITHUB_TOKEN')}"

OWNER = "skpro"
OWNER = "sktime"
REPO = "skpro"
GITHUB_REPOS = "https://api.github.com/repos"


def fetch_merged_pull_requests(page: int = 1) -> List[Dict]: # noqa
"Fetch a page of pull requests"
import httpx

params = {
"base": "main",
"state": "closed",
Expand All @@ -38,6 +37,8 @@ def fetch_merged_pull_requests(page: int = 1) -> List[Dict]: # noqa


def fetch_latest_release(): # noqa
import httpx

response = httpx.get(
f"{GITHUB_REPOS}/{OWNER}/{REPO}/releases/latest", headers=HEADERS
)
Expand All @@ -50,6 +51,7 @@ def fetch_latest_release(): # noqa

def fetch_pull_requests_since_last_release() -> List[Dict]: # noqa
"Fetch pull requests and filter based on merged date"
from dateutil import parser

release = fetch_latest_release()
published_at = parser.parse(release["published_at"])
Expand All @@ -72,6 +74,8 @@ def fetch_pull_requests_since_last_release() -> List[Dict]: # noqa

def github_compare_tags(tag_left: str, tag_right: str = "HEAD"): # noqa
"Compare commit between two tags"
import httpx

response = httpx.get(
f"{GITHUB_REPOS}/{OWNER}/{REPO}/compare/{tag_left}...{tag_right}"
)
Expand Down Expand Up @@ -128,6 +132,8 @@ def render_row(pr): # noqa
def render_changelog(prs, assigned): # noqa
# sourcery skip: use-named-expression
"Render changelog"
from dateutil import parser

for title, _ in assigned.items():
pr_group = [prs[i] for i in assigned[title]]
if pr_group:
Expand Down
4 changes: 2 additions & 2 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Let's have a look at an example of Boston Housing price prediction (using sklear

If you are familiar with scikit-learn you will recognise that we define and train a model on the boston housing dataset and obtain the test prediction ``y_pred``. Furthermore, we use a loss function to calculate the loss between the predicted points and the true values -- nothing unexpected there.

Crucially, however, the skpro model does not just return a list of numbers or point predictions here. Instead, ``y_pred`` is a probablistic prediction, i.e. it represents probability distributions for each individual data point.
Crucially, however, the skpro model does not just return a list of numbers or point predictions here. Instead, ``y_pred`` is a probabilistic prediction, i.e. it represents probability distributions for each individual data point.
We can, for instance, obtain the standard deviation of the predicted distribution that corresponds with the first (0th) test point (or any other test point distribution) ::

>>> y_pred[0].std()
Expand All @@ -44,7 +44,7 @@ Notably, the interface represents all distributional properties, including the d
>>> y_pred[0].pdf(x=42)
0.00192808538756

Furthermore, it is possible to conveniently access the distributional properties in their vectorized form accross the test sample::
Furthermore, it is possible to conveniently access the distributional properties in their vectorized form across the test sample::

>>> y_pred.std().shape
(152,)
Expand Down
7 changes: 6 additions & 1 deletion docs/source/_static/switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
"url": "https://skpro.readthedocs.io/en/latest/"
},
{
"name": "2.2.2 (stable)",
"name": "2.3.0 (stable)",
"version": "stable",
"url": "https://skpro.readthedocs.io/en/v2.3.0/"
},
{
"name": "2.2.2",
"version": "stable",
"url": "https://skpro.readthedocs.io/en/v2.2.2/"
},
Expand Down
4 changes: 4 additions & 0 deletions docs/source/api_reference/distributions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ Continuous support
:toctree: auto_generated/
:template: class.rst

Beta
ChiSquared
Exponential
Fisk
Laplace
Logistic
Expand Down Expand Up @@ -65,8 +67,10 @@ Non-parametric and empirical distributions
:toctree: auto_generated/
:template: class.rst

Delta
Empirical
QPD_Empirical
QPD_Johnson
QPD_U
QPD_S
QPD_B
Expand Down
18 changes: 17 additions & 1 deletion docs/source/api_reference/regression.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ take one or multiple ``sklearn`` estimators and adda probabilistic prediction mo

MapieRegressor

.. currentmodule:: skpro.regression.gradient_boosting
.. currentmodule:: skpro.regression.ensemble

.. autosummary::
:toctree: auto_generated/
:template: class.rst

BaggingRegressor
NGBoostRegressor

.. currentmodule:: skpro.regression.cyclic_boosting
Expand All @@ -98,6 +99,21 @@ take one or multiple ``sklearn`` estimators and adda probabilistic prediction mo

CyclicBoosting


Naive regressors and baselines
------------------------------

This section lists simple regressors which can be used as baselines.

.. currentmodule:: skpro.regression.delta

.. autosummary::
:toctree: auto_generated/
:template: class.rst

DeltaPointRegressor


Linear regression
-----------------

Expand Down
1 change: 1 addition & 0 deletions docs/source/api_reference/survival.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Tree ensemble models
SurvivalForestXtraSkSurv
SurvGradBoostSkSurv
SurvGradBoostCompSkSurv
NGBoostSurvival

Base
----
Expand Down
Loading

0 comments on commit 3c619d2

Please sign in to comment.