๐ฅ 20 Data Science Interview Questions
1. What is the difference between supervised and unsupervised learning?
- Supervised: Uses labeled data to train models for prediction or classification.
- Unsupervised: Uses unlabeled data to find patterns, clusters, or reduce dimensionality.
2. Explain the bias-variance tradeoff.
A model aims to have low bias (accurate) and low variance (generalizable), but decreasing one often increases the other. Solutions include regularization, cross-validation, and more data.
3. What is feature engineering?
Creating new input features from existing ones to improve model performance. Techniques include scaling, encoding, and creating interaction terms.
4. How do you handle missing values?
- Imputation (mean, median, mode)
- Deletion (rows or columns)
- Model-based methods
- Using a flag or marker for missingness
5. What is the purpose of cross-validation?
Estimates model performance on unseen data by splitting the data into multiple train-test sets. Reduces overfitting.
6. What is regularization?
Techniques (L1, L2) to prevent overfitting by adding a penalty to model complexity.
7. What is a confusion matrix?
A table evaluating classification model performance with True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN).
8. What are precision and recall?
- Precision: TP / (TP + FP) - Accuracy of positive predictions.
- Recall: TP / (TP + FN) - Ability to find all positive instances.
9. What is the F1-score?
Harmonic mean of precision and recall: 2 (Precision Recall) / (Precision + Recall).
10. What is ROC and AUC?
- ROC: Receiver Operating Characteristic, plots True Positive Rate vs False Positive Rate.
- AUC: Area Under the Curve - Measures the ability of a classifier to distinguish between classes.
11. Explain the curse of dimensionality.
As the number of features increases, the amount of data needed to generalize accurately grows exponentially, leading to overfitting.
12. What is PCA?
Principal Component Analysis - Dimensionality reduction technique that transforms data into a new coordinate system where the principal components capture maximum variance.
13. How do you handle imbalanced datasets?
- Resampling (oversampling, undersampling)
- Cost-sensitive learning
- Anomaly detection techniques
- Using appropriate evaluation metrics
14. What are the assumptions of linear regression?
- Linearity
- Independence of errors
- Homoscedasticity
- Normality of errors
15. What is the difference between correlation and causation?
- Correlation: Measures the degree to which two variables move together.
- Causation: Indicates one variable directly affects the other. Correlation does not imply causation.
16. Explain the Central Limit Theorem.
The distribution of sample means will approximate a normal distribution as the sample size becomes larger, regardless of the population's distribution.
17. How do you deal with outliers?
- Removing or capping them
- Transforming data
- Using robust statistical methods
18. What are ensemble methods?
Combining multiple models to improve performance. Examples include Random Forests, Gradient Boosting.
19. How do you evaluate a regression model?
Metrics: MSE, RMSE, MAE, R-squared.
20. What are some common machine learning algorithms?
- Linear Regression
- Logistic Regression
- Decision Trees
- Random Forests
- Support Vector Machines (SVM)
- K-Nearest Neighbors (KNN)
- K-Means Clustering
- Hierarchical Clustering
โค๏ธ React for more Interview Resources
Post #3806
5.93K
- โค 21
- ๐ 1
- ๐ 1