Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -42,29 +42,22 @@ def predictPPM(df, split):
|
|
42 |
print(predictions)
|
43 |
|
44 |
#combine all into one table
|
45 |
-
ts_df=df
|
46 |
-
ts_df.rename(columns={'#PPM':'PPM'},inplace=True)
|
47 |
train= ts_df[:int (len(ts_df)*ttSplit)]
|
48 |
test= ts_df[int(len(ts_df)*ttSplit):]
|
49 |
|
50 |
df2['Date']=pd.to_datetime(df2['Date'])
|
51 |
df2.rename(columns={'#PPM':'PPM'},inplace=True)
|
52 |
-
df3=predictions
|
53 |
-
df2['origin']='
|
54 |
df3['origin']='prediction'
|
55 |
df4=pd.concat([df2, df3])
|
56 |
print(df4)
|
57 |
return df4
|
58 |
-
|
59 |
-
|
60 |
-
fn =predictPPM,inputs = [gr.Blocks(label="Input for the timeseries"),
|
61 |
gr.Slider(1, 100, value=75, step=1, label="Train test split percentage"),
|
62 |
],
|
63 |
-
outputs=
|
64 |
-
|
65 |
-
],
|
66 |
-
examples=[
|
67 |
-
[os.path.join(os.path.abspath(''), "datappm.csv"), 75],
|
68 |
-
]
|
69 |
)
|
70 |
-
demo.launch()
|
|
|
42 |
print(predictions)
|
43 |
|
44 |
#combine all into one table
|
45 |
+
ts_df=df
|
|
|
46 |
train= ts_df[:int (len(ts_df)*ttSplit)]
|
47 |
test= ts_df[int(len(ts_df)*ttSplit):]
|
48 |
|
49 |
df2['Date']=pd.to_datetime(df2['Date'])
|
50 |
df2.rename(columns={'#PPM':'PPM'},inplace=True)
|
51 |
+
df3= predictions
|
52 |
+
df2['origin']='status '
|
53 |
df3['origin']='prediction'
|
54 |
df4=pd.concat([df2, df3])
|
55 |
print(df4)
|
56 |
return df4
|
57 |
+
demo = gr.Interface(
|
58 |
+
fn =predictPPM,inputs = [gr.UploadButton(label="Input data for PPM TimeSeries"),
|
|
|
59 |
gr.Slider(1, 100, value=75, step=1, label="Train test split percentage"),
|
60 |
],
|
61 |
+
outputs=gr.LinePlot(x='Date', y='PPM', color='origin')
|
|
|
|
|
|
|
|
|
|
|
62 |
)
|
63 |
+
demo.launch(debug=True)
|