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
1
vote
1 answer

Breeze Linear Algebra with custom data type

I'm trying to implement Humming coding using Breeze Linear Algebra package (https://github.com/scalanlp/breeze) and my own data type that represents GF2 field. So far I was successfully able to implement my GF2: package humming trait GF2 { def +…
src091
  • 2,807
  • 7
  • 44
  • 74
1
vote
0 answers

Scala: wrapper for Breeze DenseMatrix for column and row referencing

I am new to Scala. Looking at it as an alternative to MATLAB for some applications. I would like to program in Scala a wrapping class in order to be able to assign column names ("QuantityQ" && "QuantityP" -> Range) and row names (dates -> Range) to…
NoIdeaHowToFixThis
  • 4,484
  • 2
  • 34
  • 69
1
vote
1 answer

Scala: Breeze (scalanlp.org) syntax?

Please help to understand the following example of Breeze usage. The code below has both Scala object method invocations, such as f.subplot(0) , f.saveas etc., as well as function calls: linspace(0.0,1.0) , plot(x, x :^ 2.0). As usual, object…
Anton Ashanin
  • 1,817
  • 5
  • 30
  • 43
0
votes
0 answers

Apply function on two breeze matrices

I would like to apply a function on two matrices like there is a + for the addition of two matrices. Something like matrix1.map2(matrix2) { (valM1, valM2) => valM1 + valM2 } giving a result matrix.
Sven
  • 85
  • 2
  • 9
0
votes
1 answer

Compute softmax using breeze

I am constructing a deep neural network from scratch and I want to implement the softmax http://neuralnetworksanddeeplearning.com/chap3.html#softmax distributed function. I am using breeze for that but it is not working as expected. The…
ezl
  • 23
  • 4
0
votes
1 answer

Generating same set of random DenseVector from Apache dictributions - Breeze

I am trying to generate a repeatable random DenseVector for a number of distributions. For the native Breeze distributions (Gaussian, Uniform), this is what I am doing: implicit val randBasis = RandBasis.withSeed(2022) // For uniform val…
Samik R
  • 1,636
  • 3
  • 15
  • 33
0
votes
2 answers

Can't create Breeze DenseMatrix with Scala3

When trying to create a dense matrix of type Option with Scala 3 I receive an error. val dm1 = DenseMatrix((1,2),(1,2)) // <- this works val dm2 = DenseMatrix((Some(1),Some(2)),(Some(1),Some(2))) <- doesn't work Error: no implicit argument…
Sven
  • 85
  • 2
  • 9
0
votes
1 answer

Problem with evidence parameters in breeze

I'm trying to build a DenseMatrix of Vectors in breeze. However I keep getting the error message: could not find implicit value for evidence parameter of type breeze.storage.Zero[breeze.linalg.DenseVector[Double]] for the line: val som:…
Steve Gailey
  • 129
  • 1
  • 10
0
votes
1 answer

Scala breeze error: could not find implicit value for parameter

I'm using the breeze package on scala. I simply want do to a matrix product: A*At. However I get this error: could not find implicit value for parameter op:…
0
votes
1 answer

Does anyone knows how to create a DenseVector[Double] using Breeze library in scala

I want to create data that have a form of List[DenseVector[Double]] using scala and Breeze library. The initial data are loaded with json4s, so they have a form of List(Jarray(JDouble) does anyone have any idea ?
Reda20
  • 53
  • 5
0
votes
1 answer

Generic method that take as input Breeze Vector or Breeze Matrix

I am trying to implement a method that can accept as input either a Breeze Vector or a Breeze Matrix. Something like private def updateExponentialMovingAverage[T](tau: Double, initTheta: T, theta: T): T = { tau * theta + (1 - tau) * initTheta …
amarchin
  • 2,044
  • 1
  • 16
  • 32
0
votes
0 answers

how DenseVector to convert to DenseMatrix

I have data for N rows xM rows DenseVector[DenseVector[Double]] (or DenseMatrix[DenseMatrix[Double]]) and want to convert this object into an NxM's DenseMatrix object DenseVector(DenseVector(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0), DenseVector(11.0,…
lemanli
  • 119
  • 1
  • 1
  • 7
0
votes
1 answer

Adding Sparse Vectors 3.0.0 Apache Spark Scala

I am trying to create a function as the following to add two org.apache.spark.ml.linalg.Vector. or i.e two sparse vectors This vector could look as the…
Sajeed
  • 119
  • 10
0
votes
1 answer

How to convert breeze densevector to seq or array

I need to convert breeze Densevector to seq or array so that I can use zipWithIndex to get index of each element.
Jack Chen
  • 77
  • 7
0
votes
1 answer

Maximize a exponential equation using scalanlp breeze optmize library

I have a formula (known as Chritoffersen test) like this: ∑(1-C(i) )(log⁡(a * b * D(i)^(b-1))-1)) where a = ∑(1 - C(i)/∑D(i)^b and b is double value The summation is over i from 1 to n ( +ve integer) and C &…