[pymvpa] Searchlight sl_map = accuracy?
Nynke van der Laan
nynkevanderlaan at gmail.com
Wed Feb 23 10:20:02 UTC 2011
Thanks a lot for clarifying and providing an example piece of code for
the accuracies. Now it's completely clear to me!
Now I indeed get, as you suggested in a previous message, very high
accuracies (low errors) in certain areas at the border of the brain. I
guess I should mask that out.
Best regards,
Nynke
On Tue, 22 Feb 2011, Nynke van der Laan wrote:
> However, in the first example, the best performing sphere is the
> sphere with the highest error (the best performing sphere is retrieved
> by max(sl_map). I would expect that the best performing sphere is the
> one with the lowest error.... (i.e., the best sphere would be the one
> with the highest accuracy and thus the lowest error)
SORRY ABOUT THE MESS: indeed it should have been 'min' in there and
issue was reported/fixed quite a while ago, but only in 0.5 branch :-/
So, I pushed this fix now also into 0.4 (what you are using)
$> git cherry-pick 0747f55db1399b343e54b9dc20f0490a24d1db2d
Finished one cherry-pick.
[maint/0.4 3ea1324] BF: The best error is the lowest ;-)
Author: Michael W. Cole <mwcole at gmail.com>
1 files changed, 1 insertions(+), 1 deletions(-)
> I was wondering if there is a way to get a sl_map with the accuracies
> instead of the errors? I couldn't find a proper errorfx argument for
> that. Or should I than just do that myself by for each datapoint doing
> 1 minus the value I get now?
it would be the easiest, since should be accomplished with just
sl_map = 1.0 - sl_map ;-)
alternatively, yes, you should be able to provide your custom errorfx...
iirc it could be just a function, e.g.:
import numpy as np
cv = CrossValidatedTransferError(
TransferError(LinearCSVMC(),
errorfx=lambda predicted, target: np.mean(
predicted == target )),
OddEvenSplitter())
--
=------------------------------------------------------------------=
Keep in touch www.onerussian.com
Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic
More information about the Pkg-ExpPsy-PyMVPA
mailing list