#NEWLINE# def test_mutual_info_options( ) : #NEWLINE# #INDENT# X = np . array ( [ [ 0 , 0 , 0 ] , [ 1 , 1 , 0 ] , [ 2 , 0 , 1 ] , [ 2 , 0 , 1 ] , [ 2 , 0 , 1 ] ] , dtype = float ) #NEWLINE# y = np . array ( [ 0 , 1 , 2 , 2 , 1 ] , dtype = float ) #NEWLINE# X_csr = csr_matrix ( X ) #NEWLINE# for mutual_info in ( mutual_info_regression , mutual_info_classif ) : #NEWLINE# #INDENT# assert_raises ( ValueError , mutual_info_regression , X_csr , y , discrete_features = False ) #NEWLINE# mi_1 = mutual_info ( X , y , discrete_features = 'auto' , random_state = 0 ) #NEWLINE# mi_2 = mutual_info ( X , y , discrete_features = False , random_state = 0 ) #NEWLINE# mi_3 = mutual_info ( X_csr , y , discrete_features = 'auto' , random_state = 0 ) #NEWLINE# mi_4 = mutual_info ( X_csr , y , discrete_features = True , random_state = 0 ) #NEWLINE# assert_array_equal ( mi_1 , mi_2 ) #NEWLINE# assert_array_equal ( mi_3 , mi_4 ) #NEWLINE# #UNINDENT# assert_false ( np . allclose ( mi_1 , mi_3 ) )