@register_metric('<STR_LIT>')<EOL>def round_f1_weighted(y_true, y_predicted):
try:<EOL><INDENT>predictions = [np.round(x) for x in y_predicted]<EOL><DEDENT>except TypeError:<EOL><INDENT>predictions = y_predicted<EOL><DEDENT>return f1_score(np.array(y_true), np.array(predictions), average="<STR_LIT>")<EOL>
Calculates F1 weighted measure.

Args:
    y_true: list of true values
    y_predicted: list of predicted values

Returns:
    F1 score