-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot.py
27 lines (21 loc) · 3.72 KB
/
plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import matplotlib.pyplot as plt
####### 代表値とCos類似度、特徴度をグラフで見る #######
# データは共に昇順にする
# x軸:行数
# y軸:TF-IDF値, Cos類似度
tfidf_lst = [1.9667992271204784, 2.591822552582422, 2.045015512041656, 2.1299159398958336, 2.06098496874387, 1.8998779557141419, 2.0028707658249836, 2.4877344232141776, 3.2532741618555345, 3.173494346654401, 1.9205837044857206, 2.049370974725729, 1.7410959206825443, 1.8849664713842709, 1.5280234254229965, 2.2913977696392607, 2.252279852063889, 2.118832336583693, 1.9575223854684025, 2.003897302537178, 2.653290559207073, 1.8193914744348443, 1.7732937403896174, 2.2135682127243643, 1.9762067464095074, 1.7514289980441153, 2.5492585798058762, 1.5695357518825417, 1.541607379788575, 1.8670251956714308, 2.378570466814835, 2.2729464992260158, 2.079246270477468, 2.5118758614046492, 2.17469541809578, 2.3396546245725993, 2.610712997977671, 1.7188744533967153, 1.3050631821194816, 1.8484683695752968, 1.7750830611123205, 1.9797016919725061, 1.8778180742859794, 1.9548739869009242, 2.004414122911752, 2.2114448014869055, 2.1751356955874686, 1.4854734663366256, 1.8572504345719025, 2.319263291702923, 2.3195344223287457, 2.494241775422231, 2.108064484480294, 2.3988956112129767]
cosSim_lst = [0.013241043928080606, 0.012337123030611533, 0.012205359855835164, 0.013886740474627346, 0.013953924746498194, 0.008346196314977574, 0.01222211982937253, 0.012637863137902397, 0.008889772886601439, 0.008678896487067805, 0.011843965285500791, 0.011996732287047633, 0.012308054084442485, 0.00851426003273776, 0.008528675428987198, 0.010793339466708303, 0.011818350277155443, 0.00887245376692676, 0.00652208540652069, 0.009414365775346182, 0.010851443743241455, 0.01328282287506862, 0.01077795364005284, 0.009481695559416022, 0.009146195883803035, 0.011222094227042477, 0.01308005018695443, 0.010166201890271644, 0.009285011641238182, 0.012175888699745561, 0.011332446726702741, 0.01234342931617419, 0.010674446075734282, 0.010673227270481702, 0.011460567877735172, 0.012262564982271318, 0.010428440040656729, 0.00891607209511916, 0.007839877988556003, 0.012686037309488349, 0.010987626469307019, 0.012538616781906617, 0.011492694141353668, 0.01357576276766417, 0.012781359095883545, 0.01204663801964164, 0.01272515716042629, 0.009083643586297922, 0.009693018662625277, 0.01112895216214567, 0.013002554197315748, 0.012663881357823504, 0.010847858214557072, 0.01851851851851852]
ap_lst = [1.9407567521564613, 2.559846918877699, 2.0200553618064228, 2.100338350005728, 2.032226139586354, 1.8840212013212534, 1.9783914393223236, 2.4562947760501483, 3.2243532934187904, 3.145951917717493, 1.8978363777618932, 2.0247852197850986, 1.7196664179245813, 1.868917376693913, 1.5149914095796746, 2.2666659356582857, 2.225661619850018, 2.1000330946374848, 1.9447552572852016, 1.9850318803548632, 2.6244985259693636, 1.7952248197395162, 1.7541812626655022, 2.1925798328313113, 1.958131972399953, 1.7317742967960896, 2.5159141496424913, 1.5535795345549046, 1.5272935373210195, 1.8442925046893148, 2.3516154437139476, 2.244890544773374, 2.0570514682850845, 2.4850660394606403, 2.1497721736432935, 2.310964457702706, 2.583487334014898, 1.7035488448477716, 1.2948316460043081, 1.8250186308734555, 1.7555791114848243, 1.9548789711143708, 1.8562368855051048, 1.9283350814140794, 1.9787949862299565, 2.184804326462974, 2.1474567520158647, 1.4719799548115213, 1.839248071448428, 2.2934523214781404, 2.289374550289877, 2.462654993500557, 2.0851964998455084, 2.3544716184127363]
x = [i for i in range(len(ap_lst))]
print(len(tfidf_lst))
print(len(cosSim_lst))
print(len(ap_lst))
print(len(x))
list.sort(tfidf_lst)
list.sort(cosSim_lst)
list.sort(ap_lst)
plt.plot(x, tfidf_lst)
plt.title("TF-IDF")
plt.xlabel("row (ascending order)")
plt.grid()
plt.show()