Databricks Certified Machine Learning Associate · Free Practice Question Medium

Question 18

How does Spark ML tackle a linear regression problem for an extraordinarily large dataset? Which one of the options is correct?

Choose only ONE best answer.

  • A

    Brute Force Algorithm

  • B

    Matrix decomposition

  • C

    Singular value decomposition

  • D

    Least square method

  • E

    Gradient descent

Reveal correct answer

Correct answer: E

Explanation

Correct Answer:
✅ Gradient descent

Explanation:

For extraordinarily large datasets, Spark ML tackles linear regression problems using Gradient Descent (GD) instead of the traditional Least Squares Method.

  • Why Gradient Descent?

    • The Least Squares Method requires inverting a large matrix, which is computationally expensive and infeasible for big data.

    • Gradient Descent scales efficiently because it updates model weights iteratively instead of solving an explicit equation.

    • Spark ML implements Stochastic Gradient Descent (SGD) and L-BFGS (Limited-memory BFGS) for optimization.

Example: Linear Regression in Spark ML Using Gradient Descent

  • solver="gd" ensures that gradient descent is used for optimization.

  • Spark also supports L-BFGS solver, which is an improvement over basic GD.

Why Other Options Are Incorrect?

  1. Brute Force Algorithm

    • Incorrect, because brute force is not computationally feasible for large datasets.

    • Spark uses optimization algorithms like GD instead of exhaustive search.

  2. Matrix Decomposition

    • Incorrect, because matrix decomposition methods (e.g., Cholesky, LU decomposition) require storing large matrices, which is impractical for large-scale ML.

  3. Singular Value Decomposition (SVD)

    • Incorrect, because SVD is used for dimensionality reduction and PCA, not for training regression models efficiently.

  4. Least Squares Method

    • Incorrect, because the Least Squares Method requires inverting a large matrix, which is computationally expensive for big data.

    • Spark avoids direct matrix inversion and uses Gradient Descent instead.

Final Answer:

✅ Spark ML tackles large-scale linear regression problems using Gradient Descent, making it scalable and efficient for big data processing.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need