NMF n_components are not properly getting reflected in output when using Grid Search CV
See original GitHub issueWhen I executed the example code from this link and analyzed the grid search output (grid.cv_results_[‘params’]), n_components are not properly getting reflected in output.
Posting a small snippet of output of grid.cv_results_[‘params’]:
{'classify__C': 1000,
'reduce_dim': NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
**n_components=None,** random_state=None, shuffle=False, solver='cd',
tol=0.0001, verbose=0),
'reduce_dim__n_components': 2},
{'classify__C': 1000,
'reduce_dim': NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
**n_components=None**, random_state=None, shuffle=False, solver='cd',
tol=0.0001, verbose=0),
'reduce_dim__n_components': 4},
{'classify__C': 1000,
'reduce_dim': NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
**n_components=None**, random_state=None, shuffle=False, solver='cd',
tol=0.0001, verbose=0),
'reduce_dim__n_components': 8},
where reduce_dim__n_components are updating for NMF but not the actual n_components in NMF
Thanks, Pat
Issue Analytics
- State:
- Created 6 years ago
- Comments:25 (24 by maintainers)
Top Results From Across the Web
Reconstructing new data using sklearn NMF components Vs ...
You can check the implementation to find the differences. · scikit-learn implementation is calculating the dot between transformed data and the ...
Read more >sklearn.model_selection.GridSearchCV
Either estimator needs to provide a score function, or scoring must be passed. param_griddict or list of dictionaries. Dictionary with parameters names (...
Read more >LDA in Python – How to grid search best topic models?
Python's Scikit Learn provides a convenient interface for topic modeling using algorithms like Latent Dirichlet allocation(LDA), ...
Read more >Can't reproduce results from GridSearchCV?
The score from your GridsearchCV is biased. You can use cross-validation either for estimating accuracy, or for choosing hyperparameters; but not both.
Read more >Link prediction based on non-negative matrix factorization
Results · We also testified the reliability of our algorithm NMF-LP on networks with node attributes. · In the process of the non-negative...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, but I’m concerned about the side-effects. Let’s say someone did
and then ran a grid-search for each. If you run
grid1
first, the estimator ingrid2
would havemax_depth=3
. That’s very surprising to me.another thing we should consider is whether the bug, or its fix, will affect mutable parameters other than estimators