Esempio n. 1
0
TODO

"""

import numpy as np
"""

"""

import mvpa
from mvpa.base import cfg
from mvpa.misc.data_generators import *
from mvpa.clfs.knn import kNN
from mvpa.misc.plot import *

mvpa.seed(0)  # to reproduce the plot

dataset_kwargs = dict(nfeatures=2,
                      nchunks=10,
                      snr=2,
                      nlabels=4,
                      means=[[0, 1], [1, 0], [1, 1], [0, 0]])

dataset_train = normal_feature_dataset(**dataset_kwargs)
dataset_plot = normal_feature_dataset(**dataset_kwargs)

# make a new figure
pl.figure(figsize=(9, 9))

for i, k in enumerate((1, 3, 9, 20)):
    knn = kNN(k)
Esempio n. 2
0
"""

import numpy as np


"""

"""

import mvpa
from mvpa.base import cfg
from mvpa.misc.data_generators import *
from mvpa.clfs.knn import kNN
from mvpa.misc.plot import *

mvpa.seed(0)  # to reproduce the plot

dataset_kwargs = dict(nfeatures=2, nchunks=10, snr=2, nlabels=4, means=[[0, 1], [1, 0], [1, 1], [0, 0]])

dataset_train = normal_feature_dataset(**dataset_kwargs)
dataset_plot = normal_feature_dataset(**dataset_kwargs)


# make a new figure
pl.figure(figsize=(9, 9))

for i, k in enumerate((1, 3, 9, 20)):
    knn = kNN(k)

    print "Processing kNN(%i) problem..." % k
    pl.subplot(2, 2, i + 1)
Esempio n. 3
0
File: tools.py Progetto: esc/PyMVPA
 def newfunc(*arg, **kwargs):
     mvpa.seed(mvpa._random_seed)
     return func(*arg, **kwargs)