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

Amend xgb.createFolds to handle classes of a single element. #3630

Merged
merged 2 commits into from
Sep 12, 2018

Conversation

jakehoare
Copy link
Contributor

When a label contains a level with only one case I get the warning,
Warning message: In foldVector[y == dimnames(numInClass)$y[i]] <- sample(seqVector) : number of items to replace is not a multiple of replacement length
This is caused by the "undesired behaviour" as per sample documentation, so I have implemented the solution in the same documentation.

@codecov-io
Copy link

codecov-io commented Aug 24, 2018

Codecov Report

Merging #3630 into master will increase coverage by 0.09%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3630      +/-   ##
============================================
+ Coverage     50.39%   50.48%   +0.09%     
  Complexity      188      188              
============================================
  Files           172      172              
  Lines         13986    13986              
  Branches        457      457              
============================================
+ Hits           7048     7061      +13     
+ Misses         6713     6700      -13     
  Partials        225      225
Impacted Files Coverage Δ Complexity Δ
src/data/sparse_page_dmatrix.cc 94.67% <0%> (+0.59%) 0% <0%> (ø) ⬇️
src/data/sparse_page_raw_format.cc 64.15% <0%> (+22.64%) 0% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb4de52...86fdb57. Read the comment docs.

@khotilov
Copy link
Member

@jakehoare Thanks, that looks good.

@khotilov khotilov merged commit 7707982 into dmlc:master Sep 12, 2018
CodingCat pushed a commit to CodingCat/xgboost that referenced this pull request Sep 18, 2018
* Amend xgb.createFolds to handle classes of a single element.

* Fix variable name
alois-bissuel pushed a commit to criteo-forks/xgboost that referenced this pull request Dec 4, 2018
* Amend xgb.createFolds to handle classes of a single element.

* Fix variable name
@lock lock bot locked as resolved and limited conversation to collaborators Dec 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants