linkedin / TE2Rules

Python library to explain Tree Ensemble models (TE) like XGBoost, using a rule list.
Other
38 stars 5 forks source link

Extracting Rules #9

Open waziz786 opened 3 weeks ago

waziz786 commented 3 weeks ago

Dear Roshan,

I hope this message finds you well, I have been trying to extract rules for my project of classifying emergency Stay as short or long. When i classify as long it works fine and in a considerably good time but when i switch the labels to extract the rules for short stay in runs for around 12 hours and finally runs into an error as given below. Please kindly if you could help me regarding the matter.

Kind Regards,

Waqar image

waziz786 commented 3 weeks ago

PS: after this the kernel crashes

groshanlal commented 3 weeks ago

I might need some more context to know what might possibly be happening.

How exactly did you try extracting rules for the other class? Did you train a new model with ground truth labels flipped?I'm trying to understand what is your y_train_pred in the above notebook? Is it binary labels (0, 1) directly from the model?

How many stages did you try running? Can you try running it with just 1 stage and see if you get any rules?

Regarding the kernel crashing, I believe you ran out of memory in the notebook. In the later stages, the model tries to explore a lot of combinations and is memory intensive. You can try using a lower jaccard_threshold to make it run, but you might have some performance tradeoff there.

waziz786 commented 3 weeks ago

Dear Roshan,

i think the problem might be because of using the fine tuned model, when i run the simple model (default settings) it runs fine.

waziz786 commented 3 weeks ago

PS: this is the model i am using:

Train an XGboost Model

model = GradientBoostingClassifier(n_estimators=200, max_depth=5, learning_rate=0.1, min_samples_split=10, min_samples_leaf=2, random_state= 42) model.fit(X_train, y_train)