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

Maximum matrix size in Scala Breeze or other Java/Scala matrix packages?

I am trying to write a generic modelling code in Scala that relies on a grid (matrix or tensor). After much looking around, I decided to use Breeze for the matrix because (1) it's API is in Scala, which is nice, (2) it is reasonably fast for what I…
cedric
  • 11
  • 2
0
votes
1 answer

Breeze - Comparison of DenseVector gives me a BitVector - is this intentional?

import breeze.linalg._ val dm = DenseMatrix(0.0, 5.0, 6.0) dm :== 6.0 val dv = DenseVector(0.0, 5.0, 6.0) dv :== 6.0 gives me dm: breeze.linalg.DenseMatrix[Double] = 0.0 5.0 6.0 res0:…
Simon
  • 323
  • 2
  • 15
0
votes
0 answers

Symbol 'term .shapeless' is missing from the classpath. This symbol is required by 'value breeze.linalg.operators.MatrixGenericOps.v1ne'

import breeze.linalg.{*, Axis, DenseVector, argmax, convert, fliplr, flipud, kron, max} import breeze.linalg.{DenseMatrix => BDM, DenseVector => BDV} import breeze.numerics._ import java.io.File import java.util.{ArrayList, List} import…
0
votes
1 answer

How to slice SparseVector with Breeze?

I have a SparseVector in Breeze and a given list of indices. How do I get a new SparseVector containing elements present only at those indices? Eg: import breeze.linalg.{Vector => BV, DenseVector => BDV, SparseVector => BSV} val testVector = new…
Sai Kiriti Badam
  • 950
  • 16
  • 15
0
votes
1 answer

Multivariate interpolation in Scala

I need to do multivariate interpolation in Scala. I am using LinearInterpolator of breeze.interpolation but cannot find a way to pass a matrix. I wonder if anyone know if it's possible? This is what I've tried: import…
zmicer
  • 1
  • 2
0
votes
1 answer

Dense matrix for 3D-shaped objects

I am fairly new to Breeze library. I am trying to convert a 3D Array of shape (2,1,40) to a dense matrix but I am not sure if I am doing it the right way. My requirement is: A matrix with 2 rows, 1 column and each of the two rows should have 0.0…
Rahul Kumar
  • 87
  • 1
  • 12
0
votes
1 answer

Breeze Linalg - efficiently map all existing values to constant

I have a breeze.linalg.SparseVector. And I want to create a new SparseVector as an output where all values are 1 (or some other constant). How can I do it?
0
votes
1 answer

Different Equality[DenseVector] types for different numerical tolerances

I've written a scalactic equality provider for DenseVectors that uses the breeze closeTo method to check if each double in the vector is close enough. implicit val vectorEquality: Equality[DenseVector[Double]] = new Equality[DenseVector[Double]] { …
shadow chris
  • 391
  • 3
  • 13
0
votes
1 answer

java.lang.NoSuchMethodError: breeze.linalg.tile$.tile_DM_Impl2

I have a spark code that use breeze. I can se the breeze version of my project: $ gradle dependencies | grep breeze | | +--- org.scalanlp:breeze_2.11:0.12 | | | +--- org.scalanlp:breeze-macros_2.11:0.12 +---…
0
votes
1 answer

Implement elementwise UFunc in Scala Breeze

I'm trying to implement my own elementwise UFunc for a Scala Breeze matrix, so that the function can be applied to each element of a matrix. Using the Breeze.numerics package as a guide I have tried: object step extends UFunc with MappingUFunc…
LucieCBurgess
  • 759
  • 5
  • 12
  • 26
0
votes
1 answer

Using Scala Breeze numerics results in error: not enough arguments for method apply

I am developing a simple classification algorithm using Scala Breeze. I would like to use Breeze numerics to apply different functions to the matrices I'm working with, specifically sigmoid and tanh. Use of sigmoid alone is fine, but I want to…
LucieCBurgess
  • 759
  • 5
  • 12
  • 26
0
votes
1 answer

Add a vector to every column of a matrix, using Scala Breeze

I have a matrix M of (L x N) rank and I want to add the same vector v of length L to every column of the matrix. Is there a way do this please, using Scala Breeze? I tried: val H = DenseMatrix.zeros(L,N) for (j <- 0 to L) { H (::,j) = M(::,j) +…
LucieCBurgess
  • 759
  • 5
  • 12
  • 26
0
votes
2 answers

java.lang.ClassNotFoundException: breeze.generic.UFunc$UImpl2 when using Breeze DenseVector

Using Breeze I get a runtime error: Java.lang.ClassNotFoundException: breeze.generic.UFunc $ UImpl2. I can not understand what I'm wrong about, and unfortunately my online searches did not help me. Here is the code: import…
andrew
  • 1
  • 2
0
votes
1 answer

Scala Breeze does not find my file on a webserver, while Java does

I'm new to Scala, so there's probably something obvious I'm missing. I've got a Scalatra webserver running, with a csv-file in the same folder as the Scalatra servlet. The webserver recognizes the file just find, and the following…
P4nd4b0b3r1n0
  • 1,951
  • 3
  • 22
  • 31
0
votes
1 answer

Jacobian in Scala

Is there a way/library to calculate Jacobian in Scala similar to Jacobian function inside numDeriv package in R? I am using Breeze, but I was unable to find anything related to Jacobian in it. For clarity I want to do something like the following in…
Jamil
  • 61
  • 7