#NEWLINE# def test_ovr_multilabel( ) : #NEWLINE# #INDENT# X = np . array ( [ [ 0 , 4 , 5 ] , [ 0 , 5 , 0 ] , [ 3 , 3 , 3 ] , [ 4 , 0 , 6 ] , [ 6 , 0 , 0 ] ] ) #NEWLINE# y = np . array ( [ [ 0 , 1 , 1 ] , [ 0 , 1 , 0 ] , [ 1 , 1 , 1 ] , [ 1 , 0 , 1 ] , [ 1 , 0 , 0 ] ] ) #NEWLINE# for base_clf in ( MultinomialNB ( ) , LinearSVC ( random_state = 0 ) , LinearRegression ( ) , Ridge ( ) , ElasticNet ( ) , Lasso ( alpha = 0.5 ) ) : #NEWLINE# #INDENT# clf = OneVsRestClassifier ( base_clf ) . fit ( clf , y ) #NEWLINE# y_pred = clf . predict ( [ [ 0 , 4 , 4 ] ] ) [ 0 ] #NEWLINE# assert_array_equal ( y_pred , [ 0 , 1 , 1 ] ) #NEWLINE# assert_true ( clf . multilabel_ )