Linear Regression Flashcards

1
Q

Types of regression

A

Simple linear regression
Multiple linear regression
Ridge regression
Logistic regression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What type of model is linear regression

A

Linear regression is one of the regressive prediction model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

type of output of linear regression model

A

This model gives the output in a continuous value format (-∞ to ∞)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Linear regression model is supervised/ unsupervised learning model

A

supervised learning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Linear regression model is used to ______

A

Linear regression model is used to calculate the unknown value based on the known value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Regression definition
general equation

A

Regression is statistical technique used to model the relationship b/w the dependent variable and independent variable (one or more)
y = f(x, θ)
here θ denotes the set of parameters of the models i.e. m₁, m₂…mₙ, c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Types of linear regression

A

Simple linear regression
Multiple linear regression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Simple linear regression (definition)

A

This regression shows the relationship between the dependent variable and one independent variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is used to make prediction in simple linear regression

A

Straight line equation is used as best fit line to make prediction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

equation used in simple linear regression

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Multiple linear regression (definition)

A

This regression model shows the relationship between the dependent variable and 2 or more independent variables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is used to make prediction in multiple linear regression

A

predicted best fit line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Goal of linear regression

A

Goal of a linear regression is to find out the best fit line which minimises the error between the predicted output and actual output based on the historical data (training data set).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Another name of error (2)

A

Cost function or residual

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Assumptions in linear regression

A

1.) Linearity
2.) Homoscedasticity
3.) No multicolinearity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Linearity

A

Data points are represented in the scatter plot in a linear order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Homoscedasticity (and also opposite of Homoscedasticity)

A

Homoscedasticity: Distance between the data points in the scatter plot is less

18
Q

No multicolinearity
(Also explain multicollinearity)

A

All the i/p variable or attributes are independent in the data set.

Multicolinearity means interdependency between the i/p variables.
Ex: x1 ∝ x2 (directly proportional)
Here no need to train the model with x1 and x2 attributes because Both are dependent. So drop any one attribute to make the independent attributes in the data set.

19
Q

How we know this as best fit line

A

We use the prefromance matrics to calculate the error.
If the error is low then fix the line as best fit line

20
Q

Slop of best fit line

A

slope(m) = Δy / Δx

21
Q

Graph of best fit line

A
22
Q

What is performance metrics

A

A system or standard of measurement

23
Q

Types of performance metrics

A

1.) R² measure
2.) Adjusted R² measure
3.) Mean square error (MSE)
4.) Root mean square error (RMSE)
5.) Mean absolute error (MAE)
6.) Mean absolute percentage error (MAPE)

24
Q

R² measure formula

A
25
Q

R² range

A

[0 to 1]

26
Q

Two special points about R²

A

If R² value is 1 means no error (error is zero) in the model. 100% accuracy.
If R² value is close to zero then more errors are present in model. Error is high. Re-training required.

27
Q

Adjusted R² measure

A
28
Q

SSE

A

sum of square error

29
Q

MSE

A

MSE : Mean square Error

30
Q

RMSE

A

RMSE: Root mean square error
RMSE = sqrt(MSE)

31
Q

MAE

A

MAE: Mean absolute error

32
Q

MAPE

A

MAPE: Mean absolute percentage error
MAPE = MAE * 100

33
Q

How to calculate m and c in straight line equation which is best prediction line of simple linear regression

A

2 methods are used to calculate m and c
1.) Straight line method
2.) Ordinary least square method

34
Q

regression coefficient

A

m (slope)

35
Q

Straight line method

A
36
Q

Compare straight line method and ordinary least square method

A

In the straight line method, we considered only the first and last sample to calculate the slope. Therefore most is food for 1st and last samples only and bad for the rest of the samples.
So, alternative required i.e.ordinary least square method. This take the mean value of all the data points to give the best prediction.

37
Q

m and c in terms of mean

A

ȳ = m.x̄ - c

38
Q

Ordinary least square method

A

m = covariance(x,y)/var(x)
c = ȳ - m.x̄

39
Q

Which equation uses multiple linear regression

A

B = (XᵀX)⁻¹XᵀY

40
Q

How to find multiple linear regression
(Explain whole method)

A