# 2.4. Multivariate decoding with SpaceNet¶

## 2.4.1. The SpaceNet decoder¶

SpaceNet implements a suite of multi-variate priors which for improved brain decoding. It uses priors like TV (Total Variation) [Michel et al. 2011], TV-L1 [Baldassarre et al. 2012], [Gramfort et al. 2013] (option: penalty=”tvl1”), and Graph-Net [Hebiri et al. 2011] (known as GraphNet in neuroimaging [Grosenick et al. 2013]) (option: penalty=”graph-net”) to regularize classification and regression problems in brain imaging. The result are brain maps which are both sparse (i.e regression coefficients are zero everywhere, except at predictive voxels) and structured (blobby). The superiority of TV-L1 over methods without structured priors like the Lasso, SVM, ANOVA, Ridge, etc. for yielding more interpretable maps and improved prediction scores is now well established [Baldassarre et al. 2012], [Gramfort et al. 2013], [Grosenick et al. 2013].

The following table summarizes the parameter(s) used to activate a given penalty:

- TV-L1: penalty=”tv-l1”
- Graph-Net: penalty=”graph-net” (this is the default prior in SpaceNet)

Note that TV-L1 prior leads to a hard optimization problem, and so can be slow to run. Under the hood, a few heuristics are used to make things a bit faster. These include:

- Feature preprocessing, where an F-test is used to eliminate non-predictive voxels, thus reducing the size of the brain mask in a principled way.
- Continuation is used along the regularization path, where the solution of the optimization problem for a given value of the regularization parameter alpha is used as initialization of for next the regularization (smaller) value on the regularization grid.

**Implementation:** See [Dohmatob et al. 2015 (PRNI)] and [Dohmatob
et al. 2014 (PRNI)] for
technical details regarding the implementation of SpaceNet.

### 2.4.1.2. Haxby¶

**Code**

The complete script can be found here.

See also

- Age prediction on OASIS dataset with SpaceNet.
- The scikit-learn documentation has very detailed explanations on a large variety of estimators and machine learning techniques. To become better at decoding, you need to study it.