Open jinlow opened 7 months ago
For some reason, Shapley runs much slower on windows than Linux.
import forust import xgboost as xgb import seaborn as sns import numpy as np df = sns.load_dataset("titanic") X = df.select_dtypes("number").drop(columns=["survived"]).astype("float32") y = df["survived"] model = xgb.XGBClassifier( objective="binary:logistic", max_depth=15, n_estimators=1000, ) model.fit(X, y) loaded = forust._from_xgboost_model(model)
And then running on linux...
%%timeit loaded.predict_contributions(X, method="Shapley")
And then XGBoost.
%%timeit model.get_booster().predict( xgb.DMatrix(X), pred_contribs=True, approx_contribs=False )
And then on windows.
For some reason, Shapley runs much slower on windows than Linux.
And then running on linux...
And then XGBoost.
And then on windows.