Spaces:
Sleeping
Sleeping
api test
Browse files- app.py +8 -4
- scalerNO2_features.pkl +3 -0
- scalerNO2.pkl → scalerNO2_targets.pkl +0 -0
- scalerO3_features.pkl +3 -0
- scalerO3_targets.pkl +3 -0
app.py
CHANGED
|
@@ -22,17 +22,21 @@ metric = st.selectbox("Select the metric for prediction", ["O₃", "NO₂"])
|
|
| 22 |
|
| 23 |
fitted_pcaO3 = pk.load(open("pcaO3.pkl",'rb'))
|
| 24 |
fitted_pcaNO2 = pk.load(open("pcaNO2.pkl",'rb'))
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
def get_weather_data():
|
| 29 |
|
| 30 |
downloaded_data = download_data()
|
| 31 |
data = preprocess_function(downloaded_data)
|
| 32 |
if metric == "O₃":
|
| 33 |
-
fe_pip = FeatureEngineeringPredict(data, fitted_pcaO3,
|
| 34 |
else:
|
| 35 |
-
fe_pip = FeatureEngineeringPredict(data, fitted_pcaNO2,
|
| 36 |
|
| 37 |
selected_features = ['MWD', 'MWS', 'WG', 'T', 'TD', 'SD', 'GR']
|
| 38 |
n_steps = 3
|
|
|
|
| 22 |
|
| 23 |
fitted_pcaO3 = pk.load(open("pcaO3.pkl",'rb'))
|
| 24 |
fitted_pcaNO2 = pk.load(open("pcaNO2.pkl",'rb'))
|
| 25 |
+
|
| 26 |
+
fitted_scalerO3_features = pk.load(open("scalerO3_features.pkl",'rb'))
|
| 27 |
+
fitted_scalerNO2_features = pk.load(open("scalerNO2_features.pkl",'rb'))
|
| 28 |
+
|
| 29 |
+
fitted_scalerO3_targets = pk.load(open("scalerO3_targets.pkl",'rb'))
|
| 30 |
+
fitted_scalerNO2_targets = pk.load(open("scalerNO2_targets.pkl",'rb'))
|
| 31 |
|
| 32 |
def get_weather_data():
|
| 33 |
|
| 34 |
downloaded_data = download_data()
|
| 35 |
data = preprocess_function(downloaded_data)
|
| 36 |
if metric == "O₃":
|
| 37 |
+
fe_pip = FeatureEngineeringPredict(data, fitted_pcaO3, fitted_scalerO3_features)
|
| 38 |
else:
|
| 39 |
+
fe_pip = FeatureEngineeringPredict(data, fitted_pcaNO2, fitted_scalerNO2_features)
|
| 40 |
|
| 41 |
selected_features = ['MWD', 'MWS', 'WG', 'T', 'TD', 'SD', 'GR']
|
| 42 |
n_steps = 3
|
scalerNO2_features.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cba8f82de5de589beef9d222474d9eb3e602fea3b1d15e21fb13a9cab6b2e8dd
|
| 3 |
+
size 1601
|
scalerNO2.pkl → scalerNO2_targets.pkl
RENAMED
|
File without changes
|
scalerO3_features.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cba8f82de5de589beef9d222474d9eb3e602fea3b1d15e21fb13a9cab6b2e8dd
|
| 3 |
+
size 1601
|
scalerO3_targets.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81a5397d50cdae7675e41589f86aaa06ae545e864641458d344107ee15f95f35
|
| 3 |
+
size 521
|