<commit_before>from neuroimaging.statistics.pca import PCA, PCAmontage
from neuroimaging.fmri import fMRIImage
from neuroimaging.image import Image
import numpy as N

W = R.standard_normal

class PCATest(unittest.TestCase):

    def setUp(self):

        self.fmridata = fMRIImage('http://kff.stanford.edu/BrainSTAT/testdata/test_fmri.img')

        frame = fmridata.frame(0)
        self.mask = Image(N.greater(frame.readall(), 500).astype(N.Float), grid=frame.grid)

    def test_PCAmask(self):

        p = PCA(fmridata, mask=mask)
        p.fit()<commit_msg>initial effort to get test_pca working<commit_after>import unittest

import numpy as N
import pylab

from neuroimaging.fmri import fMRIImage
from neuroimaging.fmri.pca import PCA, PCAmontage
from neuroimaging.image import Image
from neuroimaging.tests.data import repository

class PCATest(unittest.TestCase):

    def setUp(self):

        self.fmridata = fMRIImage('http://kff.stanford.edu/BrainSTAT/testdata/test_fmri.img')
        #self.fmridata = fMRIImage("test_fmri.img", repository)


        frame = fmridata.frame(0)
        self.mask = Image(N.greater(frame.readall(), 500).astype(N.Float), grid=frame.grid)

    def test_PCAmask(self):

        p = PCA(fmridata, mask=mask)
        p.fit()
{'fraction_non_alphanumeric': 0.110055423594616, 'fraction_numerical': 0.006334125098970704, 'mean_word_length': 3.7518796992481205, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3210601', 'n_tokens_mistral': 456, 'n_tokens_neox': 415, 'n_words': 87}