Skip to content

Commit

Permalink
fixing whitespace bug in loadLibSVMFile when parsing libSVM files
Browse files Browse the repository at this point in the history
  • Loading branch information
jegonzal committed Oct 29, 2014
1 parent 1559495 commit e028e84
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ object MLUtils {
.map { line =>
val items = line.split(' ')
val label = items.head.toDouble
val (indices, values) = items.tail.map { item =>
val (indices, values) = items.tail.filter( pair => !pair.isEmpty ).map { item =>
val indexAndValue = item.split(':')
val index = indexAndValue(0).toInt - 1 // Convert 1-based indices to 0-based.
val value = indexAndValue(1).toDouble
Expand Down

0 comments on commit e028e84

Please sign in to comment.