From 8b1c080a214415dfc450e96bc100bcfb019e0727 Mon Sep 17 00:00:00 2001
From: "Gokkul.M" <144870543+Gokkul-M@users.noreply.github.com>
Date: Wed, 3 Jan 2024 07:30:29 +0530
Subject: [PATCH] Update README.md
---
README.md | 43 ++++++++++++++++++++++---------------------
1 file changed, 22 insertions(+), 21 deletions(-)
diff --git a/README.md b/README.md
index 18362d83..633ad138 100644
--- a/README.md
+++ b/README.md
@@ -6,34 +6,35 @@ To write a python program to implement multivariate linear regression and predic
2. Anaconda – Python 3.7 Installation / Moodle-Code Runner
## Algorithm:
### Step1
-
-
+import pandas as pd.
### Step2
-
-
+Read the csv file.
### Step3
-
-
+Get the value of X and y variables.
### Step4
-
-
+Create the linear regression model and fit.
### Step5
-
-
+Predict the CO2 emission of a car where the weight is 2300kg, and the volume is 1300cm cube.
## Program:
```
-
-
-
-
-
-
+import pandas as pd
+from sklearn import linear_model
+df = pd.read_csv("carsemission.csv")
+X = df[['Weight', 'Volume']]
+y = df['CO2']
+regr = linear_model.LinearRegression()
+regr.fit(X, y)
+print('Coefficients:', regr.coef_)
+print('Intercept:',regr.intercept_)
+predictedCO2 = regr.predict([[3300, 1300]])
+print('Predicted CO2 for the corresponding weight and volume',predictedCO2)
```
## Output:
-
-### Insert your output
-
-
+
+Insert your output
+Coefficient: [0.00755095 0.00780526]
+Intercept: 79.69471929115939
+Predicted CO@ for the corresponding weight and volume [114.75968007]
## Result
-Thus the multivariate linear regression is implemented and predicted the output using python program.
\ No newline at end of file
+Thus the multivariate linear regression is implemented and predicted the output using python program.