Machine Learning Associate ยท Algorithms, pipelines and imbalance
Selecting an algorithm
Matching problem type (classification, regression, clustering, recommendation) and data characteristics to a suitable algorithm family, with trade-offs in interpretability, scale and data size.
Key points
- Start from the problem type: classification (discrete label), regression (continuous value), clustering (no labels, find groups), recommendation (user-item preferences, e.g. ALS).
- Then weigh data and constraints: linear models are fast, scale well and are easy to explain; tree ensembles capture nonlinearity and mixed features with little preprocessing but are less transparent; neural networks need more data and tuning.
Source: https://spark.apache.org/docs/latest/ml-classification-regression.html
Practice questions
A retailer has customer records with no labels and wants to discover natural groups of similar shoppers. Which problem type is this?
- Clustering
- Binary classification
- Regression
- Time-series forecasting
Show answer
Answer: A. Clustering
Grouping unlabeled records is unsupervised clustering (for example k-means). Classification and regression both need a labeled target.
Which of these Spark ML algorithms are supervised classifiers?
- RandomForestClassifier
- KMeans
- NaiveBayes
- ALS
- LinearSVC
Show answer
Answer: A. RandomForestClassifier, C. NaiveBayes, E. LinearSVC
RandomForestClassifier, NaiveBayes and LinearSVC learn from labeled data to predict classes. KMeans is clustering and ALS is collaborative-filtering recommendation.
A deep neural network is always the best choice, even for a small tabular dataset.
Show answer
Answer: False
On small tabular data, simpler models or tree ensembles usually match or beat neural networks, train faster and are easier to explain. Networks tend to need much more data.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
