[pymvpa] Construct custom queryengine with dict
Swaroop Guntupalli
swaroopgj at gmail.com
Tue Feb 14 20:39:00 UTC 2017
Hi,
I am trying to make a QueryEngine() with a custom dict which takes in some
id and returns neighborhood. So, far I have failed. I am pasting my attempt
below. Any help would be appreciated.
Thanks,
Swaroop
##
# custom dict that has feature ids as keys and neighborhood as values
testdict = {i: range(i) for i in range(10)}
qe = IndexQueryEngine(testid=testdict)
# fake dataset
fake_ds = Dataset(samples=np.random.rand(5, 10), fa={'testid': range(10)})
# training
qe.train(fake_ds)
# this works fine
print qe.ids
# this line below fails with TypeError: 'dict' object is not callable
# in line#572 in mvpa2/misc/neighborhood.py
qe[0]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20170214/d3626c1b/attachment.html>
More information about the Pkg-ExpPsy-PyMVPA
mailing list