Skip to content

Commit df18cf5

Browse files
Julien RousselJulien Roussel
authored andcommitted
prints removed
1 parent b275de4 commit df18cf5

File tree

4 files changed

+3
-24
lines changed

4 files changed

+3
-24
lines changed

examples/benchmark.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,6 @@ In Qolmat, a few data imputation methods are implemented as well as a way to eva
1919

2020
First, import some useful librairies
2121

22-
```python
23-
X= np.array([[0], [1], [2]])
24-
```
25-
26-
```python
27-
np.cov(X)
28-
```
29-
30-
```python
31-
32-
```
33-
3422
```python
3523
import warnings
3624
# warnings.filterwarnings('error')
@@ -146,7 +134,7 @@ imputer_tsmle = imputers.ImputerEM(groups=("station",), model="VAR1", method="ml
146134

147135

148136
imputer_knn = imputers.ImputerKNN(groups=("station",), n_neighbors=10)
149-
imputer_mice = imputers.ImputerMICE(groups=("station",), estimator=LinearRegression(), sample_posterior=False, max_iter=100, missing_values=np.nan)
137+
imputer_mice = imputers.ImputerMICE(groups=("station",), estimator=LinearRegression(), sample_posterior=False, max_iter=100)
150138
imputer_regressor = imputers.ImputerRegressor(groups=("station",), estimator=LinearRegression())
151139
```
152140

@@ -388,7 +376,7 @@ dict_imputers["MLP"] = imputer_mlp = imputers_pytorch.ImputerRegressorPyTorch(es
388376
```
389377

390378
We can re-run the imputation model benchmark as before.
391-
```python jupyter={"outputs_hidden": true} tags=[]
379+
```python tags=[]
392380
generator_holes = missing_patterns.EmpiricalHoleGenerator(n_splits=2, groups=["station"], subset=cols_to_impute, ratio_masked=ratio_masked)
393381

394382
comparison = comparator.Comparator(
@@ -402,7 +390,7 @@ comparison = comparator.Comparator(
402390
results = comparison.compare(df_data)
403391
results
404392
```
405-
```python jupyter={"outputs_hidden": true, "source_hidden": true} tags=[]
393+
```python jupyter={"source_hidden": true} tags=[]
406394
df_plot = df_data
407395
dfs_imputed = {name: imp.fit_transform(df_plot) for name, imp in dict_imputers.items()}
408396
station = df_plot.index.get_level_values("station")[0]

qolmat/imputations/imputers.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,10 +1422,6 @@ def __init__(
14221422
self.handler_nan = handler_nan
14231423

14241424
def _fit_estimator(self, X, y) -> Self:
1425-
print("Xy")
1426-
print(X)
1427-
print(y)
1428-
14291425
return self.estimator.fit(X, y)
14301426

14311427
def _predict_estimator(self, X) -> pd.Series:

qolmat/imputations/imputers_pytorch.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,5 @@ def _predict_estimator(self, X: pd.DataFrame) -> pd.Series:
138138
input_data = torch.Tensor(X.values)
139139
output_data = self.estimator(input_data)
140140
pred = output_data.detach().numpy().flatten()
141-
print("pred")
142-
print(pred)
143141
return pd.Series(pred, index=X.index, dtype=float)
144142
assert AssertionError("Estimator is not provided.")

tests/imputations/test_imputers.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ def test_ImputerMICE_fit_transform(df: pd.DataFrame) -> None:
250250
def test_ImputerRegressor_fit_transform(df: pd.DataFrame) -> None:
251251
imputer = imputers.ImputerRegressor(estimator=ExtraTreesRegressor())
252252
result = imputer.fit_transform(df)
253-
print(result)
254253
expected = pd.DataFrame(
255254
{
256255
"col1": [0, 2, 2, 3, 2],
@@ -270,9 +269,7 @@ def test_ImputerRPCA_fit_transform(df: pd.DataFrame) -> None:
270269
"col2": [0, 1, 2, 2, 2] + [i for i in range(5, 20)],
271270
}
272271
)
273-
print(result)
274272
result = np.around(result)
275-
print(result)
276273
np.testing.assert_allclose(result, expected, atol=1e-2)
277274

278275

0 commit comments

Comments
 (0)