[pymvpa] The exact nature of LinearSVMWeights

Matthew Cieslak mattcieslak at gmail.com
Tue Jul 5 22:29:13 UTC 2011


I have been doing some work with 0.4.7 lately and am wondering what the
exact strategy/formula behind the .getSensitivityAnalyzer() is for dealing
with SVM weights. My original intuition was that this function was a
shortcut to grab the hyperplane weights and that calling it with a dataset
again after it had already been trained was a formality (a silly assumption,
but based on the ValueError I was getting when not providing a dataset). My
code looks similar to this (I know there are more convenient ways to do
sample partitioning, this was set up for easy access to training and testing

clf = SVM(C=1)
training_set = dset.selectSamples(dset.chunks != 0)
sens = clf.getSensitivityAnalyzer()
predictions = clf.predict(dset.samples) # see how it does on training and

weights = sens(dset) # turns out that this actually retrains clf

I was confused to see that the weights were identical no matter which fold
was left out. Should I actually be using weights = sens(training_set) or is
there some way to get the weights without calling with a dataset?
lots of related questions:
What would I need to pull out of a linearSVM to reproduce its predictions?
Is there an analog of getSensitivityAnalyzer() that would give me the w and
b from the SVM's wx+b? What is the difference between w and what is returned
by getSensitivityAnalyzer()?

Thanks as always,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20110705/8b811364/attachment.html>

More information about the Pkg-ExpPsy-PyMVPA mailing list