本文整理匯總了Python中mvpa2.clfs.meta.SplitClassifier.untrain方法的典型用法代碼示例。如果您正苦於以下問題:Python SplitClassifier.untrain方法的具體用法?Python SplitClassifier.untrain怎麽用?Python SplitClassifier.untrain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mvpa2.clfs.meta.SplitClassifier
的用法示例。
在下文中一共展示了SplitClassifier.untrain方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_split_clf_on_chainpartitioner
# 需要導入模塊: from mvpa2.clfs.meta import SplitClassifier [as 別名]
# 或者: from mvpa2.clfs.meta.SplitClassifier import untrain [as 別名]
def test_split_clf_on_chainpartitioner(self):
# pretty much a smoke test for #156
ds = datasets['uni2small']
part = ChainNode([NFoldPartitioner(cvtype=1),
Balancer(attr='targets', count=2,
limit='partitions', apply_selection=True)])
partitions = list(part.generate(ds))
sclf = SplitClassifier(sample_clf_lin, part, enable_ca=['stats', 'splits'])
sclf.train(ds)
pred = sclf.predict(ds)
assert_equal(len(pred), len(ds)) # rudimentary check
assert_equal(len(sclf.ca.splits), len(partitions))
assert_equal(len(sclf.clfs), len(partitions))
# now let's do sensitivity analyzer just in case
sclf.untrain()
sensana = sclf.get_sensitivity_analyzer()
sens = sensana(ds)
# basic check that sensitivities varied across splits
from mvpa2.mappers.fx import FxMapper
sens_stds = FxMapper('samples', np.std, uattrs=['targets'])(sens)
assert_true(np.any(sens_stds != 0))