Bitzu

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

Single choice

A retailer has customer records with no labels and wants to discover natural groups of similar shoppers. Which problem type is this?

  1. Clustering
  2. Binary classification
  3. Regression
  4. 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.

Select all that apply

Which of these Spark ML algorithms are supervised classifiers?

  1. RandomForestClassifier
  2. KMeans
  3. NaiveBayes
  4. ALS
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More Machine Learning Associate topics in this module