-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A couple of errors when building the ensemble #47
Comments
Problem 1 will be fixed in #45 |
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:
Appreciate your help! |
def fit(self, X_train, y_train, budget=None, **kwargs):
# self.params['monotonic_constraints'] = ...
self._fit(X_train, y_train, **kwargs) |
I understand. Passthrough is unrelated with this issue; just a side thought. |
I created a separate issue #48 for this. |
@flippercy I'm closing this issue now. If your problem is not solved feel free to reopen it. |
Hi:
Our team has explored the ensemble option in the fit function of automl and got a few errors:
from flaml.data import load_openml_dataset
X_train, X_test, y_train, y_test = load_openml_dataset(dataset_id = 1169, data_dir = './')
settings = {
"time_budget": 40,
"metric": 'roc_auc',
"task": 'classification',
"estimator_list": [
'lrl1'
,'lrl2'
,'lgbm'
, 'xgboost'
],
"log_file_name": 'airlines_experiment.log',
}
automl.fit(X_train = X_train, y_train = y_train, ensemble=True, **settings)
[flaml.automl: 03-18 17:34:40] {1157} INFO - [('xgboost', <flaml.model.XGBoostSklearnEstimator object at 0x7f61f8659ed0>), ('lgbm', <flaml.model.LGBMEstimator object at 0x7f61f8687350>), ('lrl2', <flaml.model.LRL2Classifier object at 0x7f61f8687090>), ('lrl1', <flaml.model.LRL1Classifier object at 0x7f61f8654150>)]
RuntimeError: Cannot clone object <flaml.model.LRL2Classifier object at 0x7f84877a1c10>, as the constructor either does not set or modifies parameter penalty.
This is similar to the error we've discussed before.
class MyMonotonicXGBGBTreeClassifier(BaseEstimator):
class MyMonotonicLightGBMGBDTClassifier(BaseEstimator):
Without the ensemble, both worked well as individual learners. However, when we set ensemble=True, the monotonic xgboost learner still worked well but the process always crashed if the monotonic lightGBM learner was included in the list of estimators. The kernel of Jupyter just went dead without any error message. In the .out file generated at the backend, there is an error message:
[LightGBM] [Fatal] Check failed: static_cast<size_t>(num_total_features_) == io_config.monotone_constraints.size() at /__w/1/s/python-package/compile/src/io/dataset.cpp, line 314
What does it mean? It seems that something is wrong with the monotone_constraints but the size of the constraints matches the number of variables.
This error can be replicated using the airlines data; to make it easier just let monotone=(0, 0, 0, 0, 0, 0, 0).
Appreciate your help.
The text was updated successfully, but these errors were encountered: