models/train_classifier.py
def performance_score(y_true, y_pred):
    """
    Calculate median F1 score for all of the output classifiers

    Args:
    y_true: Array containing real labels.
    y_pred: Array containing model predictied labels.

    Returns:
    score: float. Median F1 score for all of the output classifiers
    """
    f1_list = []
    for i in range(np.shape(y_pred)[1]):
        f1 = f1_score(np.array(y_true)[:, i], y_pred[:, i])
        f1_list.append(f1)

    score = np.median(f1_list)
    return score

    Calculate median F1 score for all of the output classifiers

    Args:
    y_true: Array containing real labels.
    y_pred: Array containing model predictied labels.

    Returns:
    score: float. Median F1 score for all of the output classifiers
    
Calculate median F1 score for all of the output classifiers
Args:
y_true: Array containing real labels.
y_pred: Array containing model predictied labels.

float. Median F1 score for all of the output classifiers
Calculate median F1 score for all of the output classifiers Args : y_true : Array containing real labels . y_pred : Array containing model predictied labels . float . Median F1 score for all of the output classifiers
def performance_score(y_true, y_pred):
    f1_list = []
    for i in range(np.shape(y_pred)[1]):
        f1 = f1_score(np.array(y_true)[:, i], y_pred[:, i])
        f1_list.append(f1)
    score = np.median(f1_list)
    return score
def performance_score ( y_true , y_pred ) : f1_list = [ ] for i in range ( np . shape ( y_pred ) [ 1 ] ) : f1 = f1_score ( np . array ( y_true ) [ : , i ] , y_pred [ : , i ] ) f1_list . append ( f1 ) score = np . median ( f1_list ) return score
Calculate median F1 score for all of the output classifiers
Args:
y_true: Array containing real labels.
Calculate median F1 score for all of the output classifiers Args : y_true : Array containing real labels .
"""
    Calculate median F1 score for all of the output classifiers

    Args:
    y_true: Array containing real labels.
    y_pred: Array containing model predictied labels.

    Returns:
    score: float. Median F1 score for all of the output classifiers
    """
y_true
y_pred