I'm working with Spark and Scala(new to both). I have this code:
val indices: List[Int] = List()
val featValues: List[Double] = List()
...
val vector = SparseVector(100000, indices.toArray, featValues.toArray)
But I keep getting this error:
<console>:24: error: could not find implicit value for evidence parameter of type breeze.storage.DefaultArrayValue[Any]
val vector = SparseVector(100000, indices.toArray, featValues.toArray)
I'm sure someone only familiar with Scala could help me. The documentation for SparseVector is:
I searched Google and found this: Could not find implicit value for evidence parameter of type scala.reflect.ClassManifest[T]
But I have no idea how to interpret the answers.
EDIT: I was actually importing another SparseVector from breeze while I should be importing from org.apache.spark.mllib.linalg.SparseVector.
I started the interactive shell again and entered: import org.apache.spark.mllib.linalg.SparseVector
Now I'm getting error: not found: value SparseVector
after repeating the same code above.
EDIT2: I should have been clear the "..." implied that I was initializing the lists.
def something[T: Whatever](foo: Foo)
, ordef something[T](foo: Foo)(implicit evidence: Whatever[T])
. I didn't find anything like that to do with SparseVector in the docs you linked, so I can't be sure where the problem is. None of the code you posted looks like it should need implicits, as far as I can tell. – Dylan