Skip to content

[FIX] Test & Learn: number of folds causes many errors#2348

Merged
kernc merged 2 commits into
biolab:masterfrom
jerneju:various-testlearners
May 31, 2017
Merged

[FIX] Test & Learn: number of folds causes many errors#2348
kernc merged 2 commits into
biolab:masterfrom
jerneju:various-testlearners

Conversation

@jerneju
Copy link
Copy Markdown
Contributor

@jerneju jerneju commented May 29, 2017

@jerneju jerneju changed the title Test & Learn: number of folds causes many errors [WIP][FIX]Test & Learn: number of folds causes many errors May 29, 2017
@jerneju
Copy link
Copy Markdown
Contributor Author

jerneju commented May 29, 2017

@jerneju
Copy link
Copy Markdown
Contributor Author

jerneju commented May 29, 2017

@jerneju
Copy link
Copy Markdown
Contributor Author

jerneju commented May 29, 2017

@jerneju
Copy link
Copy Markdown
Contributor Author

jerneju commented May 29, 2017

@jerneju
Copy link
Copy Markdown
Contributor Author

jerneju commented May 29, 2017

Comment thread Orange/evaluation/testing.py Outdated
# add fold info
if self.folds is not None:
new_meta_attr.append(DiscreteVariable(name="Fold", values=[i+1 for i, s in enumerate(self.folds)]))
new_meta_attr.append(DiscreteVariable(name="Fold", values=[str(i+1) for i, s in enumerate(self.folds)]))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

# alternatives
[str(i) for i, _ in enumerate(self.folds, 1)]
[str(i) for i in range(1, len(self.folds) + 1)]
np.arange(1, len(self.folds) + 1, dtype=str).tolist()

Copy link
Copy Markdown
Contributor Author

@jerneju jerneju May 29, 2017

Choose a reason for hiding this comment

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

@kernc

# the second alternative below is the fastest:
[i+1 for i, s in enumerate(self.folds)]  # 0.957
[i+1 for i, _ in enumerate(self.folds)]  # 0.916
[str(i) for i, _ in enumerate(self.folds, 1)]  # 2.527
[str(i) for i in range(1, len(self.folds) + 1)]  # 2.417
np.arange(1, len(self.folds) + 1, dtype=str).tolist()  # does not work

@codecov-io
Copy link
Copy Markdown

codecov-io commented May 29, 2017

Codecov Report

Merging #2348 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2348      +/-   ##
==========================================
- Coverage   73.29%   73.28%   -0.01%     
==========================================
  Files         317      317              
  Lines       55474    55474              
==========================================
- Hits        40658    40655       -3     
- Misses      14816    14819       +3

@jerneju jerneju changed the title [WIP][FIX]Test & Learn: number of folds causes many errors [FIX]Test & Learn: number of folds causes many errors May 30, 2017
@jerneju jerneju changed the title [FIX]Test & Learn: number of folds causes many errors [FIX] Test & Learn: number of folds causes many errors May 30, 2017
@kernc kernc merged commit 8bb2491 into biolab:master May 31, 2017
@jerneju jerneju deleted the various-testlearners branch May 31, 2017 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants