Skip to content

Commit 01ddab3

Browse files
committed
DOC debug increase n_random
1 parent 6de22dc commit 01ddab3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/plot_pruning.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from sklearn.linear_model import LogisticRegression
2727

2828
data, labels = load_iris(return_X_y=True)
29-
baseline_lr = LogisticRegression(max_iter=110).fit(data, labels)
29+
baseline_lr = LogisticRegression(max_iter=1000).fit(data, labels)
3030

3131
# %%
3232
# Random data pruning
@@ -40,7 +40,7 @@
4040
def _random_pruning(X, y, n_samples_to_select: int, random_state: int):
4141
rng = np.random.default_rng(random_state)
4242
ids_random = rng.choice(y.size, n_samples_to_select, replace=False)
43-
pruned_lr = LogisticRegression(max_iter=110).fit(X[ids_random], y[ids_random])
43+
pruned_lr = LogisticRegression(max_iter=1000).fit(X[ids_random], y[ids_random])
4444
return pruned_lr.coef_, pruned_lr.intercept_
4545

4646

@@ -72,9 +72,9 @@ def _fastcan_pruning(
7272
).fit(X)
7373
atoms = kmeans.cluster_centers_
7474
ids_fastcan = minibatch(
75-
X.T, atoms.T, n_samples_to_select, batch_size=batch_size, tol=1e-9, verbose=0
75+
X.T, atoms.T, n_samples_to_select, batch_size=batch_size, verbose=0
7676
)
77-
pruned_lr = LogisticRegression(max_iter=110).fit(X[ids_fastcan], y[ids_fastcan])
77+
pruned_lr = LogisticRegression(max_iter=1000).fit(X[ids_fastcan], y[ids_fastcan])
7878
print(atoms[-1], ids_fastcan[-10:])
7979
return pruned_lr.coef_, pruned_lr.intercept_
8080

@@ -112,4 +112,4 @@ def plot_box(X, y, baseline, n_samples_to_select: int, n_random: int):
112112
plt.show()
113113

114114

115-
plot_box(data, labels, baseline_lr, n_samples_to_select=100, n_random=10)
115+
plot_box(data, labels, baseline_lr, n_samples_to_select=100, n_random=100)

0 commit comments

Comments
 (0)