Coder Social home page Coder Social logo

Comments (6)

sonichi avatar sonichi commented on May 15, 2024

Problem 1 will be fixed in #45
Problem 2 is because when training the final estimator in the stacked ensemble learner, the predictions from base learners are added as new features. Then the number of monotonic constraints will be unequal to the # features in the final estimator. When the selected final estimator does not have monotonic constraints this error won't appear. To make the monotonic constraints work in the final estimator, the number of monotonic constraints need to be revised based on X_train, e.g., in fit().

from flaml.

flippercy avatar flippercy commented on May 15, 2024

Thank you Chi. I see what you meant for problem 2. After checking the codes, it turns out that the ensemble is built using the estimator of the best base model as the final estimator with passthrough=True, causing the problem.

A few questions and thoughts:

  1. Is it possible to let users specify the final_estimator and passthrough for the ensemble, please? In practice sometimes the only meta learner can be accepted by the business is GLM. Single boosting models are OK but a boosting model of boosting models is just too complicated for the legal team and regulators. Regarding the passthrough, there is no guarantee that one way will be better than the other so perhaps it is better to let the users decide.

  2. Why does only the customized lightGBM cause this error? We've also built monotonic xgboost, RF and catboost; none of them triggered the error when used as the final_estimator. Does only lightGBM do a check on the number of features vs. length of monotone_constraint?

  3. With the current setting, is there a way to solve this issue? Not sure how to specify a new monotone_constraint for the lightGBM only when it is used as the final_estimator.

Appreciate your help!

from flaml.

sonichi avatar sonichi commented on May 15, 2024
  1. pass_through is for original features. If you set pass_through=False, the original features will not be passed and the predictions are used as features for the final estimator. That won't solve the constraint mismatching problem.
  2. Possibly.
  3. Override the fit() function of the customized lgbm estimator by changing the constraints before calling self._fit(). Like:
def fit(self, X_train, y_train, budget=None, **kwargs):
     # self.params['monotonic_constraints'] = ...
     self._fit(X_train, y_train, **kwargs)

from flaml.

flippercy avatar flippercy commented on May 15, 2024

I understand. Passthrough is unrelated with this issue; just a side thought.

from flaml.

sonichi avatar sonichi commented on May 15, 2024

I understand. Passthrough is unrelated with this issue; just a side thought.

I created a separate issue #48 for this.

from flaml.

sonichi avatar sonichi commented on May 15, 2024

@flippercy I'm closing this issue now. If your problem is not solved feel free to reopen it.

from flaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.