代码拉取完成,页面将自动刷新
同步操作将从 Fu_Yanbo/双色球预测 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
from datetime import datetime
import yaml
def ReadConfigs(yaml_path="./configs.yaml"):
with open(yaml_path, 'r') as file:
configs = yaml.load(file, Loader=yaml.FullLoader)
return configs
def WriteArray(my_array, file_name):
with open(file_name, 'w') as f:
for i in my_array:
for j in i:
f.write(str(j))
f.write(' ')
f.write('\n')
f.close()
def ReadIntArray(file_name):
file = open(file_name, mode='r', encoding='UTF-8')
my_array = []
contents = file.readlines()
for msg in contents:
msg = msg.strip('\n')
msg = msg.strip()
adm = msg.split(' ')
adm = [int(x) for x in adm]
my_array.append(adm)
file.close()
return my_array
def ReadFloatArray(file_name):
file = open(file_name, mode='r', encoding='UTF-8')
my_array = []
contents = file.readlines()
for msg in contents:
msg = msg.strip('\n')
msg = msg.strip()
adm = msg.split(' ')
adm = [float(x) for x in adm]
my_array.append(adm)
file.close()
return my_array
def afterList(index):
my_list = []
for i in range(1, 34):
if i in index:
my_list.append(1)
else:
my_list.append(0)
return my_list
def OneHotData(data):
data1 = []
length = len(data)
for i in range(length):
a = afterList(data[i])
data1.append(a)
return data1
def GetConfusionMatrix(list1, list2):
TP = 0
FP = 0
TN = 0
FN = 0
for i in range(list1.numel()):
if (list1[i] == list2[i]) and (list2[i] == 0):
TP += 1
elif (list1[i] == list2[i]) and (list2[i] == 1):
TN += 1
elif (list1[i] != list2[i]) and (list2[i] == 0):
FP += 1
elif (list1[i] != list2[i]) and (list2[i] == 1):
FN += 1
return TP, FP, TN, FN
def PrintLog(message):
t = datetime.now().strftime("%d/%m/%y - %H:%M:%S")
print(f"({t}): {message}")
# unfinished.
def GetParamList():
param_lists = []
for index in range(1, 34):
param_name = 'param/param_' + str(index) + '.txt'
tmp_list1 = ReadFloatArray(param_name)
[list1] = tmp_list1
param_lists.append(list1)
return param_lists
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。