yeah -- we need to improve our documentation of Balancer... meanwhile
try something like
cv=CrossValidation(clf,
ChainNode([NFoldPartitioner(),
Balancer(attr='targets',
count=1, # for real data 1
limit='partitions',
apply_selection=True
)],
space='partitions'))
On Sat, 21 Apr 2012, Ping-Hui Chiu wrote:
Thanks Yaroslav! I tried the Balancer generator but it didn't help in the
following case of binary classification on random samples:
from mvpa2.suite import *
clf=LinearCSVMC();
cv=CrossValidation(clf,ChainNode([NFoldPartitioner(),Balancer()],space='partitio
ns'))
acc=[]
for i in range(200):
print i
ds=Dataset(np.random.rand(200))
[1]ds.sa['targets']=np.remainder(range(200),2)
[2]ds.sa['chunks']=range(200)
results=cv(ds)
acc.append(1-np.mean(results))
print np.mean(acc),np.std(acc)
0.4106 0.212417960634
--
=--=
Keep in touch www.onerussian.com
Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic
___
Pkg-ExpPsy-PyMVPA mailing list
Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa