(WIP) Sparse models: S-LASSO and TV-l1

- Supports TV-l1 and S-LASSO priors
- Supports logistic and squared losses
- Has cross validation
- Can automatically select alpha by CV (+ automatic computation of useful alpha ranges for the CV)
- Warning: User must supply l1_ratio
Indeed partial pickels.

On Wed, Sep 3, 2014 at 1:41 PM, Gael Varoquaux <notifications@github.com>
wrote:

> In nilearn/decoding/sparse_models/common.py:
>
> > +    z = np.dot(X, w[:-1]) + w[-1]
> > +    yz = y * z
> > +    z = _sigmoid(yz, copy=False)
> > +    z0 = (z - 1) * y
> > +    grad = np.empty(w.shape)
> > +    grad[:-1] = np.dot(X.T, z0)
> > +    grad[-1] = np.sum(z0)
> > +    if mask is not None:
> > +        grad = np.append(_unmask(grad[:-1], mask), grad[-1])
> > +    return grad
> > +
> > +# Wrappers.
> > +# XXX div (see below) could be computed more efficienty!
> > +gradient = lambda w: gradient_id(w, l1_ratio=0.)[:-1]  # pure nabla
> > +div = lambda v: div_id(np.vstack((v, [np.zeros_like(v[0])])), l1_ratio=0.)
> > +squared_loss_grad = partial(squared_loss, compute_energy=False,
>
> I'd rather not use partial either: I don't think that it pickles, thus it
> makes it harder to do parallel computing on this code.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/nilearn/nilearn/pull/219/files#r17043508>.
>



-- 
DED