We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1559495 commit e028e84Copy full SHA for e028e84
mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala
@@ -76,7 +76,7 @@ object MLUtils {
76
.map { line =>
77
val items = line.split(' ')
78
val label = items.head.toDouble
79
- val (indices, values) = items.tail.map { item =>
+ val (indices, values) = items.tail.filter( pair => !pair.isEmpty ).map { item =>
80
val indexAndValue = item.split(':')
81
val index = indexAndValue(0).toInt - 1 // Convert 1-based indices to 0-based.
82
val value = indexAndValue(1).toDouble
0 commit comments