Linear Regression in Python – Quiz 1

Linear Regression in Python – Quiz 1

University

8 Qs

quiz-placeholder

Similar activities

Web Designing Quiz-2

Web Designing Quiz-2

University

10 Qs

Operating System - Chapter 1-1

Operating System - Chapter 1-1

University

10 Qs

Server Administration- Quiz 1

Server Administration- Quiz 1

12th Grade - University

10 Qs

Computer Science (1-9) - Identifying & Preventing Threats

Computer Science (1-9) - Identifying & Preventing Threats

University

11 Qs

Computer Science: CPU performance

Computer Science: CPU performance

University

13 Qs

Recording Software Button Identification Quiz

Recording Software Button Identification Quiz

8th Grade - University

10 Qs

Computer Hardware foundation degree 1

Computer Hardware foundation degree 1

University

12 Qs

Internet

Internet

University

11 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