赞
踩
1.添加作者信息
- Settings->Editor->File and Code Templates ->Python Script
- # Time : ${DATE} ${TIME}
- # Work:
1.主题设置github,表格可视化效果更强
2.窗口样式可置为一体化,效果与Microsoft类似
- # Time : 2019/2/24 22:19
- # Work: 将0-1分类的正确答案和人工标注后,由SVM生成的result进行对比看看正确率是否是76%
-
- import numpy as np
- from numpy import array
- from numpy.random import normal
- from matplotlib import pyplot
- import matplotlib.pyplot as plt
- import pandas as pd
- accuracylist = []
- axes_x = range(11)
-
- # answer
- loadcorrectAns = pd.read_csv('label_turn_-1.txt', sep='\s+')
- loadcorrectAns.shape
- correctAns = loadcorrectAns['answer']
-
- # result 10 turns
- for i in range(11):
- name_before = 'label_turn_'
- name_after = '.txt'
- number = str(i)
- loadres = pd.read_csv(name_before+number+name_after, sep='\s+')
- loadres.shape
- res = loadres['result']
- Accuracy_rate = 0
- for j in range(10604):
- if res[j] == correctAns[j]:
- Accuracy_rate = Accuracy_rate + 1.0
- Accuracy_rate = Accuracy_rate / 10604
- accuracylist.append(Accuracy_rate)
-
- plt.plot(axes_x, accuracylist)
- plt.xlabel('Turns')
- plt.ylabel('Accuracy')
- plt.title('Accuracy / turns')
- plt.show()

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。