def test_relieffpercent_pipeline_mixed_attributes():
"""Ensure that ReliefF with % neighbors works in a sklearn pipeline with mixed attributes"""
np.random.seed(49082)
clf = make_pipeline(ReliefF(n_features_to_select=2, n_neighbors=0.1, n_jobs=-1),
RandomForestClassifier(n_estimators=100, n_jobs=-1))
assert np.mean(cross_val_score(clf, features_mixed_attributes, labels_mixed_attributes, cv=3)) > 0.7
评论列表
文章目录