MULTIPLE REGRESSION

What is multiple regression analysis?


Multiple regression analysis is a statistical technique that analyzes the relationship between two or more variables and uses the information to estimate the value of the dependent variables. In multiple regression, the objective is to develop a model that describes a dependent variable y to more than one independent variable.

                                                  


S:OURCE CODE


import pandas


from sklearn import linear_model


df = pandas.read_csv("data.csv")


X = df[['Weight', 'Volume']]

y = df['CO2']


regr = linear_model.LinearRegression()

regr.fit(X, y)


#predict the CO2 emission of a car where the weight is 2300kg, and the volume is 1300cm3:

predictedCO2 = regr.predict([[2300, 1300]])


print(predictedCO2)


OUTPUT


[107.289544]


[107.2087328]

[107.2087328]

[107.2087328]