Package: skpro
:rocket:Version 2.2.0 out now!Read the release notes here..skprois a library for supervised probabilistic prediction in python.
It providesscikit-learn-like,scikit-basecompatible interfaces to:tabularsupervised regressors for probabilistic prediction- interval, quantile and distribution predictionstabularprobabilistic time-to-event and survival prediction- instance-individual survival distributionsmetrics to evaluate probabilistic predictions, e.g., pinball loss, empirical coverage, CRPS, survival lossesreductionsto turnscikit-learnregressors into probabilisticskproregressors, such as bootstrap or conformalbuildingpipelines and composite models, including tuning via probabilistic performance metricssymbolicprobability distributionswith value domain ofpandas.DataFrame-s andpandas-like interfaceOverviewOpen SourceTutorialsCommunityCI/CDCodeDownloads:books: DocumentationDocumentation: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 questionsQuestions 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.skprois maintained by thesktimecommunity, 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-chatchannel ·Discord:globe_with_meridians:Community collaboration sessionDiscord- Fridays 3 pm UTC, dev/meet-ups channel:dizzy: FeaturesOur objective is to enhance the interoperability and usability of the AI model ecosystem:skprois compatible withscikit-learnandsktime, e.g., ansktimeproba forecaster can
be built with anskproproba regressor which in ansklearnregressor with proba mode added byskproskproprovides a mini-package management framework for first-party implemenentations,
and for interfacing popular second- and third-party components, such ascyclic-boostingorMAPIEpackages.skprocurates libraries of components of the following types:ModuleStatusLinksProbabilistic tabular regressionmaturingTutorial·API Reference·Extension TemplateTime-to-event (survival) predictionexperimentalAPI Reference·Extension TemplatePerformance metricsmaturingAPI ReferenceProbability distributionsmaturingAPI Reference:hourglass_flowing_sand: InstallingskproTo installskpro, usepip:pipinstallskproor, with maximum dependencies,pipinstallskpro[all_extras]Releases are available as source packages and binary wheels. You can see all available wheelshere.:zap: QuickstartMaking probabilistic predictionsfromsklearn.datasetsimportload_diabetesfromsklearn.ensembleimportRandomForestRegressorfromsklearn.linear_modelimportLinearRegressionfromsklearn.model_selectionimporttrain_test_splitfromskpro.regression.residualimportResidualDouble# step 1: data specificationX,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 predictionreg_mean=RandomForestRegressor()reg_resid=LinearRegression()reg_proba=ResidualDouble(reg_mean,reg_resid)# step 3: fitting the model to training datareg_proba.fit(X_train,y_train)# step 4: predicting labels on new data# probabilistic prediction modes - pick any or multiple# full distribution predictiony_pred_proba=reg_proba.predict_proba(X_new)# interval predictiony_pred_interval=reg_proba.predict_interval(X_new,coverage=0.9)# quantile predictiony_pred_quantiles=reg_proba.predict_quantiles(X_new,alpha=[0.05,0.5,0.95])# variance predictiony_pred_var=reg_proba.predict_var(X_new)# mean prediction is same as "classical" sklearn predict, also availabley_pred_mean=reg_proba.predict(X_new)Evaluating predictions# step 5: specifying evaluation metricfromskpro.metricsimportCRPSmetric=CRPS()# continuous rank probability score - any skpro metric works!# step 6: evaluat metric, compare predictions to actualsmetric(y_test,y_pred_proba)>>>32.19:wave: How to get involvedThere are many ways to get involved with development ofskpro, which is
developed by thesktimecommunity.
We follow theall-contributorsspecification: 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 sktime's community.:wave: CitationTo citeskproin a scientific publication, seecitations.