#NEWLINE# def test_partial_fit_binary( self ) : #NEWLINE# #INDENT# third = ( X . shape [ 0 ] // 3 ) #NEWLINE# clf = self . factory ( alpha = 0.01 ) #NEWLINE# classes = np . unique ( Y ) #NEWLINE# clf . partial_fit ( X [ : third ] , Y [ : third ] , classes = classes ) #NEWLINE# assert_equal ( clf . coef_ . shape , ( 1 , X . shape [ 1 ] ) ) #NEWLINE# assert_equal ( clf . intercept_ . shape , ( 1 , ) ) #NEWLINE# assert_equal ( clf . decision_function ( [ [ 0 , 0 ] ] ) . shape , ( 1 , ) ) #NEWLINE# id1 = id ( clf . coef_ . data ) #NEWLINE# clf . partial_fit ( X [ third : ] , Y [ third : ] ) #NEWLINE# id2 = id ( clf . coef_ . data ) #NEWLINE# assert_true ( id1 , id2 ) #NEWLINE# y_pred = clf . predict ( T ) #NEWLINE# assert_array_equal ( y_pred , true_result )