@@ -145,20 +145,20 @@ imputer_regressor = imputers.ImputerRegressor(groups=["station"], estimator=Line
145145
146146dict_imputers = {
147147 " mean" : imputer_mean,
148- # "median": imputer_median,
148+ " median" : imputer_median,
149149 # "mode": imputer_mode,
150150 " interpolation" : imputer_interpol,
151151 # "spline": imputer_spline,
152- # "shuffle": imputer_shuffle,
152+ " shuffle" : imputer_shuffle,
153153 # "residuals": imputer_residuals,
154154 # "OU": imputer_ou,
155- # "TSOU": imputer_tsou,
156- # "TSMLE": imputer_tsmle,
155+ " TSOU" : imputer_tsou,
156+ " TSMLE" : imputer_tsmle,
157157 # "RPCA": imputer_rpca,
158- # "RPCA_opti": imputer_rpca_opti,
158+ " RPCA_opti" : imputer_rpca_opti,
159159 # "locf": imputer_locf,
160160 # "nocb": imputer_nocb,
161- # "knn": imputer_knn,
161+ " knn" : imputer_knn,
162162 " ols" : imputer_regressor,
163163 # "mice_ols": imputer_mice,
164164}
@@ -207,6 +207,21 @@ plt.bar(df_plot.index, df_plot, color=tab10(0))
207207plt.show()
208208```
209209
210+ ``` python
211+ fig = plt.figure(figsize = (16 , 6 ))
212+ fig.add_subplot(1 , 2 , 1 )
213+ df_plot = results.loc[" mae" ].mean().sort_values(ascending = False )
214+ plt.barh(df_plot.index, df_plot, color = [tab10(0 ) if i< n_imputers- 1 else " red" for i in range (n_imputers)])
215+ plt.xlabel(" Erreur MAE" )
216+ # plt.show()
217+
218+ fig.add_subplot(1 , 2 , 2 )
219+ df_plot = results.loc[" energy" ].mean().sort_values(ascending = False )
220+ plt.barh(df_plot.index, df_plot, color = [tab10(0 ) if i< n_imputers- 1 else " red" for i in range (n_imputers)])
221+ plt.xlabel(" Erreur énergétique" )
222+ plt.show()
223+ ```
224+
210225``` python
211226fig = plt.figure(figsize = (24 , 8 ))
212227fig.add_subplot(2 , 1 , 1 )
@@ -247,8 +262,9 @@ for col in cols_to_impute:
247262 values_orig = df_station[col]
248263
249264 plt.plot(values_orig, " ." , color = ' black' , label = " original" )
250-
251265 for ind, (name, model) in enumerate (list (dict_imputers.items())):
266+ if name not in [" mean" , " TSMLE" ]:
267+ continue
252268 values_imp = dfs_imputed_station[name][col].copy()
253269 values_imp[values_orig.notna()] = np.nan
254270 plt.plot(values_imp, " ." , color = tab10(ind), label = name, alpha = 1 )
0 commit comments