fix: conflict
This commit is contained in:
commit
2e6f716245
@ -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']))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user