I'm trying to train LogisticClassifier with Example of label Int and features DenseVector[Double], and seeing this error.
I feel I need to import a class to provide the implicit binding, but do now know which one to import.
below is the code snippet. (I know it's ugly. I'm just testing...)
thanks in advance.
val examples: MutableList[Example[Int, DenseVector[Double]]] = new MutableList()
for (m <- 0 until X.getM) {
val features: Array[Double] = Array.empty
for (n <- 0 until X.getN) {
features :+ X.get(m, n).doubleValue
}
examples += Example(y.get(m, 0).toInt, DenseVector(features))
}
val opt = new OptParams(
maxIterations=60,
useStochastic=false,
useL1=true)
val classifier = new LogisticClassifier.Trainer[Int, DenseVector[Double]](opt).train(examples)