<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi,<br>
      <br>
      With some great input from Michael I figured out now, that
      contrary to the common sphere_searchlight, the
      sphere_gnbsearchlight already implements a cross-validation. So
      the code got modified now as pasted below. This code runs without
      any error. However, the sl.ca.null_prob.samples have all the same
      value. This is not the case for the 'common' searchlight
      implementation (second snippet below).<br>
      <br>
      Has anybody an idea, where the code is wrong<tt>, making
        MCNullDist</tt> always produce the same permutation?<br>
      <br>
      Thanks for any hints,<br>
      wolf<br>
      <br>
      <br>
      <br>
      ### GNB-Searchlight<br>
      <tt>clf  = GNB()</tt><tt><br>
      </tt><tt> splt = NFoldPartitioner(cvtype=2, attr='chunks')</tt><tt><br>
      </tt> <tt><br>
      </tt><tt> repeater   = Repeater(count=100)</tt><tt><br>
      </tt><tt> permutator = AttributePermutator('targets',
        limit={'partitions': 1}, count=1)</tt><tt><br>
      </tt> <tt><br>
      </tt><tt> null_sl = sphere_gnbsearchlight(clf, ChainNode([splt,
        permutator], space=splt.get_space()),</tt><tt><br>
      </tt><tt>                            radius=3,
        space='voxel_indices', enable_ca=['roi_sizes'],</tt><tt><br>
      </tt><tt>                            postproc=mean_sample(),
        errorfx=mean_mismatch_error)</tt><tt><br>
      </tt><tt> distr_est = MCNullDist(repeater, tail='left',
        measure=null_sl,</tt><tt><br>
      </tt><tt>                        enable_ca=['dist_samples'])</tt><tt><br>
      </tt><tt> sl = sphere_gnbsearchlight(clf,splt, radius=3,
        space='voxel_indices',</tt><tt><br>
      </tt><tt>                            enable_ca=['roi_sizes'],
        reuse_neighbors=True,</tt><tt><br>
      </tt><tt>                            null_dist=distr_est,
        postproc=mean_sample(),</tt><tt><br>
      </tt><tt>                            errorfx=mean_mismatch_error)</tt><tt><br>
      </tt><tt> sl_map = sl(ds)</tt><br>
       <br>
      <br>
      <tt>### 'normal' Searchlight</tt><tt><br>
      </tt> <tt>clf  = GNB()</tt><tt><br>
      </tt><tt>splt = NFoldPartitioner(cvtype=2, attr='chunks')</tt><tt><br>
      </tt><tt><br>
      </tt><tt>repeater   = Repeater(count=100)</tt><tt><br>
      </tt><tt>permutator = AttributePermutator('targets',
        limit={'partitions': 1}, count=1)</tt><tt><br>
      </tt><tt>null_cv = CrossValidation(clf, ChainNode([splt,
        permutator],space=splt.get_space()),<br>
                                  postproc=mean_sample())</tt><tt><br>
      </tt><tt>null_sl = sphere_searchlight(null_cv, radius=3,
        space='voxel_indices',</tt><tt><br>
      </tt><tt>                             enable_ca=['roi_sizes'],
        nproc=4)</tt><tt><br>
      </tt><tt>distr_est = MCNullDist(repeater,tail='left',
        measure=null_sl,</tt><tt><br>
                               enable_ca=['dist_samples'])</tt><tt><br>
      </tt><tt>cv = CrossValidation(clf,splt,
        errorfx=mean_mismatch_error, <br>
                             enable_ca=['stats'], postproc=mean_sample()
        )</tt><tt><br>
      </tt><tt>sl = sphere_searchlight(cv, radius=3,
        space='voxel_indices', nproc=4,</tt><tt><br>
      </tt><tt>                        enable_ca=['roi_sizes'],
        null_dist=distr_est)</tt><tt><br>
      </tt><tt>sl_map = sl(ds)</tt><tt><br>
      </tt><br>
      <br>
      On 10/09/2012 04:49 PM, wolf zinke wrote:<br>
    </div>
    <blockquote
      cite="mid:5040_1349794189_5074398D_5040_2029_1_50743985.6070201@ovgu.de"
      type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      Hi,<br>
      <br>
      I try to use sphere_gnbsearchlight for Monte Carlo Testing to
      speed things up a bit. After figuring out the difference of
      arguments between sphere_gnbsearchlight and sphere_searchlight, I
      was able to set up everything without an argument error. However,
      when I run the searchlight analysis, it produces an error. Maybe,
      I misunderstood the usage of the arguments for
      sphere_gnbsearchlight, especially the generator argument. Any
      ideas what I am doing wrong here?<br>
      <br>
      thanks,<br>
      wolf<br>
      <br>
      <small><tt>clf  = GNB() </tt><tt><br>
        </tt><tt>splt = NFoldPartitioner(cvtype=2, attr='chunks') </tt><tt><br>
        </tt><tt>repeater   = Repeater(count=100) </tt><tt><br>
        </tt><tt>permutator = AttributePermutator('targets',
          limit={'partitions': 1}, count=1) </tt><tt><br>
        </tt><tt>null_cv = CrossValidation( clf, ChainNode([splt,
          permutator], space=splt.get_space()),
          errorfx=mean_mismatch_error, postproc=mean_sample()) </tt><tt><br>
        </tt><tt>distr_est = MCNullDist(repeater, tail='left',
          measure=null_cv, enable_ca=['dist_samples']) </tt><tt><br>
        </tt><tt>cv = CrossValidation(clf, splt,
          errorfx=mean_mismatch_error, enable_ca=['stats'], </tt><tt>postproc=mean_sample(),



          null_dist=distr_est) </tt><tt><br>
        </tt><tt>sl = sphere_gnbsearchlight(clf, cv, radius=3,
          space='voxel_indices', enable_ca=['roi_sizes']) </tt><tt><br>
        </tt></small>
      <blockquote type="cite">---------------------------------------------------------------------------<br>
        ValueError                                Traceback (most recent
        call last)<br>
        <br>
        /home/data/exppsy/zinke/binding/pub_related/mvpa_splitset_epispace/comb/<ipython



        console> in <module>()<br>
        <br>
        /usr/lib/pymodules/python2.6/mvpa2/base/learner.pyc in
        __call__(self, ds)<br>
            237                                    "used and auto
        training is disabled."<br>
            238                                    % str(self))<br>
        --> 239         return super(Learner, self).__call__(ds)<br>
            240 <br>
            241 <br>
        <br>
        /usr/lib/pymodules/python2.6/mvpa2/base/node.pyc in
        __call__(self, ds)<br>
             82 <br>
             83         self._precall(ds)<br>
        ---> 84         result = self._call(ds)<br>
             85         result = self._postcall(ds, result)<br>
             86 <br>
        <br>
        /usr/lib/pymodules/python2.6/mvpa2/measures/searchlight.pyc in
        _call(self, dataset)<br>
            132 <br>
            133         # pass to subclass<br>
        <br>
        --> 134         results = self._sl_call(dataset, roi_ids,
        nproc)<br>
            135 <br>
            136         if 'mapper' in dataset.a:<br>
        <br>
        /usr/lib/pymodules/python2.6/mvpa2/measures/adhocsearchlightbase.pyc



        in _sl_call(self, dataset, roi_ids, nproc)<br>
            366         # labels<br>
        <br>
            367         combinations[:, 0] = labels_numeric<br>
        --> 368         for ipartition, (split1, split2) in
        enumerate(splits):<br>
            369             combinations[split1.samples[:, 0],
        1+ipartition] = 1<br>
            370             combinations[split2.samples[:, 0],
        1+ipartition] = 2<br>
        <br>
        ValueError: need more than 1 value to unpack<br>
      </blockquote>
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Pkg-ExpPsy-PyMVPA mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a>
<a class="moz-txt-link-freetext" href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a></pre>
    </blockquote>
    <br>
    <br>
  </body>
</html>