Skip to content

Commit 2c87415

Browse files
Julien RousselJulien Roussel
authored andcommitted
notebooks cleaned
1 parent d318463 commit 2c87415

File tree

10 files changed

+13
-510
lines changed

10 files changed

+13
-510
lines changed

examples/RPCA.md

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.3'
9-
jupytext_version: 1.14.5
9+
jupytext_version: 1.14.4
1010
kernelspec:
1111
display_name: Python 3 (ipykernel)
1212
language: python
@@ -74,7 +74,7 @@ plt.show()
7474

7575
```python
7676
%%time
77-
rpca_pcp = RPCAPCP(period=100, max_iter=5, mu=.5, lam=1)
77+
rpca_pcp = RPCAPCP(period=100, max_iterations=5, mu=.5, lam=1)
7878
X, A = rpca_pcp.decompose_rpca_signal(signal)
7979
imputed = signal - A
8080
```
@@ -102,52 +102,3 @@ plt.plot(imputed)
102102
```python
103103

104104
```
105-
106-
```python
107-
%%time
108-
signal_toy = np.array([[1, 2], [np.nan, np.nan]])
109-
rpca_noisy = RPCANoisy(tau=0, lam=1, norm="L2", do_report=True)
110-
X, A = rpca_noisy.decompose_rpca_signal(signal_toy)
111-
```
112-
113-
```python
114-
print(X)
115-
print(A)
116-
```
117-
118-
```python
119-
%%time
120-
signal_toy = np.array([[1, 2], [np.nan, np.nan]])
121-
rpca_pcp = RPCAPCP(lam=1e3)
122-
X, A = rpca_pcp.decompose_rpca_signal(signal_toy)
123-
```
124-
125-
```python
126-
X
127-
```
128-
129-
```python
130-
A
131-
```
132-
133-
```python
134-
np.log(10) / np.log(1.1)
135-
```
136-
137-
```python
138-
X = np.array([[1, 2], [4, 4], [4, 3]])
139-
# Omega = np.array([[True, False], [True, True], [False, True]])
140-
Omega = np.array([[True, True], [True, True], [True, True]])
141-
rpca_noisy = RPCANoisy(period=2, max_iter=200, tau=.5, lam=1, do_report=True)
142-
M_result, A_result, U_result, V_result = rpca_noisy.decompose_rpca_L2(
143-
X, Omega=Omega, lam=1, tau=.5, rank=2
144-
)
145-
```
146-
147-
```python
148-
M_result
149-
```
150-
151-
```python
152-
153-
```

examples/benchmark.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,6 @@ from qolmat.utils import data, utils, plot
5757

5858
```
5959

60-
```python
61-
from qolmat.imputations.em_sampler import invert_robust
62-
```
63-
64-
```python
65-
M[np.array([0, 1]), np.array([0, 1])]
66-
```
67-
68-
```python
69-
M = np.array([[0, 0], [0, 1]])
70-
invert_robust(M)
71-
```
72-
7360
### **I. Load data**
7461

7562

@@ -174,7 +161,7 @@ dict_config_opti = {
174161
"tau": ho.hp.uniform("tau", low=.5, high=5),
175162
"lam": ho.hp.uniform("lam", low=.1, high=1),
176163
}
177-
imputer_rpca_opti = imputers.ImputerRPCA(groups=("station",), columnwise=False, max_iter=256)
164+
imputer_rpca_opti = imputers.ImputerRPCA(groups=("station",), columnwise=False, max_iterations=256)
178165
imputer_rpca_opti = hyperparameters.optimize(
179166
imputer_rpca_opti,
180167
df_data,
@@ -193,7 +180,7 @@ dict_config_opti2 = {
193180
"lam/TEMP": ho.hp.uniform("lam/TEMP", low=.1, high=1),
194181
"lam/PRES": ho.hp.uniform("lam/PRES", low=.1, high=1),
195182
}
196-
imputer_rpca_opti2 = imputers.ImputerRPCA(groups=("station",), columnwise=True, max_iter=256)
183+
imputer_rpca_opti2 = imputers.ImputerRPCA(groups=("station",), columnwise=True, max_iterations=256)
197184
imputer_rpca_opti2 = hyperparameters.optimize(
198185
imputer_rpca_opti2,
199186
df_data,
@@ -202,7 +189,6 @@ imputer_rpca_opti2 = hyperparameters.optimize(
202189
max_evals=10,
203190
dict_spaces=dict_config_opti2
204191
)
205-
# imputer_rpca_opti.params_optim = hyperparams_opti
206192
```
207193

208194
```python
@@ -287,10 +273,6 @@ df_plot = df_data[cols_to_impute]
287273
dfs_imputed = {name: imp.fit_transform(df_plot) for name, imp in dict_imputers.items()}
288274
```
289275

290-
```python
291-
df_data.mode().iloc[0]
292-
```
293-
294276
```python
295277
station = df_plot.index.get_level_values("station")[0]
296278
df_station = df_plot.loc[station]

examples/kl-divergence.md

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)