2024-05-14 09:38:35 +00:00
|
|
|
import file_load
|
2024-05-14 09:18:57 +00:00
|
|
|
|
2024-05-13 20:50:01 +00:00
|
|
|
import json
|
2024-05-14 04:08:37 +00:00
|
|
|
import os
|
2024-05-13 20:50:01 +00:00
|
|
|
|
2024-05-14 14:46:44 +00:00
|
|
|
import numpy
|
|
|
|
|
|
|
|
# file_load.make_data()
|
2024-05-14 05:04:54 +00:00
|
|
|
|
2024-05-14 09:38:35 +00:00
|
|
|
similarity = file_load.similarity()
|
2024-05-14 14:46:44 +00:00
|
|
|
corelation = file_load.corelation()
|
|
|
|
|
|
|
|
table = {}
|
|
|
|
|
|
|
|
for i in corelation:
|
|
|
|
table[i["from"],i["to"]]=i["psr"]
|
|
|
|
|
|
|
|
x=[]
|
|
|
|
y=[]
|
2024-05-13 20:50:01 +00:00
|
|
|
|
2024-05-14 09:38:35 +00:00
|
|
|
for i in similarity:
|
2024-05-14 14:46:44 +00:00
|
|
|
x.append(abs(table[i["from"],i["to"]]))
|
|
|
|
y.append(i["similarity"])
|
|
|
|
|
|
|
|
print(numpy.corrcoef(x,y)[0,1])
|
|
|
|
|
|
|
|
s="similarity, corelation\n"
|
|
|
|
for i in similarity:
|
|
|
|
s+=str(i["similarity"])+','+str(table[i["from"],i["to"]])+'\n'
|
|
|
|
with open("Temp/point.csv","w") as point:
|
|
|
|
point.write(s)
|
|
|
|
|