Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SplitRFE example code incomplete #460

Closed
zingbretsen opened this issue Apr 12, 2016 · 1 comment
Closed

SplitRFE example code incomplete #460

zingbretsen opened this issue Apr 12, 2016 · 1 comment

Comments

@zingbretsen
Copy link

SplitRFE

rfesvm_split is used in the errorfx, but is not shown previously in the code.

In the regular RFE example, rfesvm_split is used in 2 places--as the first argument (with get_sensitivity_analyzer) as well as in the ConfusionBasedError.
RFE

Should that be the same in the SplitRFE example? That is, should the first argument not be a separate instance of the SVM classifier? Or is rfesvm_split even necessary in this example?

>>> # Lazy import
>>> from mvpa2.suite import *
>>> # design an RFE feature selection to be used with a classifier
>>> rfe = SplitRFE(
...           LinearCSVMC(),
...           OddEvenPartitioner(),
...           # take sensitivities per each split, L2 norm, mean, abs them
...           fmeasure_postproc=ChainMapper([
...               FxMapper('features', l2_normed),
...               FxMapper('samples', np.mean),
...               FxMapper('samples', np.abs)]),
...           # use the error stored in the confusion matrix of split classifier
...           errorfx=ConfusionBasedError(rfesvm_split, confusion_state='stats'),
...           # select 50% of the best on each step
...           fselector=FractionTailSelector(
...               0.50,
...               mode='select', tail='upper'),
...           # but we do want to update sensitivities on each step
...           update_sensitivity=True)
@yarikoptic
Copy link
Member

thank you for the report! indeed, errorfx is optional here so I will push the "fix" which simply omits that specification here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants