Linear Regression in Python – Quiz 1

Linear Regression in Python – Quiz 1

University

8 Qs

quiz-placeholder

Similar activities

Regression in Machine Learning

Regression in Machine Learning

University

10 Qs

Regression Models in Machine Learning

Regression Models in Machine Learning

University

10 Qs

Linear Regression

Linear Regression

University

6 Qs

ILT-ML-03-AT

ILT-ML-03-AT

University

7 Qs

Machine Learning Quiz

Machine Learning Quiz

University

10 Qs

Session 5 | U

Session 5 | U

University

10 Qs

Untitled Quiz

Untitled Quiz

University

10 Qs

Log Regression

Log Regression

University

10 Qs

Linear Regression in Python – Quiz 1

Linear Regression in Python – Quiz 1

Assessment

Quiz

Computers

University

Medium

Created by

Emily Anne

Used 1+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main purpose of linear regression?

To classify data into categories

To cluster data into groups

To find a linear relationship between the features and the dependent variable

To reduce the dimensionality of data

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the .fit() method do in LinearRegression()?

Plots the regression line

Evaluates the model accuracy

Trains the model on the given data

Predicts values using the trained model

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function is used to make predictions once the model is trained?

model.evaluate()

model.transform()

model.predict()

model.prediction()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the coefficient (slope) of the regression line in a trained model?

model.bias_

model.weights_

model.coef_

model.slope_

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the model.intercept_ attribute represent?

The root mean square error

The slope of the regression line

The predicted value

The y-intercept of the regression line

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What metric is commonly used to evaluate the performance of a linear regression model?

Confusion Matrix

R-squared (R²) Score

F1 Score

Recall

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct way to visualize a simple linear regression result?

sns.heatmap()

plt.scatter() + plt.plot()

plt.hist()

sns.pairplot()

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will happen if the input features are not reshaped before fitting in scikit-learn (e.g., 1D array)?

Nothing, it will work

A warning will be shown

An error will occur because X must be 2D

The model will ignore the shape