scalanlp / breeze

Breeze is/was a numerical processing library for Scala.
https://www.scalanlp.org
Apache License 2.0
3.45k stars 692 forks source link

could not find implicit value for parameter impl: breeze.linalg.svd.Impl[Unit,VR] #716

Closed XiaodanLi123 closed 3 years ago

XiaodanLi123 commented 6 years ago

def pca(data: DenseMatrix[Double], components: Int) = { val d = zeroMean(data) //val (, , v) = breeze.linalg.svd(d.t) val SVD(, , v) = svd(d.t) val model = v(0 until components, ::) //top 'components' eigenvectors println(model) }

UserPatternDetection/UserPatternAnomalyTest.scala:14: could not find implicit value for parameter impl: breeze.linalg.svd.Impl[Unit,VR]

josecponce commented 6 years ago

@XiaodanLi123 where is that zeroMean function coming from? It looks like d.t is not a matrix (it's a Unit/void type instead). Please make sure that d.t is a matrix.