@@ -70,26 +70,26 @@ With just these few lines of code, you can see how easy it is to
7070 from qolmat.utils import data
7171
7272 # load and prepare csv data
73+
7374 df_data = data.get_data(" Beijing" )
7475 columns = [" TEMP" , " PRES" , " WSPM" ]
7576 df_data = df_data[columns]
7677 df_with_nan = data.add_holes(df_data, ratio_masked = 0.2 , mean_size = 120 )
7778
7879 # impute and compare
79- imputer_mean = imputers.ImputerSimple(strategy = " mean " , groups = (" station" ,))
80+ imputer_median = imputers.ImputerSimple(groups = (" station" ,))
8081 imputer_interpol = imputers.ImputerInterpolation(method = " linear" , groups = (" station" ,))
8182 imputer_var1 = imputers.ImputerEM(model = " VAR" , groups = (" station" ,), method = " mle" , max_iter_em = 50 , n_iter_ou = 15 , dt = 1e-3 , p = 1 )
8283 dict_imputers = {
83- " mean " : imputer_mean ,
84+ " median " : imputer_median ,
8485 " interpolation" : imputer_interpol,
8586 " VAR(1) process" : imputer_var1
8687 }
8788 generator_holes = missing_patterns.EmpiricalHoleGenerator(n_splits = 4 , ratio_masked = 0.1 )
8889 comparison = comparator.Comparator(
8990 dict_imputers,
90- columns,
9191 generator_holes = generator_holes,
92- metrics = [" mae" , " wmape" , " kl_columnwise" , " ks_test " , " energy " ],
92+ metrics = [" mae" , " wmape" , " kl_columnwise" , " frechet " ],
9393 )
9494 results = comparison.compare(df_with_nan)
9595 results.style.highlight_min(color = " lightsteelblue" , axis = 1 )
0 commit comments