Questions tagged [scala-nlp]

`ScalaNLP` is a suite of machine learning and numerical computing libraries.

ScalaNLP is the umbrella project for Breeze and Epic. Breeze is a set of libraries for machine learning and numerical computing. Epic is a high-performance statistical parser.

See more:

7 questions
3
votes
0 answers

scalanlp breeze linear algebra: zip two vectors together

I'm used to working with lists. If I have two lasts A and B and a function that takes two doubles and returns a double, then I could do the following A.zip(B).map(x=>myfunction(x._1,x._2)) This is the way my brain is used to thinking about these…
Lindon
  • 1,292
  • 1
  • 10
  • 21
2
votes
1 answer

Sampling without Replacement using Scala and Breeze

Is there support for sampling from a multinomial distribution without replacement? I'm imagining some sort of code like: import breeze.linalg._ import breeze.stats.distributions._ val params = DenseVector(0.1, 0.3, 0.2, 0.4) val mult = new…
sinwav
  • 724
  • 1
  • 7
  • 20
2
votes
1 answer

Using Multinomial Distribution with Scala and Breeze package

I'm using the breeze package with Scala 2.10.3, and I'd like to sample from a multinomial distribution. I.e. I'd like to sample values of a random variable Y, where Y ~ Multinomial(Y1 = 0, Y2 = 1, Y3 = 3; p1 = 0.2, p2 = 0.5, p3 = 0.3) I'm having…
sinwav
  • 724
  • 1
  • 7
  • 20
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 &…
0
votes
1 answer

filling a matrix with Scala library breeze

I'm new to Scala and I'm having a mental block on a seemingly easy problem. I'm using the Scala library breeze and need to take an array buffer (mutable) and put the results into a matrix. This... should be simple but? Scala is so insanely type…
SnarkShark
  • 360
  • 1
  • 7
  • 20
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

Filtering out numbers when using ScalaNLP tokenizer

is there a command in scala to ignore all kind of numbers, such as " IgnoreNumbers() ~> "? I'm a scala newbie and, in fact, I only have to use one script in this language. Thanks a lot for any help! It's for a tokenizer from here…
MarkF6
  • 493
  • 6
  • 21