From 9e5cb0393cfc226c4219ca6605a29d64c1be6287 Mon Sep 17 00:00:00 2001 From: AlbinahHlongo <54139357+AlbinahHlongo@users.noreply.github.com> Date: Wed, 15 Nov 2023 12:56:40 +0200 Subject: [PATCH 1/5] Create es5_rfr_model.pkl --- assets/trained-models/es5_rfr_model.pkl | 1 + 1 file changed, 1 insertion(+) create mode 100644 assets/trained-models/es5_rfr_model.pkl diff --git a/assets/trained-models/es5_rfr_model.pkl b/assets/trained-models/es5_rfr_model.pkl new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/assets/trained-models/es5_rfr_model.pkl @@ -0,0 +1 @@ + From 7bd0d4a34fd1bd9efc85af9aaf550e21faf5f7bb Mon Sep 17 00:00:00 2001 From: AlbinahHlongo <54139357+AlbinahHlongo@users.noreply.github.com> Date: Wed, 15 Nov 2023 12:58:24 +0200 Subject: [PATCH 2/5] Add files via upload --- assets/trained-models/es5_rfr_model.pkl | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/trained-models/es5_rfr_model.pkl b/assets/trained-models/es5_rfr_model.pkl index 8b137891..e69de29b 100644 --- a/assets/trained-models/es5_rfr_model.pkl +++ b/assets/trained-models/es5_rfr_model.pkl @@ -1 +0,0 @@ - From 6712edc54f9b6bda226d4110083fe38500a58cf3 Mon Sep 17 00:00:00 2001 From: AlbinahHlongo <54139357+AlbinahHlongo@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:22:31 +0200 Subject: [PATCH 3/5] Add files via upload --- assets/trained-models/Random_Forest_Reg_Model.pkl | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 assets/trained-models/Random_Forest_Reg_Model.pkl diff --git a/assets/trained-models/Random_Forest_Reg_Model.pkl b/assets/trained-models/Random_Forest_Reg_Model.pkl new file mode 100644 index 00000000..e69de29b From b8568b98154a4644aa8cf0ea38dc3debd8c6fe4a Mon Sep 17 00:00:00 2001 From: AlbinahHlongo Date: Wed, 15 Nov 2023 13:33:45 +0200 Subject: [PATCH 4/5] Your commit message here --- api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.py b/api.py index f822fbe2..6be527b9 100644 --- a/api.py +++ b/api.py @@ -30,7 +30,7 @@ # Load our model into memory. # Please update this path to reflect your own trained model. static_model = load_model( - path_to_model='assets/trained-models/load_shortfall_simple_lm_regression.pkl') + path_to_model='assets/trained-models/Random_Forest_Reg_Model.pkl') print ('-'*40) print ('Model successfully loaded') From b882b496e4358d8ec8ed2dabb023e2e7cd50df88 Mon Sep 17 00:00:00 2001 From: AlbinahHlongo Date: Wed, 15 Nov 2023 13:53:20 +0200 Subject: [PATCH 5/5] Model features --- model.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/model.py b/model.py index 42f73063..79aa858c 100644 --- a/model.py +++ b/model.py @@ -48,6 +48,21 @@ def _preprocess_data(data): feature_vector_dict = json.loads(data) # Load the dictionary as a Pandas DataFrame. feature_vector_df = pd.DataFrame.from_dict([feature_vector_dict]) + new_features = ['Unnamed: 0', 'Madrid_wind_speed', 'Bilbao_rain_1h', + 'Valencia_wind_speed', 'Seville_humidity', 'Madrid_humidity', + 'Bilbao_clouds_all', 'Bilbao_wind_speed', 'Seville_clouds_all', + 'Bilbao_wind_deg', 'Barcelona_wind_speed', 'Barcelona_wind_deg', + 'Madrid_clouds_all', 'Seville_wind_speed', 'Barcelona_rain_1h', + 'Seville_rain_1h', 'Bilbao_snow_3h', 'Barcelona_pressure', + 'Seville_rain_3h', 'Madrid_rain_1h', 'Barcelona_rain_3h', + 'Valencia_snow_3h', 'Madrid_weather_id', 'Barcelona_weather_id', + 'Bilbao_pressure', 'Seville_weather_id', 'Seville_temp_max', + 'Madrid_pressure', 'Valencia_temp_max', 'Valencia_temp', + 'Bilbao_weather_id', 'Seville_temp', 'Valencia_humidity', + 'Valencia_temp_min', 'Barcelona_temp_max', 'Madrid_temp_max', + 'Barcelona_temp', 'Bilbao_temp_min', 'Bilbao_temp', + 'Barcelona_temp_min', 'Bilbao_temp_max', 'Seville_temp_min', + 'Madrid_temp', 'Madrid_temp_min'] # --------------------------------------------------------------- # NOTE: You will need to swap the lines below for your own data @@ -58,7 +73,7 @@ def _preprocess_data(data): # --------------------------------------------------------------- # ----------- Replace this code with your own preprocessing steps -------- - predict_vector = feature_vector_df[['Madrid_wind_speed','Bilbao_rain_1h','Valencia_wind_speed']] + predict_vector = feature_vector_df[new_features] # ------------------------------------------------------------------------ return predict_vector