Skip to main content
๐Ÿ› Bug HuntAI AI & ML Hardโšก+35 XP

Class Imbalance Ignored

Model predicts majority class for almost all inputs.

๐Ÿ› Find the bug
1model = LogisticRegression()
2model.fit(X_train, y_train) # 95% class 0, 5% class 1
๐Ÿ› The bug is on line 2

๐Ÿ”ง Select the correct fix: