Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,8 +1078,9 @@ def cross_validation(learner, size, dataset, k=10, trials=1):
fold_errV = 0
n = len(dataset.examples)
examples = dataset.examples
random.shuffle(dataset.examples)
for fold in range(k):
random.shuffle(dataset.examples)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the empty line here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check #1028

train_data, val_data = train_test_split(dataset, fold * (n / k),
(fold + 1) * (n / k))
dataset.examples = train_data
Expand Down