Databricks Machine Learning Associate Question 553
Select 3You are training a machine learning model to classify rare disease cases based on patient medical records. The dataset you are using has a highly imbalanced target variable, where only 2% of the records belong to the positive (disease) class. Which of the following techniques can help mitigate the data imbalance issue and improve the model's performance?
- A
Oversample the minority class using techniques like SMOTE (Synthetic Minority Oversampling Technique).
- B
Undersample the majority class to balance the dataset.
- C
Use a class-weighted loss function during model training.
- D
Remove all examples of the minority class to simplify the dataset.
- E
Train the model only on the majority class to improve its accuracy.
Show answer and explanation
Correct answers: A, B, C
Explanation
Data imbalance can significantly affect the performance of machine learning models, especially when the minority class is critical, as in this case. Effective techniques include oversampling the minority class, undersampling the majority class, and using a class-weighted loss function. These methods help the model better learn the minority class patterns without introducing significant bias. Removing the minority class entirely or training only on the majority class would result in a model incapable of addressing the original problem.
- A. Correct.
Oversampling the minority class (e.g., using SMOTE) generates synthetic data points for the minority class, helping to balance the dataset and prevent the model from being biased toward the majority class.
- B. Correct.
Undersampling the majority class reduces the number of samples in the majority class to balance the dataset. While it may remove some data, it can be effective when the dataset is large and imbalance is significant.
- C. Correct.
Using a class-weighted loss function assigns higher weights to errors on the minority class, encouraging the model to pay more attention to the minority class during training.
- D. Incorrect.
Removing all examples of the minority class would completely eliminate the class you are trying to predict, which is not a valid approach to handle data imbalance.
- E. Incorrect.
Training the model only on the majority class would ignore the minority class and lead to a model that cannot make predictions for the rare event, which is counterproductive.