fix: conflict

This commit is contained in:
snsd0805 2023-11-15 20:46:06 +08:00
commit 2e6f716245
Signed by: snsd0805
GPG Key ID: 569349933C77A854

View File

@ -14,7 +14,7 @@ def read_data(filename):
y.append(int(numbers[-1]))
return x, y
def format(features):
def form(features):
'''
change to LIBSVM format
'''
@ -60,7 +60,7 @@ def transform(features):
x, y = read_data(FILENAME)
x = transform(x)
x = format(x)
x = form(x)
prob = problem(y, x)
lambda_powers = [-6, -4, -2, 0, 2]
@ -78,12 +78,13 @@ for lambda_power in lambda_powers:
ans, min_err = None, 1
for i in results:
print(i['error'])
if i['error'] <= min_err:
min_err = i['error']
ans = i
print("the largest lambda: {}, log_10(lambda*): {}".format(10**ans['lambda'], ans['lambda']))