Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -122,7 +122,7 @@ def draw_map_customize(longitude,latitude, fig_id='test',fig_extension='png' ):
|
|
122 |
|
123 |
plt.legend(fontsize=16)
|
124 |
save_fig(fig_id)
|
125 |
-
plt.show()
|
126 |
|
127 |
path = os.path.join(IMAGES_PATH, fig_id + "." + fig_extension)
|
128 |
return path
|
@@ -133,14 +133,14 @@ def get_sample_data(num_data):
|
|
133 |
sample_data = []
|
134 |
for i in range(num_data):
|
135 |
samp = housing.sample(1)
|
136 |
-
longitude = samp['longitude'].values[0]
|
137 |
-
latitude = samp['latitude'].values[0]
|
138 |
-
housing_median_age = samp['housing_median_age'].values[0]
|
139 |
-
total_rooms = samp['total_rooms'].values[0]
|
140 |
-
total_bedrooms = samp['total_bedrooms'].values[0]
|
141 |
-
population = samp['population'].values[0]
|
142 |
-
households = samp['households'].values[0]
|
143 |
-
median_income = samp['median_income'].values[0]
|
144 |
|
145 |
sample_data.append([longitude,latitude,housing_median_age,total_rooms,total_bedrooms,population,households,median_income])
|
146 |
return sample_data
|
@@ -174,6 +174,7 @@ def predict_price(longitude,latitude,housing_median_age,total_rooms,total_bedroo
|
|
174 |
|
175 |
return pred,map_file
|
176 |
|
|
|
177 |
### configure inputs/outputs
|
178 |
|
179 |
|
|
|
122 |
|
123 |
plt.legend(fontsize=16)
|
124 |
save_fig(fig_id)
|
125 |
+
#plt.show()
|
126 |
|
127 |
path = os.path.join(IMAGES_PATH, fig_id + "." + fig_extension)
|
128 |
return path
|
|
|
133 |
sample_data = []
|
134 |
for i in range(num_data):
|
135 |
samp = housing.sample(1)
|
136 |
+
longitude = float(samp['longitude'].values[0])
|
137 |
+
latitude = float(samp['latitude'].values[0])
|
138 |
+
housing_median_age = float(samp['housing_median_age'].values[0])
|
139 |
+
total_rooms = float(samp['total_rooms'].values[0])
|
140 |
+
total_bedrooms = float(samp['total_bedrooms'].values[0])
|
141 |
+
population = float(samp['population'].values[0])
|
142 |
+
households = float(samp['households'].values[0])
|
143 |
+
median_income = float(samp['median_income'].values[0])
|
144 |
|
145 |
sample_data.append([longitude,latitude,housing_median_age,total_rooms,total_bedrooms,population,households,median_income])
|
146 |
return sample_data
|
|
|
174 |
|
175 |
return pred,map_file
|
176 |
|
177 |
+
|
178 |
### configure inputs/outputs
|
179 |
|
180 |
|