MATLAB File Help: dml.searchlight View code for dml.searchlight Default Topics
dml.searchlight
  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)
Class Details
Superclasses dml.method
Sealed false
Construct on load false
Constructor Summary
searchlight searchlight analysis. 
Property Summary
center only selects the feature in the centre of the sphere if true 
centers centers of each sphere 
compact save validators if compact = false 
exclude if false then only the center within a sphere is required to be part of the optional mask 
indims dimensions of the input data (excluding the trial dim and time dim in time series data) 
mask optional logical mask of size indims (input features are only those in the mask) 
neighbours a sparse adjacency matrix specifying the neighbourhood structure for irregular data (don't use in conjunction with mask) 
nspheres select the union of the best nspheres spheres;  
original in original space 
performance performance as function of number of selected spheres (or sphere centers) 
radius radius of the hypersphere in terms of array elements (diameter will be 1 + 2 * radius). 
restart when false, starts at the previously learned parameters; needed for online learning and grid search 
spheres the features belonging to each sphere 
stats the statistics to save in value (e.g. {'accuracy','binomial'}); empty stats field will just call validator.statistic 
step stepsize in terms of array elements  
subset the used feature subset 
validator the validator used to determine the final used feature subset 
value evaluation metric per sphere 
verbose whether or not to generate diagnostic output 
Method Summary
  estimate_spheres  
  model return performance mapped back to original space 
  test  
  train