Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Databricks Certified Associate Developer for Apache Spark · Databricks
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
- Correct answer : A — `pipeline = Pipeline(stages=[indexer, lr])` `model = pipeline.fit(train_df)`, which chains both stages in order and trains them together with one `fit()` call. A . `Pipeline` accepts an ordered list of stages, and a single `fit()` call runs each stage's transformation or training in sequence, which is exactly the reusable, chained workflow the developer wants. B . `indexer.fit(train_df)` produces a fitted `StringIndexerModel`, not a transformed DataFrame; `lr.fit()` needs an actual DataFrame of features and labels, so feeding it a model object is a type mismatch. C . A Python list is not a Spark ML construct and has no `.fit()` method, so this line fails immediately rather than chaining the indexer and the classifier. D . `LogisticRegression.fit()` only accepts a DataFrame (and optional params), not a `transformers` argument, so this call does not exist as written and raises a `TypeError`. E . `Pipeline` expects its stages to be passed as a `stages` keyword argument holding a list, not as separate positional arguments, so constructing it this way raises a `TypeError` before fitting begins.