更新 function.py
Gitea Actions Experiment Test / Experiment-Actions (push) Successful in 31s

This commit is contained in:
2024-11-02 16:04:42 +08:00
parent 5af2a8e163
commit d56dda8fbb
+3 -1
View File
@@ -68,7 +68,9 @@ def predict_logreg(X, weights):
def load_data(filepath):
data, labels = [], []
with open(filepath, 'r') as f:
for line in f:
for i, line in enumerate(f):
if i in [2] or (24 <= i <= 28): # 剔除第3行和第24-28行
continue
line = line.strip().split()
if len(line) >= 1 and line[-1].isdigit():
line_data = [0 if x == '?' else float(x) for x in line[:-1]]