-
-
Notifications
You must be signed in to change notification settings - Fork 26k
WIP: OrthogonalMatchingPursuitCV #1042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Cool! Thanks for tackling this Vlad! |
@@ -145,6 +164,10 @@ def _gram_omp(Gram, Xy, n_nonzero_coefs, tol_0=None, tol=None, | |||
Indices of the positions of the elements in gamma within the solution | |||
vector | |||
|
|||
coefs, array, shape = (n_features, n_nonzero_coefs) | |||
The first k values of column k correspond to the coefficient value | |||
for the active features at that step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add that it is returned only if return_path=True?
almost there :) |
Hi @vene, what is the state of this pr? |
@arjoly : It seems I forgot about it halfway, and I don't remember why, but I don't think there are any obstacles. I cannot tackle it in the next couple of days, though, but if you don't finish it in the mean while, I'll do it then. |
Thanks! |
I'm working on this. |
coef[idx[:n_active + 1], k, n_active] = x[:n_active + 1] | ||
else: | ||
x, idx = out | ||
coef[idx, k] = x | ||
return np.squeeze(coef) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agramfort :
Here instead of alphas
we can return np.arange(n_features)
, followed by active
and coef
and this should be usable as-is inside the _lars_path_residues
function. Unfortunately there is duplication of normalization code and logic and OMP normalization is non-trivial when precomputing is in play. However I wonder whether many people actually use precomputing; and if so; in another context than sparse coding (where we already have a convenience function). Maybe we can simplify the logic a bit by disallowing some things, and allow power users to do it through functions instead of estimators.
LGTM to far. More when #2186 is merged. Tomorrow hopefully. |
A class which implements fit / predict and takes a cv object would be nice too (possibly in another PR). |
Mathieu, We're waiting for a cleaner infrastructure for path classes and generic cv On Tue, Jul 23, 2013 at 3:08 AM, Mathieu Blondel
|
DOC/FIX affinity_propagation damping default value.
DOC Clarify docstrings
FIX: work with max_iter=1, though it does not make sense DOC add OrthogonalMatchingPursuitCV docstrings
@agramfort @mblondel @arjoly I updated this. |
Couldn't get rid of some pesky commits without opening a new PR. #2224 |
As discussed in issue #1930
Todo: