Skip to content

Commit 3701fb0

Browse files
Julien RousselJulien Roussel
authored andcommitted
logs removed
1 parent 8dca42e commit 3701fb0

File tree

4 files changed

+7
-26
lines changed

4 files changed

+7
-26
lines changed

examples/benchmark.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ imputer_mice = imputers.ImputerMICE(groups=("station",), estimator=LinearRegress
138138
imputer_regressor = imputers.ImputerRegressor(groups=("station",), estimator=LinearRegression())
139139
```
140140

141-
```python
142-
imputer_rpca.fit_transform(df_data)
143-
```
144-
145141
```python
146142
generator_holes = missing_patterns.EmpiricalHoleGenerator(n_splits=2, groups=("station",), subset=cols_to_impute, ratio_masked=ratio_masked)
147143
```
@@ -160,10 +156,9 @@ imputer_rpca_opti = hyperparameters.optimize(
160156
max_evals=10,
161157
dict_spaces=dict_config_opti
162158
)
163-
# imputer_rpca_opti.params_optim = hyperparams_opti
164159
```
165160

166-
```python
161+
```python jupyter={"source_hidden": true}
167162
dict_config_opti2 = {
168163
"tau/TEMP": ho.hp.uniform("tau/TEMP", low=.5, high=5),
169164
"tau/PRES": ho.hp.uniform("tau/PRES", low=.5, high=5),
@@ -194,7 +189,7 @@ dict_imputers = {
194189
"TSOU": imputer_tsou,
195190
"TSMLE": imputer_tsmle,
196191
"RPCA": imputer_rpca,
197-
# "RPCA_opti": imputer_rpca_opti,
192+
"RPCA_opti": imputer_rpca_opti,
198193
# "RPCA_opti2": imputer_rpca_opti2,
199194
# "locf": imputer_locf,
200195
# "nocb": imputer_nocb,
@@ -230,7 +225,7 @@ results = comparison.compare(df_data)
230225
results
231226
```
232227

233-
```python
228+
```python jupyter={"source_hidden": true}
234229
df_plot = results.loc["KL_columnwise",'TEMP']
235230
plt.barh(df_plot.index, df_plot, color=tab10(0))
236231
plt.title('TEMP')
@@ -251,8 +246,8 @@ plot.multibar(results.loc["mae"], decimals=1)
251246
plt.ylabel("mae")
252247

253248
fig.add_subplot(2, 1, 2)
254-
plot.multibar(results.loc["KL_columnwise"], decimals=1)
255-
plt.ylabel("KL")
249+
plot.multibar(results.loc["dist_corr_pattern"], decimals=1)
250+
plt.ylabel("dist_corr_pattern")
256251

257252
plt.savefig("figures/imputations_benchmark_errors.png")
258253
plt.show()
@@ -300,10 +295,6 @@ for col in cols_to_impute:
300295

301296
```
302297

303-
```python
304-
dfs_imputed
305-
```
306-
307298
```python
308299
# plot.plot_imputations(df_station, dfs_imputed_station)
309300

qolmat/benchmark/hyperparameters.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import copy
2-
import logging
32
from typing import Any, Callable, Dict, List, Union
43

54
import numpy as np
@@ -13,9 +12,6 @@
1312

1413
from qolmat.benchmark.missing_patterns import _HoleGenerator
1514

16-
logger = logging.getLogger(__name__)
17-
logger.setLevel(logging.DEBUG)
18-
1915
HyperValue = Union[int, float, str]
2016

2117

@@ -39,7 +35,6 @@ def fun_obf(args: List[HyperValue]) -> float:
3935
df_origin = df.copy()
4036
df_corrupted = df_origin.copy()
4137
df_corrupted[df_mask] = np.nan
42-
4338
df_imputed = imputer.fit_transform(df_corrupted)
4439
subset = generator.subset
4540
fun_metric = metrics.get_metric(metric)

qolmat/benchmark/missing_patterns.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

33
import functools
4-
import logging
54
from typing import Callable, List, Optional, Tuple, Union
5+
import warnings
66

77
import numpy as np
88
import pandas as pd
@@ -11,8 +11,6 @@
1111

1212
from qolmat.utils.exceptions import NoMissingValue, SubsetIsAString
1313

14-
logger = logging.getLogger(__name__)
15-
1614

1715
def compute_transition_counts_matrix(states: pd.Series):
1816
if isinstance(states.iloc[0], tuple):
@@ -305,7 +303,7 @@ def generate_mask(self, X: pd.DataFrame) -> pd.DataFrame:
305303
break
306304

307305
if list_failed:
308-
logger.warning(f"No place to introduce sampled holes of size {list_failed}!")
306+
warnings.warn(f"No place to introduce sampled holes of size {list_failed}!")
309307
return mask
310308

311309

qolmat/imputations/em_sampler.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import logging
21
from typing import Dict, List, Literal, Optional, Union
32
from warnings import WarningMessage
43

@@ -12,8 +11,6 @@
1211

1312
from qolmat.utils import utils
1413

15-
logger = logging.getLogger(__name__)
16-
1714

1815
def _gradient_conjugue(A: NDArray, X: NDArray, mask_na: NDArray) -> NDArray:
1916
"""

0 commit comments

Comments
 (0)