You have a binary classification dataset with 5,000 examples of the first class and 95,000 of the second. What would you do?
Asked at
AI answer
First, I would determine how important the rare class is and what the cost of errors is: false negatives and false positives. Then I would split the data into train/validation/test sets using stratification and check for leakage; I would not use the test set to select a solution. I would compare a baseline model with models trained using class weights or sampling (for example, oversampling only on the train set). I would evaluate performance using more than just accuracy: precision, recall, F1, and PR-AUC for the rare class. If needed, I would select a threshold on the validation set based on the required trade-off. If probabilities matter, I would check their calibration. After deployment, I would monitor performance and the share of positive predictions.
Also asked at СБЕР
Similar questions
- Have you ever worked with binary classification? Have you encountered class imbalance in such tasks, and what can be done about it?
- A binary classification task is being solved where the positive class makes up 5% of the data, and the model’s Accuracy is 95%. What can you say about the quality of this model?
- How did you fine-tune BERT and manipulate the data to balance the rare classes?
- What classification methods (algorithms) do you know? Explain them.
- You need to improve the quality of a classifier (for example, one based on ruBERT). Options include fine-tuning a larger model, cleaning the data, choosing a threshold, or building an ensemble. Where would you start, and why?