NoSuchMethodError: breeze.math.MutableVectorField.normImplDouble()Lbreeze/generic/UFunc$UImpl2

33 views
Skip to first unread message

Ken Kawamoto

unread,
Dec 23, 2014, 11:37:01 AM12/23/14
to scalanlp...@googlegroups.com
Hi,

I'm trying to train LogisticClassifier with Example of label Int and features DenseVector[Double], and seeing this error.

[info] Exception encountered when attempting to run a suite with class name: foo.bar.MLTest *** ABORTED ***
[info]   java.lang.NoSuchMethodError: breeze.math.MutableVectorField.normImplDouble()Lbreeze/generic/UFunc$UImpl2;
[info]   at nak.classify.LFMatrix$.space(LFMatrix.scala:313)
[info]   at nak.classify.LogisticClassifier$Trainer.train(LogisticClassifier.scala:72)


I feel I need to import a class to provide the implicit binding, but do now know which one to import.
can you advise me?
below is the code snippet. (I know it's ugly. I'm just testing...)

thanks in advance.

Ken


    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)

David Hall

unread,
Dec 29, 2014, 11:07:35 AM12/29/14
to scalanlp...@googlegroups.com
Sorry for the long delay.

You're probably mixing breeze versions, most likely because of the Nak dependency.

Ken Kawamoto

unread,
Dec 31, 2014, 5:16:55 PM12/31/14
to scalanlp...@googlegroups.com
thx David. removing breeze libraries from build.sbt (and keeping nak dependency) solves the problem.


Sent from Mailbox
Reply all
Reply to author
Forward
0 new messages