<gh_stars>0
# -*- coding: utf-8 -*-
"""
    Created by: <NAME>
    Version: 1.0.0
    Created on: Oct 07, 2021
    Updated on: Oct 19, 2021
    Description: Plot library.
"""

# Import Python base libraries
import numpy as np
import matplotlib.pyplot as plt

# Plot confusion matrix
def plot_confusion_matrix(matrix):
    """If you prefer color and a colorbar"""
    fig = plt.figure(figsize=(8,8))
    ax = fig.add_subplot(111)
    cax = ax.matshow(matrix, cmap=plt.cm.gray)
    fig.colorbar(cax)
    plt.show()

# Plot ROC curve
def plot_roc_curve(fpr, tpr, recall_90_precision, label=None):
    plt.figure(figsize=(8, 6))
    plt.plot(fpr, tpr, linewidth=2, label=label)
    plt.plot([0, 1], [0, 1], 'k--')
    plt.axis([0, 1, 0, 1])
    plt.xlabel('False Positive Rate (Fall-Out)', fontsize=16)
    plt.ylabel('True Positive Rate (Recall)', fontsize=16)
    plt.grid(True)
    fpr_90 = fpr[np.argmax(tpr >= recall_90_precision)]
    plt.plot([fpr_90, fpr_90], [0., recall_90_precision], "r:")
    plt.plot([0.0, fpr_90], [recall_90_precision, recall_90_precision], "r:")
    plt.plot([fpr_90], [recall_90_precision], "ro")
    plt.show()

# -*- coding: utf-8 -*-
"""
    Created by: <NAME>
    Version: 1.0.0
    Created on: Oct 07, 2021
    Updated on: Oct 19, 2021
    Description: Plot library.
"""

# Import Python base libraries
import numpy as np
import matplotlib.pyplot as plt

# Plot confusion matrix
def plot_confusion_matrix(matrix):
    """If you prefer color and a colorbar"""
    fig = plt.figure(figsize=(8,8))
    ax = fig.add_subplot(111)
    cax = ax.matshow(matrix, cmap=plt.cm.gray)
    fig.colorbar(cax)
    plt.show()

# Plot ROC curve
def plot_roc_curve(fpr, tpr, recall_90_precision, label=None):
    plt.figure(figsize=(8, 6))
    plt.plot(fpr, tpr, linewidth=2, label=label)
    plt.plot([0, 1], [0, 1], 'k--')
    plt.axis([0, 1, 0, 1])
    plt.xlabel('False Positive Rate (Fall-Out)', fontsize=16)
    plt.ylabel('True Positive Rate (Recall)', fontsize=16)
    plt.grid(True)
    fpr_90 = fpr[np.argmax(tpr >= recall_90_precision)]
    plt.plot([fpr_90, fpr_90], [0., recall_90_precision], "r:")
    plt.plot([0.0, fpr_90], [recall_90_precision, recall_90_precision], "r:")
    plt.plot([fpr_90], [recall_90_precision], "ro")
    plt.show()
# -*- coding: utf-8 -*- Created by: <NAME>     Version: 1.0.0     Created on: Oct 07, 2021     Updated on: Oct 19, 2021     Description: Plot library. # Import Python base libraries # Plot confusion matrix If you prefer color and a colorbar # Plot ROC curve