searchlight searchlight analysis.
DESCRIPTION
The searchlight uses a sphere with a certain radius and stepsize in order
to scan a volume and classify based on elements inside the sphere.
Subsequently one may either:
* Use m.model to return the performance estimates throughout the volume
* Select the best n spheres and retrieve this subset for the input data.
The number nspheres is computed using a nested cross-validation with
the specified validator.
EXAMPLE:
X = rand(10,1000); Y = [1 1 1 1 1 2 2 2 2 2]';
Perform searchlight and return classification accuracy computed with a
default crossvalidator and mapped back to the standard volume.
indims = [10 10 10];
m = dml.searchlight('step',2,'radius',2,'indims',indims,'verbose',true,'stats',{'accuracy'});
m = m.train(X,Y); r = m.model;
Alternatively, a multidimensional logical mask can be used to specify
the input dimensions and restrict to a subset of the original volume; the
original volume will still be used to estimate the searchlight
spheres:
mymask = true(10,10,10); mymask(:,:,1:5) = false;
m = dml.searchlight('step',2,'radius',2,'mask',mymask,'verbose',true,'stats',{'accuracy'});
m = m.train(X(:,find(mymask(:))),Y); r = m.model;
We may also specify a different, irregular, neighbourhood structure
in conjunction with the input dimensions or a particular mask:
mymask = true(10,10,10); mymask(:,:,1:5) = false;
nb = sparse(1000,1000); prm = randperm(1e6); nb(prm(1:1000)) = 1; nb = (nb + nb') ~= 0;
m = dml.searchlight('step',2,'radius',2,'neighbours',nb,'mask',mymask,'verbose',true,'stats',{'accuracy'});
m = m.train(X(:,find(mymask(:))),Y); r = m.model;
The output of this searchlight analysis can also be used for feature selection.
In that case, one needs to specify nspheres, containing the numbers of
spheres to test. The optimal subset of spheres will be determined using
the specified crossvalidator:
mymask = true(10,10,10);
m = dml.searchlight('nspheres',[1 2 3 4 5],'step',2,'radius',2,'mask',mymask,'verbose',true,'stats',{'accuracy'});
m = m.train(X,Y); r = m.model;
Instead of using a cross-validator, one may also use a permutation
object to determine sphere performance:
indims = [10 10 10];
p = dml.permutation('stat','accuracy','validator',dml.crossvalidator('mva',dml.svm),'nperm',10,'verbose',true);
m = dml.searchlight('step',3,'radius',2,'indims',indims,'verbose',true,'validator',p);
m = m.train(X,Y); r = m.model;
DEVELOPER
Marcel van Gerven (m.vangerven@donders.ru.nl)