def f1_risk(predictions, targets): scores = f1_score(predictions, targets, average=False) assert all([0 <= s <= 1.0 for s in scores]) return [1 - s for s in scores]
def f1_risk(predictions, targets): scores = f1_score(predictions, targets, average=False) return [1 - s for s in scores]