@@ -70,26 +70,26 @@ With just these few lines of code, you can see how easy it is to
70
70
from qolmat.utils import data
71
71
72
72
# load and prepare csv data
73
+
73
74
df_data = data.get_data(" Beijing" )
74
75
columns = [" TEMP" , " PRES" , " WSPM" ]
75
76
df_data = df_data[columns]
76
77
df_with_nan = data.add_holes(df_data, ratio_masked = 0.2 , mean_size = 120 )
77
78
78
79
# impute and compare
79
- imputer_mean = imputers.ImputerSimple(strategy = " mean " , groups = (" station" ,))
80
+ imputer_median = imputers.ImputerSimple(groups = (" station" ,))
80
81
imputer_interpol = imputers.ImputerInterpolation(method = " linear" , groups = (" station" ,))
81
82
imputer_var1 = imputers.ImputerEM(model = " VAR" , groups = (" station" ,), method = " mle" , max_iter_em = 50 , n_iter_ou = 15 , dt = 1e-3 , p = 1 )
82
83
dict_imputers = {
83
- " mean " : imputer_mean ,
84
+ " median " : imputer_median ,
84
85
" interpolation" : imputer_interpol,
85
86
" VAR(1) process" : imputer_var1
86
87
}
87
88
generator_holes = missing_patterns.EmpiricalHoleGenerator(n_splits = 4 , ratio_masked = 0.1 )
88
89
comparison = comparator.Comparator(
89
90
dict_imputers,
90
- columns,
91
91
generator_holes = generator_holes,
92
- metrics = [" mae" , " wmape" , " kl_columnwise" , " ks_test " , " energy " ],
92
+ metrics = [" mae" , " wmape" , " kl_columnwise" , " frechet " ],
93
93
)
94
94
results = comparison.compare(df_with_nan)
95
95
results.style.highlight_min(color = " lightsteelblue" , axis = 1 )
0 commit comments