8000 MNT: Rename variable `n_samples` to `n_features` (#11344) · wdevazelhes/scikit-learn@5b29ae6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b29ae6

Browse files
jakirkhamTomDLT
authored andcommitted
MNT: Rename variable n_samples to n_features (scikit-learn#11344)
1 parent e4b40cc commit 5b29ae6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/decomposition/dict_learning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def _update_dict(dictionary, Y, code, verbose=False, return_r2=False,
371371
372372
"""
373373
n_components = len(code)
374-
n_samples = Y.shape[0]
374+
n_features = Y.shape[0]
375375
random_state = check_random_state(random_state)
376376
# Residuals, computed 'in-place' for efficiency
377377
R = -np.dot(dictionary, code)
@@ -392,7 +392,7 @@ def _update_dict(dictionary, Y, code, verbose=False, return_r2=False,
392392
sys.stdout.flush()
393393
elif verbose:
394394
print("Adding new random atom")
395-
dictionary[:, k] = random_state.randn(n_samples)
395+
dictionary[:, k] = random_state.randn(n_features)
396396
if positive:
397397
dictionary[:, k][dictionary[:, k] < 0] = 0.0
398398
# Setting corresponding coefs to 0

0 commit comments

Comments
 (0)
0