models/train_classifier.py
def evaluate_model(model, X_test, Y_test, category_names):
    """
    Evalueate each model target categorie.

    Parameters:
    model (sklearn Pipeline): the evaluated pipeline
    X_test (panda dataframe): test feature data
    Y_test (panda dataframe): test target data
    category_names (pandas Series): target categories name
    Returns:
    """
    y_pred = model.predict(X_test)

    print("Model Score: {}".format(model.score(X_test, Y_test)))
    #print("Model Best Params: {}".format(model.best_params_))
    for column in range(y_pred.shape[1]):
        print("Column: ",category_names[column])

        print(classification_report(Y_test[category_names[column]], y_pred[:,column], zero_division=0))
        print("----------------------------------------------------------*")

    Evalueate each model target categorie.

    Parameters:
    model (sklearn Pipeline): the evaluated pipeline
    X_test (panda dataframe): test feature data
    Y_test (panda dataframe): test target data
    category_names (pandas Series): target categories name
    Returns:
    
Evalueate each model target categorie.
Evalueate each model target categorie .
def evaluate_model(model, X_test, Y_test, category_names):
    y_pred = model.predict(X_test)
    print("Model Score: {}".format(model.score(X_test, Y_test)))
    for column in range(y_pred.shape[1]):
        print("Column: ",category_names[column])
        print(classification_report(Y_test[category_names[column]], y_pred[:,column], zero_division=0))
        print("----------------------------------------------------------*")
def evaluate_model ( model , X_test , Y_test , category_names ) : y_pred = model . predict ( X_test ) print ( "Model Score: {}" . format ( model . score ( X_test , Y_test ) ) ) for column in range ( y_pred . shape [ 1 ] ) : print ( "Column: " , category_names [ column ] ) print ( classification_report ( Y_test [ category_names [ column ] ] , y_pred [ : , column ] , zero_division = 0 ) ) print ( "----------------------------------------------------------*" )
Evalueate each model target categorie.
Evalueate each model target categorie .
"""
    Evalueate each model target categorie.

    Parameters:
    model (sklearn Pipeline): the evaluated pipeline
    X_test (panda dataframe): test feature data
    Y_test (panda dataframe): test target data
    category_names (pandas Series): target categories name
    Returns:
    """ #print("Model Best Params: {}".format(model.best_params_))
model
X_test
Y_test
category_names