def test_surf_pipeline():
"""Ensure that SURF works in a sklearn pipeline when it is parallelized"""
np.random.seed(240932)
clf = make_pipeline(SURF(n_features_to_select=2, n_jobs=-1),
RandomForestClassifier(n_estimators=100, n_jobs=-1))
assert np.mean(cross_val_score(clf, features, labels, cv=3)) > 0.7
评论列表
文章目录