Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
May 31, 2017
Merged

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

merged 2 commits into from
May 31, 2017

Conversation

jerneju
Copy link
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
Contributor Author

jerneju commented May 29, 2017

@jerneju
Copy link
Contributor Author

jerneju commented May 29, 2017

@jerneju
Copy link
Contributor Author

jerneju commented May 29, 2017

@jerneju
Copy link
Contributor Author

jerneju commented May 29, 2017

@jerneju
Copy link
Contributor Author

jerneju commented May 29, 2017

@@ -276,7 +276,7 @@ def get_augmented_data(self, model_names, include_attrs=True, include_prediction

# 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
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
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

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