[Python | matplotlib] 간단 한 작도: 산 점도, 막대 그래프, 주파수 분포 직사 도
결정 트 리 (회귀) 결과 작도 의 예:http://scikit-learn.org/stable/auto_examples/tree/plot_tree_regression.html#sphx-glr-auto-examples-tree-plot-tree-regression-py
자신 이 사용 하 는:
import matplotlib.pyplot as plt
def draw(y,yy,title,path):
print(title)
index = np.arange(0,len(y),1)
plt.scatter(index,y,color='cornflowerblue',label='true')#
plt.plot(index,yy,color='yellowgreen',label='predict')#
plt.xlabel('index')
plt.ylabel('cost')
plt.title(title)#
plt.legend()#
plt.savefig(path+title+'.png')
plt.show()
rate = []
fig, ax = plt.subplots()
for i in range(0,len(x)):
rate.append((yy[i]-y[i])/y[i])
rate.sort()
plt.bar(index,rate)#
plt.title(title+' Error')
plt.savefig(path+title+'_error.png')
plt.show()
plt.title(title+' Error hist')
plt.hist(rate)#
plt.savefig(path+title+'_errorHist.png')
plt.show()
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Apache CouchDB 로 의료 시각 화 데 이 터 를 저장 합 니 다.js 로 의료 데 이 터 를 시각 화 하 는 데 시간 이 걸 렸 고 사용 하 는 데 이 터 는 국가 위생 과 출산 계획 위원회 통계 정보 센터 사이트 에서 나 왔 다.간편 하 게 관련 데 이 터 를 JSON 형식 으...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.