Skip to content

[ENH] Add Bayesian modelling API PoC: base class, prior spec, ridge r…#1022

Draft
WHOIM1205 wants to merge 1 commit intosktime:mainfrom
WHOIM1205:bayesian-api-poc
Draft

[ENH] Add Bayesian modelling API PoC: base class, prior spec, ridge r…#1022
WHOIM1205 wants to merge 1 commit intosktime:mainfrom
WHOIM1205:bayesian-api-poc

Conversation

@WHOIM1205
Copy link
Copy Markdown
Contributor

Title

feat: add Bayesian modelling API (PoC) with Bayesian Ridge Regression


Summary

This PR introduces a proof-of-concept Bayesian modelling layer to skpro, adding a consistent API for prior/posterior handling along with a working Bayesian Ridge Regression estimator.

The goal is to establish a foundation for integrating Bayesian workflows (priors, posterior inference, sequential updates) into the existing probabilistic framework without introducing new dependencies or breaking existing APIs.


Changes

New

  • _base.py

    • Adds BaseBayesianRegressor mixin extending BaseProbaRegressor
    • Introduces:
      • get_prior()
      • get_posterior()
      • get_posterior_summary()
      • sample_posterior()
      • update() for sequential learning
  • _prior.py

    • Implements Prior abstraction
    • Wraps existing skpro distributions (no new DSL)
    • Backend-agnostic design
  • _ridge.py

    • Adds BayesianRidgeRegressor
    • Closed-form posterior with Type-II ML (evidence maximization)
    • Supports sequential updates via sufficient statistics
    • Uses only numpy/scipy (no soft deps)
  • tests/test_bayesian_ridge.py

    • 11 tests covering:
      • fit/predict behavior
      • posterior correctness
      • Bayesian API methods
      • sequential updates
      • prior validation
  • README.md

    • PoC overview
    • Usage and run instructions

Modified

  • __init__.py
    • Export new Bayesian classes

Test Plan

Run:

pytest skpro/regression/bayesian/tests/test_bayesian_ridge.py -v -o "addopts="

…egressor

Signed-off-by: WHOIM1205 <rathourprateek8@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants