Skip to content

[ENH] OnlineBatchMixture online regression#900

Merged
fkiraly merged 1 commit into
sktime:mainfrom
patelchaitany:enh/online-batch-mixture
May 28, 2026
Merged

[ENH] OnlineBatchMixture online regression#900
fkiraly merged 1 commit into
sktime:mainfrom
patelchaitany:enh/online-batch-mixture

Conversation

@patelchaitany
Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Implemented OnlineBatchMixture from Issue #464

What does this implement/fix? Explain your changes.

Adds OnlineBatchMixture, an online regression strategy that fits a separate regressor clone on each incoming batch and returns a Mixture of predictions weighted by sample counts.

Supports a min_batch_size threshold with two modes: "accumulate" (buffer small batches) or "discard" (drop them).

Here is small example

  from skpro.regression.online import OnlineBatchMixture
  from skpro.regression.residual import ResidualDouble
  from sklearn.linear_model import LinearRegression
  from sklearn.datasets import load_diabetes
  from sklearn.model_selection import train_test_split
  
  X, y = load_diabetes(return_X_y=True, as_frame=True)
  X_train, X_test, y_train, y_test = train_test_split(X, y)
  
  reg_proba = ResidualDouble(LinearRegression())
  online = OnlineBatchMixture(reg_proba, min_batch_size=30)
  online.fit(X_train[:200], y_train[:200])
  online.update(X_train[200:], y_train[200:])
  y_pred = online.predict_proba(X_test)

Does your contribution introduce a new dependency? If yes, which one?

No

What should a reviewer concentrate their feedback on?

Did you add any tests for the change?

Any other comments?

PR checklist

For all contributions
  • I've added myself to the list of contributors with any new badges I've earned :-)
    How to: add yourself to the all-contributors file in the skpro root directory (not the CONTRIBUTORS.md). Common badges: code - fixing a bug, or adding code logic. doc - writing or improving documentation or docstrings. bug - reporting or diagnosing a bug (get this plus code if you also fixed the bug in the PR).maintenance - CI, test framework, release.
    See here for full badge reference
  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
For new estimators
  • I've added the estimator to the API reference - in docs/source/api_reference/taskname.rst, follow the pattern.
  • I've added one or more illustrative usage examples to the docstring, in a pydocstyle compliant Examples section.
  • If the estimator relies on a soft dependency, I've set the python_dependencies tag and ensured
    dependency isolation, see the estimator dependencies guide.

@patelchaitany
Copy link
Copy Markdown
Contributor Author

@fkiraly, @felipeangelimvieira could you plz review it.

@fkiraly fkiraly changed the title [ENH] Add OnlineBatchMixture online regression [ENH] OnlineBatchMixture online regression May 17, 2026
@fkiraly fkiraly added module:regression probabilistic regression module implementing algorithms Implementing algorithms, estimators, objects native to skpro labels May 17, 2026
Comment thread skpro/regression/online/_batch_mixture.py Outdated
Comment thread skpro/regression/online/_batch_mixture.py Outdated
Comment thread docs/source/api_reference/regression.rst Outdated
Copy link
Copy Markdown
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

I left some small change requests.

Copy link
Copy Markdown
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have not addressed my change requests.

Please ensure you also comment on change requests: either you carry them out and say so, or you ask for clarification, or you argue why you think it should not be made (e.g., out of scope).

Signed-off-by: Chaitany patel <patelchaitany93@gmail.com>
@patelchaitany patelchaitany force-pushed the enh/online-batch-mixture branch from 859697d to 2bb60f9 Compare May 27, 2026 08:07
@patelchaitany patelchaitany requested a review from fkiraly May 27, 2026 08:15
Copy link
Copy Markdown
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@fkiraly fkiraly merged commit fccab79 into sktime:main May 28, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

implementing algorithms Implementing algorithms, estimators, objects native to skpro module:regression probabilistic regression module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants