Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
#%%
|
2 |
from matplotlib.pyplot import title
|
3 |
import tensorflow as tf
|
@@ -20,7 +21,7 @@ mytitles = ["Date Time","p (mbar)","T (degC)","Tpot (K)","Tdew (degC)","rh (%)",
|
|
20 |
df = pd.DataFrame(columns=mytitles)
|
21 |
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152
|
22 |
os.environ["CUDA_VISIBLE_DEVICES"] = ""
|
23 |
-
mybacklogmax =
|
24 |
|
25 |
if ("0" == ""):
|
26 |
uri = "https://storage.googleapis.com/tensorflow/tf-keras-datasets/jena_climate_2009_2016.csv.zip"
|
@@ -54,8 +55,8 @@ if ("0" != ""):
|
|
54 |
break
|
55 |
# df = adf.reindex(columns=mytitles)
|
56 |
# df = adf.reset_index()
|
57 |
-
df = adf.reindex(pd.RangeIndex(0, mybacklogmax).to_series())
|
58 |
-
st.write(pd.RangeIndex(0, mybacklogmax).to_series())
|
59 |
st.dataframe(df)
|
60 |
|
61 |
#%%
|
@@ -172,7 +173,7 @@ val_data = features.loc[train_split:]
|
|
172 |
start = past + future
|
173 |
end = start + train_split
|
174 |
|
175 |
-
x_train = train_data[[i for i in range(
|
176 |
y_train = features.iloc[start:end][[1]]
|
177 |
|
178 |
sequence_length = int(past / step)
|
@@ -180,7 +181,7 @@ x_end = len(val_data) - past - future
|
|
180 |
|
181 |
label_start = train_split + past + future
|
182 |
|
183 |
-
x_val = val_data.iloc[:x_end][[i for i in range(
|
184 |
y_val = features.iloc[label_start:][[1]]
|
185 |
|
186 |
dataset_val = keras.preprocessing.timeseries_dataset_from_array(
|
|
|
1 |
+
|
2 |
#%%
|
3 |
from matplotlib.pyplot import title
|
4 |
import tensorflow as tf
|
|
|
21 |
df = pd.DataFrame(columns=mytitles)
|
22 |
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152
|
23 |
os.environ["CUDA_VISIBLE_DEVICES"] = ""
|
24 |
+
mybacklogmax = 5
|
25 |
|
26 |
if ("0" == ""):
|
27 |
uri = "https://storage.googleapis.com/tensorflow/tf-keras-datasets/jena_climate_2009_2016.csv.zip"
|
|
|
55 |
break
|
56 |
# df = adf.reindex(columns=mytitles)
|
57 |
# df = adf.reset_index()
|
58 |
+
# df = adf.reindex(pd.RangeIndex(0, mybacklogmax).to_series())
|
59 |
+
# st.write(pd.RangeIndex(0, mybacklogmax).to_series())
|
60 |
st.dataframe(df)
|
61 |
|
62 |
#%%
|
|
|
173 |
start = past + future
|
174 |
end = start + train_split
|
175 |
|
176 |
+
x_train = train_data[[i for i in range(train_split)]].values
|
177 |
y_train = features.iloc[start:end][[1]]
|
178 |
|
179 |
sequence_length = int(past / step)
|
|
|
181 |
|
182 |
label_start = train_split + past + future
|
183 |
|
184 |
+
x_val = val_data.iloc[:x_end][[i for i in range(train_split)]].values
|
185 |
y_val = features.iloc[label_start:][[1]]
|
186 |
|
187 |
dataset_val = keras.preprocessing.timeseries_dataset_from_array(
|