forked from organicmaps/organicmaps
Review fixes.
This commit is contained in:
parent
95d18f17e6
commit
6bfa4af397
1 changed files with 2 additions and 2 deletions
|
@ -94,7 +94,7 @@ def transform_data(data):
|
|||
relevances = np.array(data.ix[indices]['Relevance'])
|
||||
|
||||
n, total = len(indices), 0
|
||||
for k, (i, j) in enumerate(itertools.combinations(range(n), 2)):
|
||||
for _, (i, j) in enumerate(itertools.combinations(range(n), 2)):
|
||||
y = np.sign(relevances[j] - relevances[i])
|
||||
if y == 0:
|
||||
continue
|
||||
|
@ -118,7 +118,7 @@ def main(args):
|
|||
clf = svm.LinearSVC(random_state=args.seed)
|
||||
cv = cross_validation.KFold(len(y), n_folds=5, shuffle=True, random_state=args.seed)
|
||||
|
||||
# Let's find regularizer by a grid search.
|
||||
# "C" stands for the regularizer constant.
|
||||
grid = {'C': np.power(10.0, np.arange(-5, 6))}
|
||||
gs = grid_search.GridSearchCV(clf, grid, scoring='accuracy', cv=cv)
|
||||
gs.fit(x, y)
|
||||
|
|
Loading…
Add table
Reference in a new issue