Skip to content

Conversation

@yuvimittal
Copy link

@yuvimittal yuvimittal commented Nov 20, 2025

Reference Issues/PRs

Fixes #589

What does this implement/fix? Explain your changes.

Adds interface for lightgbmlss probabilistic regressor

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

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.

@yuvimittal yuvimittal marked this pull request as draft November 20, 2025 14:14
@yuvimittal yuvimittal marked this pull request as ready for review November 20, 2025 15:05
@fkiraly fkiraly changed the title Add LightGBMLSS to skpro [ENH] LightGBMLSS interface Nov 20, 2025
@fkiraly fkiraly added enhancement module:regression probabilistic regression module labels Nov 20, 2025
@fkiraly
Copy link
Collaborator

fkiraly commented Nov 20, 2025

code quality checks are failing, see https://www.sktime.net/en/stable/developer_guide/coding_standards.html

@yuvimittal
Copy link
Author

code quality checks are failing, see https://www.sktime.net/en/stable/developer_guide/coding_standards.html

@fkiraly , i will look into it. Thank you

@yuvimittal yuvimittal requested a review from fkiraly November 21, 2025 09:05
@fkiraly
Copy link
Collaborator

fkiraly commented Nov 21, 2025

_hyper_opt is actually being used inside _fit when n_trials > 0:

Ah, I see - you are right.

In this case, I believe this feature requires optuna?

In the __init__, then, set_tag should be used to set python_dependencies including optuna, if n_trials>0.

Copy link
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.

Nice! Looks like it should work.

Two comments:

  • the estimator seems to be failing tests - is this stochastic? FYI @StatMixedML
  • this looks largely identical to the xgboostlss interface - good that you recognized this! Of course copy-pasting is a good starting idea, but I think we should not leave it with duplicate code, due to the DRY principle https://en.wikipedia.org/wiki/Don%27t_repeat_yourself. I would move methods or pieces of code that are common to both estimators into a new mixin class in a new module regression.adapters._statmixedml (if this looks reasonably modularizable)

@yuvimittal
Copy link
Author

yuvimittal commented Nov 22, 2025

Nice! Looks like it should work.

Two comments:

  • the estimator seems to be failing tests - is this stochastic? FYI @StatMixedML
  • this looks largely identical to the xgboostlss interface - good that you recognized this! Of course copy-pasting is a good starting idea, but I think we should not leave it with duplicate code, due to the DRY principle https://en.wikipedia.org/wiki/Don%27t_repeat_yourself. I would move methods or pieces of code that are common to both estimators into a new mixin class in a new module regression.adapters._statmixedml (if this looks reasonably modularizable)

Thanks for the review!

• I’ve introduced a new shared module regression.adapters._statmixedml and refactored the overlapping logic from both XGBoostLSS and LightGBMLSS into it.

•Regarding the failing CI tests, I'm trying to reproduce them locally. The CI output shows that test_fit_does_not_overwrite_hyper_params is failing for LightGBMLSS, but this test is being skipped locally because LightGBMLSS is not picked up during local test discovery. Could you please let me know the recommended way to run the CI-equivalent test suite locally so I can reproduce the same failure before pushing further commits?

@fkiraly
Copy link
Collaborator

fkiraly commented Nov 22, 2025

but this test is being skipped locally because LightGBMLSS is not picked up during local test discovery.

It should get picked up, can you share how you are trying to run, or how you are discovering tests?

Could you please let me know the recommended way to run the CI-equivalent test suite locally so I can reproduce the same failure before pushing further commits?

The easiest is to run check_estimator from skpro.utils on your new estimator.

@yuvimittal
Copy link
Author

yuvimittal commented Nov 22, 2025

but this test is being skipped locally because LightGBMLSS is not picked up during local test discovery.

It should get picked up, can you share how you are trying to run, or how you are discovering tests?

Could you please let me know the recommended way to run the CI-equivalent test suite locally so I can reproduce the same failure before pushing further commits?

The easiest is to run check_estimator from skpro.utils on your new estimator.

Initially i was looking at the failed tests from CI and running them, but now i ran check_estimator on both xgboostlss and lightgbmlss, xgboostlss is running perfectly but i am unable to install lightgbm

this is the error i am getting :

Screenshot 2025-11-23 at 2 03 21 AM

@fkiraly
Copy link
Collaborator

fkiraly commented Nov 25, 2025

I think the package is available only for up to python 3.11 - so you nay want to set the python_dependencies tag to exclude the failing versions.

@StatMixedML
Copy link

The original LightGBMLSS is now aligned with @fkiraly's implementation for XGBoostLSS. just wanted to inform you.

Copy link
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.

Thanks!

Please restore deleted content, e.g., the entire docstring of XGBoostLSS, or the _hyperopt method, etc.

If you use AI, please check what it does and do not allow it to delete random stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement module:regression probabilistic regression module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] Add LightGBMLSS to skpro

3 participants