Skip to content

Commit

Permalink
aimacode#995 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishgit7 committed Dec 20, 2018
1 parent 4eebaca commit 8a3dd93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,10 +1078,11 @@ def cross_validation(learner, size, dataset, k=10, trials=1):
fold_errV = 0
n = len(dataset.examples)
examples = dataset.examples
for fold in range(k):
random.shuffle(dataset.examples)
random.shuffle(dataset.examples)
for fold in range(k)
train_data, val_data = train_test_split(dataset, fold * (n / k),
(fold + 1) * (n / k))
random.shuffle(train_data)
dataset.examples = train_data
h = learner(dataset, size)
fold_errT += err_ratio(h, dataset, train_data)
Expand Down

0 comments on commit 8a3dd93

Please sign in to comment.