Skip to content

Conversation

@ZohaibHassan16
Copy link

Description

This PR introduces LightGBM-based test functions, which includes both a Regressor and a Classifier.

Related Issues

Fixes #6

Type of Change

  • [ X] [ENH] - New feature (non-breaking change adding functionality)

How was this solved?

Here is what I did:

  1. Created the Classes: Built LightGBMRegressorFunction and LightGBMClassifierFunction classes.
  2. Hyperparameters & Stuff: Set up a search space with 9 params, used a closure in objective func and made sure model works with library's surrogate system.
  3. Registered Everything: I updated the __init__.py files in both folders

Checklist

Required

  • [ x] PR title includes appropriate tag: [ENH]
  • [ x] Code passes make check (lint, format, isort)

Tests

  • [ x] No tests needed (briefly explain why: The implementation follows established, verified temps by using existing models like RandomForest and DecisionTree, I just adhered to their convention)

Documentation

  • [ x] Documentation added/updated (docstrings, user guide, examples)

Note: New features ([ENH]) typically require both tests and documentation.
Bug fixes ([BUG]) should include a regression test when possible.

Testing

Verification can be performed by instantiating the classes and checking the search space or objective function:
from surfaces.test_functions.machine_learning.hyperparameter_optimization.tabular.regression import LightGBMRegressorFunction lgbm_f = LightGBMRegressorFunction(dataset="diabetes", cv=5) print(lgbm_f.search_space) lgbm_f._create_objective_function() print(f"Pure objective function ready: {lgbm_f.pure_objective_function is not None}")

Copy link
Owner

@SimonBlanke SimonBlanke left a comment

Choose a reason for hiding this comment

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

Thanks for opening the PR. I'll look into this. In the meantime you should also add this new feature to the docs: https://github.com/SimonBlanke/Surfaces/tree/main/docs/source

@ZohaibHassan16
Copy link
Author

Hey @SimonBlanke , just did and also fixed a few module export issues which I stubbed into while testing docs in terminal. Let me know if you need anything else.

@SimonBlanke SimonBlanke mentioned this pull request Jan 18, 2026
5 tasks
Copy link
Owner

@SimonBlanke SimonBlanke left a comment

Choose a reason for hiding this comment

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

There are some test fails, because the package is not installed in the CI. This needs to be corrected.
It is also necessary to add a simple test for this function in the same style as existing tests.

@ZohaibHassan16
Copy link
Author

Hey @SimonBlanke,

I've finished up the LightGBM integration !!

Here is what I’ve updated:

Testing: I updated tests/full/smoke/test_lightgbm.py to be a full execution test.

Verification Results: I ran a manual logic check and the official smoke tests. Both confirmed that the models are up running and training correctly on real datasets (digits for Classification and diabetes for Regression).

Manual Logic Test:
Screenshot 2026-01-23 184419

Official Pytest Run:
Screenshot 2026-01-23 184208

Let me know if there’s anything else you’d like me to tweak!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] add LightGBM test-function for tabular machine-learning

2 participants