Spaces:
Sleeping
Sleeping
padmapriya commited on
Commit ·
a5a3946
1
Parent(s): 0792e25
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,32 @@ import numpy as np
|
|
| 2 |
import pandas as pd
|
| 3 |
import gradio as gr
|
| 4 |
def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emission):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
data=pd.read_excel("bara shigiri - Copy.xlsx")
|
| 6 |
x=data.iloc[:,1:].values
|
| 7 |
y=data.iloc[:,0].values
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import gradio as gr
|
| 4 |
def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emission):
|
| 5 |
+
|
| 6 |
+
#1996
|
| 7 |
+
|
| 8 |
+
#data collection
|
| 9 |
+
data1=pd.read_excel("/content/FINAL_DATASET.xlsx")
|
| 10 |
+
df1 = data1.drop(['YEAR'], axis=1)
|
| 11 |
+
|
| 12 |
+
#data indexing
|
| 13 |
+
x=df1.iloc[:,1:].values
|
| 14 |
+
y=df1.iloc[:,0].values
|
| 15 |
+
np.reshape(y,(-1,1))
|
| 16 |
+
|
| 17 |
+
#split the dataset
|
| 18 |
+
from sklearn.model_selection import train_test_split
|
| 19 |
+
X_train, X_test, y_train, y_test = train_test_split(
|
| 20 |
+
x, y, test_size=0.33, random_state=42)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
#traing the dataset
|
| 24 |
+
from sklearn.linear_model import LinearRegression
|
| 25 |
+
reg = LinearRegression().fit(X_train, y_train)
|
| 26 |
+
y_pred1=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
|
| 27 |
+
|
| 28 |
+
#Equation
|
| 29 |
+
total1="2.29209688*(x1)+(-17.24834114)*(x2)+(-34.46449984)*(x3)+441.88734541(x4)+(-10.5704468)*(x5)+3032.3276611889232"
|
| 30 |
+
|
| 31 |
data=pd.read_excel("bara shigiri - Copy.xlsx")
|
| 32 |
x=data.iloc[:,1:].values
|
| 33 |
y=data.iloc[:,0].values
|