Skip to content

Commit

Permalink
add require for one-based in loadLIBSVM
Browse files Browse the repository at this point in the history
  • Loading branch information
hhbyyh committed May 31, 2015
1 parent 97a60cf commit 5bd1f9a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ object MLUtils {
val value = indexAndValue(1).toDouble
(index, value)
}.unzip
require(indices.size == 0 || indices(0) >= 0,
"indices should be one-based in LIBSVM format")
(label, indices.toArray, values.toArray)
}

Expand Down

0 comments on commit 5bd1f9a

Please sign in to comment.