BCG-X-Official / sklearndf

DataFrame support for scikit-learn.
https://bcg-x-official.github.io/sklearndf/
Apache License 2.0
63 stars 7 forks source link

Native XGBoost support #164

Closed konst-int-i closed 2 years ago

konst-int-i commented 3 years ago

Is your feature request related to a problem? Please describe. XGboost is currently not natively supported by sklearndf

Describe the solution you'd like Currently, users can fix this individually by using the make_df_regressor wrapper

from xgboost import XGBRegressor
from sklearndf.wrapper import make_df_regressor
XGBRegressorDF = make_df_regressor(XGBRegressor)

It would be desirable to move this directly into sklearnf.regression and sklearn.classification for the XGboost regressor/classifier respectively.

To avoid additional dependencies, we should make an assertion that xgboost must be installed if the XGBRegressorDF/XGBClassifierDF is used.

Describe alternatives you've considered n/a

Additional context n/a

joerg-schneider commented 3 years ago

Potentially going into .extra, right?

This additionally raises a good question, if it could be indeed better for the package to not depend on external packages used by .extra – for example, doing something like:

try:
    from lightgbm.sklearn import LGBMClassifier
except ImportError:
   LGBMClassifier = MissingExternalEstimator("lightgbm")

Whereas either make_df_(LGBMClassifier) can already check for this type to warn, or on instance construction (of MissingExternalEstimator) the error is thrown. (this would be handy, as the DF wrapping already occurs on import time, and I think we do not want several modules for each external dependency, in case they grow over time...)

sokolmateusz commented 2 years ago

Addressed in #215. @j-ittner should we close this ticket?

j-ittner commented 2 years ago

Absolutely. Closed by #215.