Skip to content
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

Issue on param class_weights in CatBoostClassifier #25

Closed
erko opened this issue Jul 19, 2017 · 2 comments
Closed

Issue on param class_weights in CatBoostClassifier #25

erko opened this issue Jul 19, 2017 · 2 comments

Comments

@erko
Copy link

erko commented Jul 19, 2017

Have some trouble using class weights for binary classes. Can't share dataset because of confidentiality, but looks like problem is in algorithm itself. Tried to track prob in source, but ended up at file catboost/app/mode_fit.cpp - can't find where is problem.

Using value [1, 13], 13 for positive class works (AUC ~ 0.91) but slightly worse than training without classweighting. XGBoost performs better ~0.93 with [1, 15] class weightings.
But, training process stuck on AUC 0.5. if I set 15 for positive class:

class_weights = np.array([1., 15.])
# class_weights = (class_weights / np.sum(class_weights))
class_weights = class_weights.tolist()
print(class_weights)
random_seed = 123456
model = cgb.CatBoostClassifier(iterations=500, learning_rate=0.1, depth=5, l2_leaf_reg=2, rsm=1, class_weights=class_weights,
                               auto_stop_pval=1e-4, random_seed=random_seed, eval_metric='AUC')
model.fit(train_X, train_Y, eval_set=(test_X, test_Y), verbose=True, plot=True)
@annaveronika
Copy link
Contributor

Could you provide a reproducible example of this behavoir?

@annaveronika
Copy link
Contributor

closing because of inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants