When is Spark ML the better choice over a single-node library such as scikit-learn?
- Exam domain
- Model Development44% of the exam
- Difficulty
- Medium
- In this mock
- 22 questions on this domainPractise this domain
Why the exam asks this
Model Development (44% of the exam)
Objective in the exam guide: Identify when SparkML is recommended based on the data, model, and use case requirements.
When Spark ML is recommended is named.
Why B is the answer
When training data is too large for one machine
Spark ML distributes training across a cluster, which pays off when data does not fit on one node. Small data trains faster on one node.
Remember: Spark ML for data beyond one node.
How it works
Distribution helps only when data exceeds one node.
In detail
- Big data: Spark ML.
- Small data: single node is simpler and faster.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Whenever the dataset has more than a few thousand rows, because scikit-learn cannot handle that manyWrongMost tempting
Single-node libraries handle millions of rows on a big machine.
Why it tempts: Row counts sound big but fit easily on one machine.
B. When training data is too large for one machineRight
Spark ML for data beyond one node.
C. When you need the lowest-latency single-row predictionsWrong
Single-row real-time serving suits single-node models.
D. When the model is a large pretrained transformerWrong
Large transformers use deep learning frameworks.
Use case
An illustrative scenario, not a real incident.
Illustrative: a 2 TB clickstream model is trained with Spark ML logistic regression.
See it in different ways
flowchart TD
Q{"Does the data fit on one machine?"}
Q -->|"No"| A0["Spark ML"]
Q -->|"Yes"| A1["Single-node library"]How to read this chart
- At "Does the data fit on one machine?": if "No", go to "Spark ML"; if "Yes", go to "Single-node library".
mindmap
root(("Training"))
n1["Spark ML"]
n2["Distributed data"]
n3["Built-in algorithms"]
n4["Single node"]
n5["Fits in memory"]
n6["Richer libraries"]How to read this chart
- The centre is "Training".
- "Spark ML" covers "Distributed data", "Built-in algorithms".
- "Single node" covers "Fits in memory", "Richer libraries".