Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PySpark ML Workflow

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

In Pyspark, what does StringIndexer do? 

a)

Turns numbers into text 

b)

Turns text categories into number 

c)

Deletes text columns 

d)

Finds missing values 

2.

What does OneHotEncoder create? 

a)

A single number for each category 

b)

A vector of 0s and 1s for categories 

c)

A column with only null values

d)

A summary of the data

3.

In PySpark MLlib, which of the following algorithms can be used for clustering? 

a)

KMeans 

b)

Logistic Regression

c)

Random Forest 

d)

Naive Bayes

4.

What does df.describe.show() do? 

a)

Shows the schema 

b)

Removes missing values 

c)

Converts text to numbers 

d)

Shows summary statistics of columns 

5.

This is the only metric available in the BinaryClassificationEvaluator 

a)

Weighted Precision

b)

Accuracy 

c)

F1-Score

d)

ROC AUC 

6.

True or False: Applying standardization through StandardScaler or MinMaxScaler will immediately improve the model performance. 

a)

True

b)

False

7.

What is the function to combine many columns into one feature column? 

a)

VectorAssembler 

b)

StringIndexer 

c)

OneHotEncoder 

d)

VectorIndexer 

8.

True or false: fillna() can only be used on numeric columns, not text. 

a)

True

b)

False

9.

In PySpark MLib, what is the main purpose of a Pipeline? 

a)

To train multiple models at once 

b)

To automate feature engineering, model training, and evaluation steps in sequence 

c)

To parallelize Spark jobs across multiple clusters

d)

To tune hyperparameters automatically

10.

This is the only metric available in the ClusteringEvaluator 

a)

Inertia

b)

Recall

c)

Silhouette Score

d)

Accuracy