generated from LufsX/Experiment-LogReg
This commit is contained in:
+3
-1
@@ -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]]
|
||||
|
||||
Reference in New Issue
Block a user