In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to write the code about python drawing light color range curve, the content of the article is of high quality, so the editor shares it for you to do a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Reference: python draws lost (loss) curve plus variance range
The above code:
Import reimport seaborn as snsimport matplotlib.pyplot as pltimport matplotlib.cm as cmimport shutilimport osimport mathsns.set_style ('whitegrid') path=r "F:\ pycharm\ class\ 20211008\ alexnet_7class_srcData.csv" # path to data # read csv file csvfile = open (path,' r') plots = csv.reader (csvfile) R1 = [] R2 = [] R3 = [] # each column of data is represented as a group and data packets are stored # row is read by row, with three data in each row Store for row in plots: r1.append (round (float (row [0]), 3)) r2.append (round (float (row [1]), 3)) r3.append (round (row [2])) ) # find the mean avg= [] for i in range (len (R1)): avg.append (round ((R1 [I] + R2 [I] + R3 [I])) # find the variance var= [] for i in range (len (R1)): var.append (R1 [I]-avg [I])) * * 2 + (R2 [I]-avg [I]) * * 2 + (R3 [I]-avg [I]) * * 2) / 3) # find the standard deviation std= [] for i in range (len (R1)): std.append (math.sqrt (var. [I])) # calculate the curve of the average +-standard deviation through this formula It is convenient for the description of the following range curve R1 = list (map (lambda x: X [0]-x [1], zip (avg, std) R2 = list (map (lambda x: X [0] + x [1], zip (avg, std)) plt.rcParams ["figure.figsize"] = (155,10) plt.plot (R1) plt.plot (R2) plt.legend (['range curve'], fontsize=30) plt.xticks (fontsize=20) plt.yticks (fontsize=20) plt.xlabel ('Epoch Number' Fontsize=20) plt.ylabel ('Accuracy',fontsize=20) plt.ylim (0,20) plt.show ()
# Abscissa due to the fill_between function x = [] for i in range (300): x.append (iSome1) # import matplotlib.pyplot as pltplt.rcParams ["figure.figsize"] = (15LJ 10) plt.plot (avg) plt.fill_between (x journal R1, R2, color=cm.viridis, alpha=0.2) plt.legend (['avg'], fontsize=30) plt.xticks (fontsize=20) plt.yticks (fontsize=20) plt.xlabel (' Epoch Number',fontsize=20) plt.ylabel ('Accuracy') Fontsize=20) plt.ylim (0,20) plt.show () how to write the code for python to draw a light range curve is shared here. I hope the above content can be of some help to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.