Home

Awesome

<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.6.0 out now! Read the release notes here..

skpro is a library for supervised probabilistic prediction in python. It provides scikit-learn-like, scikit-base compatible interfaces to:

Overview
Open SourceBSD 3-clause
TutorialsBinder !youtube
Community!discord !slack
CI/CDgithub-actions !codecov readthedocs platform
Code!pypi !conda !python-versions !black
DownloadsPyPI - Downloads PyPI - Downloads Downloads
CitationDOI

:books: Documentation

Documentation
:star: TutorialsNew to skpro? Here's everything you need to know!
:clipboard: Binder NotebooksExample notebooks to play with in your browser.
:woman_technologist: User GuidesHow to use skpro and its features.
:scissors: Extension TemplatesHow to build your own estimator using skpro's API.
:control_knobs: API ReferenceThe detailed reference for skpro's API.
:hammer_and_wrench: ChangelogChanges and version history.
:deciduous_tree: Roadmapskpro's software and community development plan.
:pencil: Related SoftwareA list of related software.

:speech_balloon: Where to ask questions

Questions and feedback are extremely welcome! We strongly believe in the value of sharing help publicly, as it allows a wider audience to benefit from it.

skpro is maintained by the sktime community, we use the same social channels.

TypePlatforms
:bug: Bug ReportsGitHub Issue Tracker
:sparkles: Feature Requests & IdeasGitHub Issue Tracker
:woman_technologist: Usage QuestionsGitHub Discussions · Stack Overflow
:speech_balloon: General DiscussionGitHub Discussions
:factory: Contribution & Developmentdev-chat channel · Discord
:globe_with_meridians: Community collaboration sessionDiscord - Fridays 13 UTC, dev/meet-ups channel

:dizzy: Features

Our objective is to enhance the interoperability and usability of the AI model ecosystem:

skpro curates libraries of components of the following types:

ModuleStatusLinks
Probabilistic tabular regressionmaturingTutorial · API Reference · Extension Template
Time-to-event (survival) predictionmaturingTutorial · API Reference · Extension Template
Performance metricsmaturingAPI Reference
Probability distributionsmaturingTutorial · API Reference · Extension Template

:hourglass_flowing_sand: Installing skpro

To install skpro, use pip:

pip install skpro

or, with maximum dependencies,

pip install skpro[all_extras]

Releases are available as source packages and binary wheels. You can see all available wheels here.

:zap: Quickstart

Making probabilistic predictions

from sklearn.datasets import load_diabetes
from sklearn.ensemble import RandomForestRegressor
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split

from skpro.regression.residual import ResidualDouble

# step 1: data specification
X, y = load_diabetes(return_X_y=True, as_frame=True)
X_train, X_new, y_train, _ = train_test_split(X, y)

# step 2: specifying the regressor - any compatible regressor is valid!
# example - "squaring residuals" regressor
# random forest for mean prediction
# linear regression for variance prediction
reg_mean = RandomForestRegressor()
reg_resid = LinearRegression()
reg_proba = ResidualDouble(reg_mean, reg_resid)

# step 3: fitting the model to training data
reg_proba.fit(X_train, y_train)

# step 4: predicting labels on new data

# probabilistic prediction modes - pick any or multiple

# full distribution prediction
y_pred_proba = reg_proba.predict_proba(X_new)

# interval prediction
y_pred_interval = reg_proba.predict_interval(X_new, coverage=0.9)

# quantile prediction
y_pred_quantiles = reg_proba.predict_quantiles(X_new, alpha=[0.05, 0.5, 0.95])

# variance prediction
y_pred_var = reg_proba.predict_var(X_new)

# mean prediction is same as "classical" sklearn predict, also available
y_pred_mean = reg_proba.predict(X_new)

Evaluating predictions

# step 5: specifying evaluation metric
from skpro.metrics import CRPS

metric = CRPS()  # continuous rank probability score - any skpro metric works!

# step 6: evaluat metric, compare predictions to actuals
metric(y_test, y_pred_proba)
>>> 32.19

:wave: How to get involved

There are many ways to get involved with development of skpro, which is developed by the sktime community. We follow the all-contributors specification: all kinds of contributions are welcome - not just code.

Documentation
:gift_heart: ContributeHow to contribute to skpro.
:school_satchel: MentoringNew to open source? Apply to our mentoring program!
:date: MeetingsJoin our discussions, tutorials, workshops, and sprints!
:woman_mechanic: Developer GuidesHow to further develop the skpro code base.
:medal_sports: ContributorsA list of all contributors.
:raising_hand: RolesAn overview of our core community roles.
:money_with_wings: DonateFund sktime and skpro maintenance and development.
:classical_building: GovernanceHow and by whom decisions are made in the sktime community.

:wave: Citation

To cite skpro in a scientific publication, see citations.