padmapriya commited on
Commit
e98438a
·
1 Parent(s): 3d00de1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,7 +2,7 @@ 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("/content/bara shigiri - Copy.xlsx")
6
  x=data.iloc[:,1:].values
7
  y=data.iloc[:,0].values
8
  np.reshape(y,(-1,1))
@@ -11,15 +11,15 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
11
  X_train, X_test, y_train, y_test = train_test_split(x,y,test_size=0.33,random_state=42)
12
  reg=LinearRegression().fit(X_train,y_train)
13
  eqn="-1.50608097*(x1) +(10.05272793)*(x2) +(-10.52662062)*(x3) +336.60218769*(x4) +(-23.82408478)*(x5) +12129.976853563849"
14
- #y_pred=reg.predict([[co2_emission,no2_emission,so2_emission,global_warming,methane_emission]])
15
 
16
  if(year>=2023):
17
- return eqn
18
 
19
  demo = gr.Interface(
20
  fn=greet,
21
- inputs=['number'],
22
- outputs=['text'],
23
  title="BARA SHIGRI",
24
  description="Bara Shigri feeds the Chandra River which after its confluence at Tandi with the Bhaga River is known as Chandrabhaga or Chenab."
25
  "According to Hugh Whistler’s 1924 writing, Shigri is applied par-excellence to one particular glacier that emerges from the mountains on the left bank of the Chenab. It is said to be several miles long, and the snout reaches right down to the river, lying athwart the customary road from Kulu to Spiti... In 1836 this glacier dammed the Chenab River, causing the formation of a large lake, which eventually broke loose and carried devastation down the valley."
 
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
8
  np.reshape(y,(-1,1))
 
11
  X_train, X_test, y_train, y_test = train_test_split(x,y,test_size=0.33,random_state=42)
12
  reg=LinearRegression().fit(X_train,y_train)
13
  eqn="-1.50608097*(x1) +(10.05272793)*(x2) +(-10.52662062)*(x3) +336.60218769*(x4) +(-23.82408478)*(x5) +12129.976853563849"
14
+ y_pred=reg.predict([[co2_emission,no2_emission,so2_emission,global_warming,methane_emission]])
15
 
16
  if(year>=2023):
17
+ return eqn,y_pred
18
 
19
  demo = gr.Interface(
20
  fn=greet,
21
+ inputs=['number','number','number','number','number','number'],
22
+ outputs=['text','number'],
23
  title="BARA SHIGRI",
24
  description="Bara Shigri feeds the Chandra River which after its confluence at Tandi with the Bhaga River is known as Chandrabhaga or Chenab."
25
  "According to Hugh Whistler’s 1924 writing, Shigri is applied par-excellence to one particular glacier that emerges from the mountains on the left bank of the Chenab. It is said to be several miles long, and the snout reaches right down to the river, lying athwart the customary road from Kulu to Spiti... In 1836 this glacier dammed the Chenab River, causing the formation of a large lake, which eventually broke loose and carried devastation down the valley."