rasa/core/test.py
def plot_story_evaluation(test_y, predictions,
                          report, precision, f1, accuracy,
                          in_training_data_fraction,
                          out_directory):
    """Plot the results of story evaluation"""
    from sklearn.metrics import confusion_matrix
    from sklearn.utils.multiclass import unique_labels
    import matplotlib.pyplot as plt
    from rasa_nlu.test import plot_confusion_matrix

    log_evaluation_table(test_y, "ACTION",
                         report, precision, f1, accuracy,
                         in_training_data_fraction,
                         include_report=True)

    cnf_matrix = confusion_matrix(test_y, predictions)

    plot_confusion_matrix(cnf_matrix,
                          classes=unique_labels(test_y, predictions),
                          title='Action Confusion matrix')

    fig = plt.gcf()
    fig.set_size_inches(int(20), int(20))
    fig.savefig(os.path.join(out_directory, "story_confmat.pdf"),
                bbox_inches='tight')
Plot the results of story evaluation
Plot the results of story evaluation
Plot the results of story evaluation
def plot_story_evaluation(test_y, predictions,
                          report, precision, f1, accuracy,
                          in_training_data_fraction,
                          out_directory):
    from sklearn.metrics import confusion_matrix
    from sklearn.utils.multiclass import unique_labels
    import matplotlib.pyplot as plt
    from rasa_nlu.test import plot_confusion_matrix
    log_evaluation_table(test_y, "ACTION",
                         report, precision, f1, accuracy,
                         in_training_data_fraction,
                         include_report=True)
    cnf_matrix = confusion_matrix(test_y, predictions)
    plot_confusion_matrix(cnf_matrix,
                          classes=unique_labels(test_y, predictions),
                          title='Action Confusion matrix')
    fig = plt.gcf()
    fig.set_size_inches(int(20), int(20))
    fig.savefig(os.path.join(out_directory, "story_confmat.pdf"),
                bbox_inches='tight')
def plot_story_evaluation ( test_y , predictions , report , precision , f1 , accuracy , in_training_data_fraction , out_directory ) : from sklearn . metrics import confusion_matrix from sklearn . utils . multiclass import unique_labels import matplotlib . pyplot as plt from rasa_nlu . test import plot_confusion_matrix log_evaluation_table ( test_y , "ACTION" , report , precision , f1 , accuracy , in_training_data_fraction , include_report = True ) cnf_matrix = confusion_matrix ( test_y , predictions ) plot_confusion_matrix ( cnf_matrix , classes = unique_labels ( test_y , predictions ) , title = 'Action Confusion matrix' ) fig = plt . gcf ( ) fig . set_size_inches ( int ( 20 ) , int ( 20 ) ) fig . savefig ( os . path . join ( out_directory , "story_confmat.pdf" ) , bbox_inches = 'tight' )
Plot the results of story evaluation
Plot the results of story evaluation
"""Plot the results of story evaluation"""
test_y
predictions
report
precision
f1
accuracy
in_training_data_fraction
out_directory