admin管理员组文章数量:1794759
facilitate the processes adjusting related parameters by easy.py
execute the easy.py in Linux
reference link
f=open("a1a.t","r", encoding = 'utf-8',errors='ignore') cout_1 = 0 cout = 0 for line in f: cout += 1 if (line.split(' ')[0] == "+1"): cout_1 += 1 print("cout = %d" % (cout-cout_1) + "\\n") print("cout_1 = %d " % cout_1 + "\\n")above codes could let you know the different labels amount with “+1” or “-1”
f=open("a1a.t.predict","r", encoding = 'utf-8',errors='ignore') cout_1 = 0 cout = 30956 lines = f.readlines() cout_1 = lines.count('1\\n') print("cout_2 = {}".format(cout -cout_1) + "\\n") print("cout_1 = %d " % cout_1 + "\\n")obtain the prediction classfication numbers
step_1 just download two database files svmguide1 and svmguide1.t into a file containing easy.py liking following: step_2 use command python3 easy.py svmguide1 svmguide1.t and I just got the followign mistakes: the solutions to handle the above problems: sudo apt install python-is-python3 but as follows is also a mistake: it’s very mysterious for me. When I just restart my computer and I run this codespython easy.py a1a a1a.t python easy.py a1a a1a.t Scaling training data... WARNING: original #nonzeros 22249 > new #nonzeros 181365 If feature values are non-negative and sparse, use -l 0 rather than the default -l -1 Cross validation... Best c=512.0, g=3.0517578125e-05 CV rate=83.3022 Training... Output model: a1a.model Scaling testing data... WARNING: feature index 12 appeared in file a1a.t was not seen in the scaling factor file a1a.range. The feature is scaled to 0. WARNING: feature index 60 appeared in file a1a.t was not seen in the scaling factor file a1a.range. The feature is scaled to 0. WARNING: feature index 89 appeared in file a1a.t was not seen in the scaling factor file a1a.range. The feature is scaled to 0. WARNING: feature index 96 appeared in file a1a.t was not seen in the scaling factor file a1a.range. The feature is scaled to 0. WARNING: feature index 111 appeared in file a1a.t was not seen in the scaling factor file a1a.range. The feature is scaled to 0. WARNING: feature index 116 appeared in file a1a.t was not seen in the scaling factor file a1a.range. The feature is scaled to 0. WARNING: feature index 120 appeared in file a1a.t was not seen in the scaling factor file a1a.range. The feature is scaled to 0. WARNING: feature index 121 appeared in file a1a.t was not seen in the scaling factor file a1a.range. The feature is scaled to 0. WARNING: feature index 122 appeared in file a1a.t was not seen in the scaling factor file a1a.range. The feature is scaled to 0. WARNING: feature index 123 appeared in file a1a.t was not seen in the scaling factor file a1a.range. The feature is scaled to 0. WARNING: original #nonzeros 429343 > new #nonzeros 3498028 If feature values are non-negative and sparse, use -l 0 rather than the default -l -1 Testing... Accuracy = 84.3358% (26107/30956) (classification) Output prediction: a1a.t.predict execute the file easy.py in windows本文标签: adjustingprocessesfacilitaterelatedpy
版权声明:本文标题:facilitate the processes adjusting related parameters by easy.py 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686986865a125735.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论