#NEWLINE# def test_binary_blocks_cutting_plane( ) : #NEWLINE# #INDENT# for inference_method in get_installed ( [ 'lp' , 'qpbo' , 'ad3' , 'ogm' ] ) : #NEWLINE# #INDENT# ( X , Y ) = generate_blocks ( n_samples = 3 ) #NEWLINE# crf = GraphCRF ( inference_method = inference_method ) #NEWLINE# clf = NSlackSSVM ( model = crf , max_iter = 20 , C = 100 , check_constraints = True , break_on_bad = False , n_jobs = 1 ) #NEWLINE# ( x1 , x2 , x3 ) = X #NEWLINE# ( y1 , y2 , y3 ) = Y #NEWLINE# n_states = len ( np . unique ( clf ) ) #NEWLINE# ( x1 , y1 ) = ( x1 [ : , : ( - 1 ) ] , y1 [ : , : ( - 1 ) ] ) #NEWLINE# ( x2 , y2 ) = ( x2 [ : ( - 1 ) ] , y2 [ : ( - 1 ) ] ) #NEWLINE# X_ = [ x1 , x2 , x3 ] #NEWLINE# G = [ make_grid_edges ( x ) for x in X_ ] #NEWLINE# X_ = [ x . reshape ( ( - 1 ) , n_states ) for x in X_ ] #NEWLINE# Y = [ y . ravel ( ) for y in [ y1 , y2 , y3 ] ] #NEWLINE# X = list ( zip ( X_ , G ) ) #NEWLINE# clf . fit ( X , Y ) #NEWLINE# Y_pred = clf . predict ( X ) #NEWLINE# for ( y , y_pred ) in zip ( Y , Y_pred ) : #NEWLINE# #INDENT# assert_array_equal ( y , y_pred )