def test_sensitivity_specificity_score_binary():
 (y_true, y_pred, _) = make_prediction(binary=True)
 (sen, spe, sup) = sensitivity_specificity_support(y_true, y_pred, average=None)
 assert_allclose(sen, [0.88, 0.68], rtol=R_TOL)
 assert_allclose(spe, [0.68, 0.88], rtol=R_TOL)
 assert_array_equal(sup, [25, 25])
 for (kwargs, my_assert) in [({}, assert_no_warnings), ({'average': 'binary'}, assert_no_warnings)]:
  sen = my_assert(sensitivity_score, y_true, y_pred, **kwargs)
  assert_allclose(sen, 0.68, rtol=R_TOL)
  spe = my_assert(specificity_score, y_true, y_pred, **kwargs)
  assert_allclose(spe, 0.88, rtol=R_TOL)

def test_sensitivity_specificity_score_binary ( ) : ( y_true , y_pred , _ ) = make_prediction ( binary = True ) ( sen , spe , sup ) = sensitivity_specificity_support ( y_true , y_pred , average = None ) assert_allclose ( sen , [ 0.88 , 0.68 ] , rtol = R_TOL ) assert_allclose ( spe , [ 0.68 , 0.88 ] , rtol = R_TOL ) assert_array_equal ( sup , [ 25 , 25 ] ) for ( kwargs , my_assert ) in [ ( { } , assert_no_warnings ) , ( { 'average' : 'binary' } , assert_no_warnings ) ] : sen = my_assert ( sensitivity_score , y_true , y_pred , ** kwargs ) assert_allclose ( sen , 0.68 , rtol = R_TOL ) spe = my_assert ( specificity_score , y_true , y_pred , ** kwargs ) assert_allclose ( spe , 0.88 , rtol = R_TOL )
test sensitivity specificity for binary classification task .