#NEWLINE# def test_kprotoypes_huang_stocks( self ) : #NEWLINE# #INDENT# np . random . seed ( 42 ) #NEWLINE# kproto_huang = kprototypes . KPrototypes ( n_clusters = 4 , n_init = 1 , init = 'Huang' , verbose = 2 ) #NEWLINE# with self . assertRaises ( AssertionError ) : #NEWLINE# #INDENT# kproto_huang . predict ( STOCKS , categorical = [ 1 , 2 ] ) #NEWLINE# #UNINDENT# result = kproto_huang . fit_predict ( STOCKS , categorical = [ 1 , 2 ] ) #NEWLINE# expected = np . array ( [ 0 , 3 , 3 , 3 , 3 , 2 , 2 , 2 , 2 , 1 , 1 , 1 ] ) #NEWLINE# np . testing . assert_array_equal ( result , expected ) #NEWLINE# self . assertTrue ( ( result . dtype == np . dtype ( np . uint8 ) ) )