def test_majority_label_iris():
 clf1 = LogisticRegression(random_state=123)
 clf2 = RandomForestClassifier(random_state=123)
 clf3 = GaussianNB()
 eclf = VotingClassifier(estimators=[('lr', clf1), ('rf', clf2), ('gnb', clf3)], voting='hard')
 scores = cross_val_score(eclf, X, y, cv=5, scoring='accuracy')
 assert_almost_equal(scores.mean(), 0.95, decimal=2)

def test_majority_label_iris ( ) : clf1 = LogisticRegression ( random_state = 123 ) clf2 = RandomForestClassifier ( random_state = 123 ) clf3 = GaussianNB ( ) eclf = VotingClassifier ( estimators = [ ( 'lr' , clf1 ) , ( 'rf' , clf2 ) , ( 'gnb' , clf3 ) ] , voting = 'hard' ) scores = cross_val_score ( eclf , X , y , cv = 5 , scoring = 'accuracy' ) assert_almost_equal ( scores . mean ( ) , 0.95 , decimal = 2 )
check classification by majority label on dataset iris .