def test_iba_sklearn_metrics():
 (y_true, y_pred, _) = make_prediction(binary=True)
 acc = make_index_balanced_accuracy(alpha=0.5, squared=True)(accuracy_score)
 score = acc(y_true, y_pred)
 assert_equal(score, 0.54756)
 jss = make_index_balanced_accuracy(alpha=0.5, squared=True)(jaccard_similarity_score)
 score = jss(y_true, y_pred)
 assert_equal(score, 0.54756)
 pre = make_index_balanced_accuracy(alpha=0.5, squared=True)(precision_score)
 score = pre(y_true, y_pred)
 assert_equal(score, 0.65025)
 rec = make_index_balanced_accuracy(alpha=0.5, squared=True)(recall_score)
 score = rec(y_true, y_pred)
 assert_equal(score, 0.4161600000000001)

def test_iba_sklearn_metrics ( ) : ( y_true , y_pred , _ ) = make_prediction ( binary = True ) acc = make_index_balanced_accuracy ( alpha = 0.5 , squared = True ) ( accuracy_score ) score = acc ( y_true , y_pred ) assert_equal ( score , 0.54756 ) jss = make_index_balanced_accuracy ( alpha = 0.5 , squared = True ) ( jaccard_similarity_score ) score = jss ( y_true , y_pred ) assert_equal ( score , 0.54756 ) pre = make_index_balanced_accuracy ( alpha = 0.5 , squared = True ) ( precision_score ) score = pre ( y_true , y_pred ) assert_equal ( score , 0.65025 ) rec = make_index_balanced_accuracy ( alpha = 0.5 , squared = True ) ( recall_score ) score = rec ( y_true , y_pred ) assert_equal ( score , 0.4161600000000001 )
test the compatibility of sklearn metrics within iba .