csinva / imodels

Interpretable ML package 🔍 for concise, transparent, and accurate predictive modeling (sklearn-compatible).
https://csinva.io/imodels
MIT License
1.34k stars 119 forks source link

Is library supporting scikit-learn API such as XGBoost or LightGBM compatible to HSTreeClassifier/Regressor? #171

Closed HyukdongKim closed 1 year ago

HyukdongKim commented 1 year ago

First, thank you for creating such an awesome library.

I tried to apply HSTreeClassifier(&Regressor) to the XGBoost library and it does not change anything to prediction.

Of course, I saw in the support-for-different-tasks in readme.md that it says 'Wraps any sklearn tree-based model'.

Is that means only compatible to scikit-learn's model or other possibilities?

Test env followings:

From sklearns example, I just changed

classifiers = [
    DecisionTreeClassifier(max_depth=5),
    RandomForestClassifier(max_depth=5, n_estimators=10, max_features=1),
    AdaBoostClassifier(),
    XGBClassifier(),
]

to

classifiers = [
    HSTreeClassifier(DecisionTreeClassifier(max_depth=5)),
    HSTreeClassifier(RandomForestClassifier(max_depth=5, n_estimators=10, max_features=1)),
    HSTreeClassifier(AdaBoostClassifier()),
    HSTreeClassifier(XGBClassifier()),
]

And I noticed HSTreeClassifier works to DecisionTreeClassifier, RandomForestClassifier and AdaBoostClassifier. But not to XGBClassifier.

Base template image

with HSTreeClassifier image