#NEWLINE# def test_normalize_option_multilabel_classification( ) : #NEWLINE# #INDENT# n_classes = 4 #NEWLINE# n_samples = 100 #NEWLINE# ( _ , y_true ) = make_multilabel_classification ( n_features = 1 , n_classes = n_classes , random_state = 0 , allow_unlabeled = True , n_samples = n_samples ) #NEWLINE# ( _ , y_pred ) = make_multilabel_classification ( n_features = 1 , n_classes = n_classes , random_state = 1 , allow_unlabeled = True , n_samples = n_samples ) #NEWLINE# y_true += ( [ 0 ] * n_classes ) #NEWLINE# y_pred += ( [ 0 ] * n_classes ) #NEWLINE# for name in METRICS_WITH_NORMALIZE_OPTION : #NEWLINE# #INDENT# metrics = ALL_METRICS [ name ] #NEWLINE# measure = metrics ( y_true , y_pred , normalize = True ) #NEWLINE# assert_greater ( measure , 0 , msg = 'We failed to test correctly the normalize option' ) #NEWLINE# assert_almost_equal ( ( metrics ( y_true , y_pred , normalize = False ) / n_samples ) , measure , err_msg = ( 'Failed with %s' % name ) )