Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Databricks · Databricks Machine Learning Associate

Choosing an ML approach and an algorithm

Databricks Machine Learning Associate · Lesson 11 of 19 · 1:31:58

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Databricks Certified Machine Learning Associate exam. In this lesson: regression, classification, and clustering, when machine learning is worth it, deep learning or traditional machine learning, and choosing an algorithm. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Three requests

Juniper Rides has three new requests: predict the rides of each station for tomorrow, flag the trips likely to end with a damaged scooter, and group riders by their habits. A manager also wants deep learning for all three, because it sounds the most advanced. This lesson covers how to match a problem with regression, classification, or clustering, when machine learning is worth it at all, how deep learning compares with traditional machine learning, and how to pick an algorithm.

Regression, classification, clustering

The first question is what the model must output. Regression predicts a continuous number, like the rides of a station tomorrow, with algorithms like linear regression, random forests, or gradient boosted trees. Classification predicts a class, like whether a trip ends with a damaged scooter, and models like logistic regression return a probability for each class. Both are supervised: they learn from labeled examples, where the right answer is known. Clustering is unsupervised: with no label, it groups similar rows, like riders with similar habits, and K-means, the classic algorithm, needs the number of clusters, k.

Is machine learning worth it?

Before choosing an algorithm, check whether machine learning fits the problem at all. Data comes first: enough historical rows, of good quality, with labels for a supervised problem, and features that exist at prediction time. Then build a baseline, a simple rule like the average rides of the same weekday, and measure it with the same metric as the model. A model is worth it only if it beats the baseline clearly, by a margin that matters to the business. And the return on investment must be positive: the gain must exceed the cost of building, serving, monitoring, and retraining the model, otherwise a simple rule is the better choice.

Deep learning or traditional ML

Deep learning, with neural networks in PyTorch or TensorFlow, shines on unstructured data, like images, text, and audio, and on very large datasets. It needs a lot of data, and usually GPUs, and its training time runs from hours to days, often with distributed training. It is also harder to interpret, and it costs more to serve. Traditional machine learning, like gradient boosted trees or linear models, is usually the better fit for tabular data, the rows and columns of most business tables. It trains in minutes on CPUs, needs less data, and is easier to explain. On Databricks, the ML runtime includes PyTorch and TensorFlow, GPU instance types or serverless GPU compute run deep learning, and Spark ML and scikit-learn cover traditional algorithms.

Choosing an algorithm

Within each type of problem, start simple. Linear and logistic regression are fast and easy to interpret, and they suit roughly linear relationships. Decision trees are easy to explain, while random forests and gradient boosted trees capture non linear effects and interactions, and often give the best results on tabular data. For clustering, K-means needs numeric, scaled features, and a chosen number of clusters. Spark ML offers these algorithms for distributed data, and scikit-learn offers the same families on a single node.

Recap

Let's recap. Regression predicts a number, classification predicts a class, and clustering groups unlabeled rows. Machine learning needs enough good data, a clear win over a simple baseline, and a positive return on investment. Deep learning suits unstructured data and large volumes, with GPUs and long training times. Traditional machine learning suits tabular data, trains fast on CPUs, and is easier to explain. And within each type, start with a simple, interpretable algorithm, then try tree ensembles.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. Juniper Rides wants to group its stations by their pattern of use over the week, with no predefined groups. Which type of problem is this?

    • Regression on weekly rides
    • Classification of stations
    • Clustering of stations
    • Time series forecasting
    Show the answer

    Clustering of stations

    With no predefined groups and no label, clustering finds the stations with similar patterns of use. “Regression on weekly rides” would predict a number, and needs a label. “Classification of stations” needs known classes, which do not exist here. And “Time series forecasting” predicts future values, and forms no groups.

  2. A team proposes a model to predict battery replacements. Only three months of data exist, with 40 replacements, and a simple rule (replace after 500 charge cycles) already catches 9 out of 10. What should the team do first?

    • Keep the rule and gather more labeled data
    • Train a deep learning model on the 40 cases
    • Train boosted trees and deploy them
    • Drop the rule: models beat rules
    Show the answer

    Keep the rule and gather more labeled data

    With little data and a rule that already works, a model is unlikely to repay its cost, so the rule stays while more labeled data comes in. “Train a deep learning model on the 40 cases” would train a data hungry model on forty examples. “Train boosted trees and deploy them” would deploy a model that has not shown that it beats the rule. And “Drop the rule: models beat rules” drops a working baseline, when a model must first beat it.

  3. Juniper Rides wants to check the photos that riders take at the end of each trip, to detect scooters parked on the sidewalk. It has two million labeled photos. Which approach fits best?

    • Linear regression on pixel values
    • Gradient boosted trees on CPUs
    • K-means clustering of the photos
    • A deep learning model trained on GPUs
    Show the answer

    A deep learning model trained on GPUs

    Photos are unstructured data, and with two million labeled examples, a deep learning model trained on GPUs fits best. “Linear regression on pixel values” treats pixels as independent numbers, which works poorly on images. “Gradient boosted trees on CPUs” suits tabular data, not raw images. And “K-means clustering of the photos” needs no label, while these photos are labeled for a clear task.