<div dir="ltr">Hello all,<div>I found the problem - I am using zscore to normalize according to baseline.</div><div>In default, zscore is done by chunks. <br></div><div><br></div><div>In some of my pre-defined chunks, there were no baseline scans included,</div><div>therefore, created nan vectors. </div><div>It was solved by adding baseline samples to every chunk.</div><div><br></div><div>Thanks for your support!</div><div><br></div><div>Cheers,</div><div>Gal Star </div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 1, 2015 at 12:09 PM, gal star <span dir="ltr"><<a href="mailto:gal.star3051@gmail.com" target="_blank">gal.star3051@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div>This does not work in my case, since in the dataset exists samples</div><div>which are vectors filled with nan values (therefore, this function returns a dataset with nfeatures == 0, and later on an exception is thrown).</div><div><br></div><div>Also, i've noticed that:</div><div>-  In my case there are no nan or invariant variables in the dataset</div><div> before zscore execution.</div><div>-  After zscore, the dataset turns all test samples into filled with nan vectors.</div><div><br></div><div>What else could cause test samples turn into nan values vectors after zscore?</div><div>Could it have to do with the param_est i'm using?</div><div><br></div><div>Thanks,</div><div>Gal Star</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 30, 2015 at 7:44 PM, Yaroslav Halchenko <span dir="ltr"><<a href="mailto:debian@onerussian.com" target="_blank">debian@onerussian.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
On Fri, 30 Jan 2015, gal star wrote:<br>
<br>
>    Hello,<br>
</span><span>>    Unfortunately it did not remove the nan's vectors.<br>
>    I've also tried to remove those specific scans from the samples list,<br>
>    It still created nan vectors out of different scans.<br>
>    Do you have any idea what can i do to remove/avoid those from the dataset?<br>
<br>
</span>we "recently" added remove_nonfinite_features function<br>
<a href="https://github.com/PyMVPA/PyMVPA/blob/HEAD/mvpa2/datasets/miscfx.py#L58" target="_blank">https://github.com/PyMVPA/PyMVPA/blob/HEAD/mvpa2/datasets/miscfx.py#L58</a><br>
which is just that:<br>
<br>
def remove_nonfinite_features(dataset):<br>
    """Returns a new dataset with all non-finite (NaN,Inf) features removed<br>
<br>
    Removes all feature for which not all values are finite<br>
<br>
    Parameters<br>
    ----------<br>
    dataset : Dataset<br>
        Input dataset<br>
<br>
    Returns<br>
    -------<br>
    finite_dataset: Dataset<br>
        Dataset based on data form the input, but only the features<br>
        for which all samples are finite are kept.<br>
    """<br>
<br>
    return dataset[:, np.all(np.isfinite(dataset.samples),axis=0)]<br>
<br>
so just do<br>
<br>
fds = remove_invariant_features(fds)<br>
fds = remove_nonfinite_features(fds)  # shouldn't even be needed unless you had NaNs from the beginning somehow<br>
<span><br>
>    My code looks like so:<br>
</span>>    attr = A SampleAttributes (os.path.join(source, map_name))<br>
<span>>    fds = fmri_dataset(samples=os.path.join(source,map_name),<br>
>    targets=attr.targets, chunks=attr.chunks)<br>
>    int = numpy.array([l in ['221','211','23'] for l in fds.sa.targets])<br>
>    fds = fds[int]<br>
>    zscore(fds, param_est=('targets',['23']), chunks_attr='chunks')<br>
</span><div><div>--<br>
Yaroslav O. Halchenko, Ph.D.<br>
<a href="http://neuro.debian.net" target="_blank">http://neuro.debian.net</a> <a href="http://www.pymvpa.org" target="_blank">http://www.pymvpa.org</a> <a href="http://www.fail2ban.org" target="_blank">http://www.fail2ban.org</a><br>
Research Scientist,            Psychological and Brain Sciences Dept.<br>
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755<br>
Phone: <a href="tel:%2B1%20%28603%29%20646-9834" value="+16036469834" target="_blank">+1 (603) 646-9834</a>                       Fax: <a href="tel:%2B1%20%28603%29%20646-1419" value="+16036461419" target="_blank">+1 (603) 646-1419</a><br>
WWW:   <a href="http://www.linkedin.com/in/yarik" target="_blank">http://www.linkedin.com/in/yarik</a><br>
<br>
_______________________________________________<br>
Pkg-ExpPsy-PyMVPA mailing list<br>
<a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org" target="_blank">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>