Spaces:
Runtime error
Runtime error
Commit
•
1f86947
1
Parent(s):
ada5e88
Update app.py
Browse files
app.py
CHANGED
@@ -61,23 +61,23 @@ def greet(total_pred_days):
|
|
61 |
X = X.rename(columns={'pressure':'sealevelpressure'})
|
62 |
|
63 |
# Merge X and query
|
64 |
-
Y = X.append(Q, ignore_index=True)
|
65 |
|
66 |
# Data scaling
|
67 |
-
|
68 |
category_cols = ['conditions']
|
69 |
cat_std_cols = ['feelslikemax','feelslikemin','feelslike','dew','humidity','precip','precipprob','precipcover','snow','snowdepth','windgust','windspeed','winddir','sealevelpressure','cloudcover','visibility','solarradiation','solarenergy','uvindex']
|
70 |
scaler_std = proc.StandardScaler()
|
71 |
-
|
72 |
-
|
73 |
|
74 |
-
|
75 |
-
|
76 |
|
77 |
# Predict
|
78 |
-
preds = model.predict(
|
79 |
-
preds1= model1.predict(
|
80 |
-
preds2= model2.predict(
|
81 |
|
82 |
for x in range(count):
|
83 |
if (x != 0):
|
@@ -90,14 +90,14 @@ def greet(total_pred_days):
|
|
90 |
project = hopsworks.login()
|
91 |
mr=project.get_model_registry()
|
92 |
|
93 |
-
fs = project.get_feature_store()
|
94 |
-
weather_fg = fs.get_or_create_feature_group(
|
95 |
-
|
96 |
-
|
97 |
-
)
|
98 |
-
|
99 |
-
query = weather_fg.select_all()
|
100 |
-
Q = query.read()
|
101 |
|
102 |
model = mr.get_model("temp_model_new", version=1)
|
103 |
model_dir=model.download()
|
|
|
61 |
X = X.rename(columns={'pressure':'sealevelpressure'})
|
62 |
|
63 |
# Merge X and query
|
64 |
+
#Y = X.append(Q, ignore_index=True)
|
65 |
|
66 |
# Data scaling
|
67 |
+
X = X.drop(columns = ['conditions', 'name', "datetime", "temp", "tempmax", "tempmin"])
|
68 |
category_cols = ['conditions']
|
69 |
cat_std_cols = ['feelslikemax','feelslikemin','feelslike','dew','humidity','precip','precipprob','precipcover','snow','snowdepth','windgust','windspeed','winddir','sealevelpressure','cloudcover','visibility','solarradiation','solarenergy','uvindex']
|
70 |
scaler_std = proc.StandardScaler()
|
71 |
+
X.insert(19,"conditions",0)
|
72 |
+
X.insert(0,"name",0)
|
73 |
|
74 |
+
X[cat_std_cols] = scaler_std.fit_transform(X[cat_std_cols])
|
75 |
+
X[category_cols] = scaler_std.fit_transform(X[category_cols])
|
76 |
|
77 |
# Predict
|
78 |
+
preds = model.predict(X[0:count])
|
79 |
+
preds1= model1.predict(X[0:count])
|
80 |
+
preds2= model2.predict(X[0:count])
|
81 |
|
82 |
for x in range(count):
|
83 |
if (x != 0):
|
|
|
90 |
project = hopsworks.login()
|
91 |
mr=project.get_model_registry()
|
92 |
|
93 |
+
# fs = project.get_feature_store()
|
94 |
+
# weather_fg = fs.get_or_create_feature_group(
|
95 |
+
# name = 'weather_fg',
|
96 |
+
# version = 1
|
97 |
+
# )
|
98 |
+
#
|
99 |
+
# query = weather_fg.select_all()
|
100 |
+
# Q = query.read()
|
101 |
|
102 |
model = mr.get_model("temp_model_new", version=1)
|
103 |
model_dir=model.download()
|