绘制准确率图

from matplotlib import pyplot as plt
import numpy as np
from pylab import *
mpl.rcParams['font.sans-serif'] = ['SimHei']


def plot_acc_loss_curve(acc):

    plt.figure(figsize=(8, 8))
    x = range(0, 101, 10)
    print(x)
    plt.xticks(x)
    plt.xlim(0, 100)
    plt.plot(acc, label='Accuracy')
    # plt.plot(acc_train, label='train R2 score')
    plt.legend()
    plt.grid()
    plt.xlabel("K")
    plt.show()


if __name__ == '__main__':
 
    accs = []
    plot_acc_loss_curve(accs)

你可能感兴趣的:(机器学习)