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

SGD with L2 regularization in mllib

I am having difficulty reading open source mllib code for SGD with L2 regularization. The code is class SquaredL2Updater extends Updater { override def compute( weightsOld: Vector, gradient: Vector, stepSize: Double, iter: Int, regParam:…
bhomass
  • 3,414
  • 8
  • 45
  • 75
0
votes
3 answers

scala breeze matrix of random normal values

I want the same result that is obtained in python with x=np.random.normal(0, 1, (n_samples, n_features)) I have tried: import breeze.linalg._ object HelloWorld { def main(args: Array[String]) { println("Start") val n_samples = 5 val…
Donbeo
  • 17,067
  • 37
  • 114
  • 188
0
votes
1 answer

QuadraticMinimizer always returns a non-sensical answer

I'm having trouble with the QuadraticMinimizer- every time I execute it I get errors that are non-sensical. I've looked at the scaladoc and the code and I am just not sure what I am doing incorrectly. I have the following code: val…
Steven Fines
  • 467
  • 4
  • 14
0
votes
1 answer

How does binary encoding in HBase work?

I'm saving breeze SparseVectors to HBase using com.twitter.chill.KryoInjection for serialization to byte array which seemed to work fine. But then I recognized that after reading the vectors back out of HBase some values are different/missing. Now…
0
votes
1 answer

How to add the Breeze which is build by myself to Apache Spark?

I added some methods to the Breeze library and I can see those methods through IDE. And I was trying to add the Breeze library which is build by myself to my project which is based on Apache Spark. However, when I package my project by command "sbt…
Mark
  • 369
  • 1
  • 3
  • 5
0
votes
1 answer

Breeze change DenseMatrix using vector decomposition

Code below generates a 0-1 matrix, changes every odd row and composes a new matrix. I want to concat the vectors using foldLeft but I get Not all matrices have the same number of columns, probably because zero (or unit) element of foldLeft is an…
Stephan Rozinsky
  • 553
  • 2
  • 6
  • 21
0
votes
2 answers

scala module after sbt installation

May I ask some newbie question here: My goal is to use Breeze module (0.10) in Scala (2.11.5), and I follow: $ sbt set scalaVersion := "2.10.3" // or 2.11.3 set libraryDependencies += "org.scalanlp" %% "breeze" % "0.10" set resolvers += "Sonatype…
Richard Liu
  • 203
  • 5
  • 14
0
votes
1 answer

Broadcasting in Breeze CSCMatrix?

Is it possible to use broadcasting in Breeze CSCMatrix objects? On a DenseMatrix m, broadcasting works like the following: sum(m(::, *) However, the same operation on a CSCMatrix m yields this error: scala> sum(m(0 to m.rows - 1, *)) :15:…
Carsten
  • 1,912
  • 1
  • 28
  • 55
0
votes
1 answer

Breeze linear algebra probability distribution

I am studying statistics and probability (aleks.com) and they have an online calculator that calculates probabilities of a standard normal random variable. example: P(Z > 1.26) However, I am also learning to use the Breeze linear algebra Scala…
Richard Walker
  • 187
  • 1
  • 2
  • 11
0
votes
1 answer

Scala + Breeze - How to operate on indexed elements?

I would like to perform an element-wise operation like: matrixOne(indices) :*= matrixTwo(indices) i.e. matrixOne(indices) = matrixOne(indices) :* matrixTwo(indices) Although I don't believe that syntax works, and I don't see an easy way of doing…
joebuild
  • 536
  • 6
  • 19
0
votes
2 answers

Create a Scala class/object and serialize it

I need to save/serialize three data structures [viz., one DenseVector, one DenseMatrix and one double] at the same time and subsequently retrieve those. Probably I need to create a class in Scala with these three members, create an object and…
0
votes
1 answer

How to slice on arbitrary indices with breeze?

In Python's numpy, I can do this: >>> import numpy as np >>> m = np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]]) >>> indices = [1,3] >>> m[:,indices] array([[ 2, 4], [ 6, 8], [10, 12]]) In other words, I can slice based on an arbitrary…
Mark
  • 1,788
  • 1
  • 22
  • 21
0
votes
1 answer

Scala Breeze DenseVector Implicit failure

I've started getting this strange error; completely not sure what caused it - maybe a Maven rebuild. I can't explain this behavior... sometimes it works in IntelliJ, sometimes it doesn't, and it is failing when I run it from a jar file. This is the…
nair.ashvin
  • 791
  • 3
  • 11
0
votes
1 answer

How to do function interpolation with Breeze library in Scala

I would like to set up a function interpolation using scala. Does anyone know how to do this - preferably with breeze library for performance. An example would be much appreciated.
Karolis
  • 1,558
  • 1
  • 14
  • 23
0
votes
1 answer

Create an new DenseMatrix from an submatrix in Breeze using Scala

I've a DenseMatrix (original). I slice it to remove the last column (subset). After that I want to access the data in the subset. However, subset.data still points to the data in the old DenseMatrix (original). Any idea what I'm missing here and how…
Soumya Simanta
  • 11,523
  • 24
  • 106
  • 161
1 2 3
13
14