Questions tagged [scala-breeze]

Breeze is a linear algebra library for Scala.

Breeze is a linear algebra library for Scala.

From the project's GitHub page:

Breeze is a library for numerical processing, machine learning, and natural language processing. Its primary focus is on being generic, clean, and powerful without sacrificing (much) efficiency. Breeze is the merger of the ScalaNLP and Scalala projects, because one of the original maintainers is unable to continue development.

197 questions
0
votes
1 answer

Reasons why multiplying a symmetric matrix with a diagonal matrix returns an unsymmetric matrix

I encounter a weird problem while using Breeze and I would like to know what could be the possible reasons. I have a symmetric matrix, containing only small positive values. I need to get the eigenvalues and eigenvectors of the normalized matrix…
Armand Grillet
  • 3,229
  • 5
  • 30
  • 60
0
votes
1 answer

Apache Spark - what is the best datastructure for three dimensional data

I am working on an application with an huge amount of different three-dimensional data. The 3 dimensional data are relative small (like 100 x 100 x 1000) but likely millions of these objects. Now I wonder if anyone has experience dealing such data…
kumaro
  • 29
  • 3
0
votes
1 answer

How to fit data to normal distribution using scala breeze

I am trying to fit data to normal distribution using scala breeze , python scipy alternative way is : from scipy.stats import norm mu,std = norm.fit(time1) I am looking for alternative way to do same in scala using breeze
Harshit
  • 1,207
  • 1
  • 20
  • 40
0
votes
1 answer

Scala Abstract Typing with Tabulate

I am trying to make a generic repVec function similar to Matlab's repmat function using Scala Breeze. First I tried: def repVec[T](in: DenseVector[T], nRow: Int): DenseMatrix[T] = { DenseMatrix.tabulate[T](nRow, in.size){case (_, j) =>…
evan.oman
  • 5,922
  • 22
  • 43
0
votes
1 answer

Using the kronecker product on complex matrices with scalaNLP breeze

I had a piece of code: def this(vectors: List[DenseVector[Double]]) { this(vectors.length) var resultVector = vectors.head for (vector <- vectors) { resultVector = kron(resultVector.toDenseMatrix,…
Rik Schaaf
  • 1,101
  • 2
  • 11
  • 30
0
votes
1 answer

Using scala breeze with complex datatypes

What is the best way to build a dense matrix within Breeze that is made up of object with different data types? For example how would case class X ( a1:Int, b2:Long, c3:Double, d4:Double) get mapped into a dense matrix? Is there an equivalent of…
Mark Sivill
  • 825
  • 1
  • 9
  • 18
0
votes
1 answer

Most efficient way to remove a range of rows from a DenseMatrix?

I want to remove rows M+1 through N in a DenseMatrix (DM_a below), to produce another DenseMatrix (DM_b). Something like this: K DM_a = 0 +-------------------+ | | | …
Chuck Wooters
  • 1,224
  • 8
  • 7
0
votes
1 answer

How to implements multiplication of DenseMatrix[BigDecimal] in Breeze?

My Codes are as below: val bigArrs = Array(BigDecimal(1),BigDecimal(2)) val dm = new DenseMatrix[BigDecimal](2,1,bigArrs) val cal = dm*dm.t when I compile it,I'm getting the following compilation errors: Error:(11, 15) diverging implicit expansion…
KLordy
  • 15
  • 6
0
votes
1 answer

How to add Breeze to Scala project in Eclipse?

I am new to Scala and I am trying to import a Scala project into Eclipse IDE. I am getting this error: not found: object breeze. The line of the error is: import breeze.linalg._ I have added the breeze.jar but the problem is not resolve. Can anybody…
ida
  • 1,011
  • 1
  • 9
  • 17
0
votes
1 answer

Scala: Projecting negative elements in DenseMatrix to 0

In python, if I want to set negative entries from a matrix A, I could do: A = np.max(A, 0) Is there a similar method in Scala? I have a matrix with Breeze DenseMatrix type.
jtitusj
  • 3,046
  • 3
  • 24
  • 40
0
votes
1 answer

Complex inverse and complex pseudo-inverse in Scala?

I'm considering to learn Scala for my algorithm development, but first need to know if the language has implemented (or is implementing) complex inverse and pseudo-inverse functions. I looked at the documentation (here, here), and although it states…
zanbri
  • 5,958
  • 2
  • 31
  • 41
0
votes
0 answers

Unexpected Type Mismatch While Using Scala breeze.optimize.linear.LinearProgram

Right now I am playing around with the Linear Program class in Scala Breeze and I've gotten up to the point where I am going to optimize my linear programming problem using the following code. import breeze.stats.distributions import…
0
votes
1 answer

Breeze argmax on Vector: could not find implicit value

There are plenty of other questions round the error message could not find implicit value in Scala. The answers are very specific and are not applicable to this specific issue. In Scala Breeze, I am trying to apply argmax to a SparseVector[Int].…
Carsten
  • 1,912
  • 1
  • 28
  • 55
0
votes
1 answer

Multiplying matrices using ScalaNLP and Breeze

In below method I'm attempting to multiply a DenseVector by DenseVector where one of DenseVector is method parameter : def mult(features : DenseVector[Array[Int]]) = { val dv = new DenseVector(Array(-30, 20 , 20)) features :* dv …
blue-sky
  • 51,962
  • 152
  • 427
  • 752
0
votes
1 answer

DenseMatrix from DenseVector duplications

There is apply method in DenseMatrix object that allows to construct DenseMatrix from rows (breeze 0.11.2). Like an example below: val dv:DenseVector[Double] DenseMatrix.apply[DenseVector[Double],Double]( (for(i <- 0 until dv.activeSize)yield dv)…
kokorins
  • 72
  • 7