示例#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)
示例#2
0
文件: knn_plot.py 项目: B-Rich/PyMVPA
"""

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)
示例#3
0
文件: tools.py 项目: esc/PyMVPA
 def newfunc(*arg, **kwargs):
     mvpa.seed(mvpa._random_seed)
     return func(*arg, **kwargs)