[ 5 KB ]
I get the following error when trying to perform "predictions" (see also attached file):

scala> val predictions = model.transform(testingData)
java.lang.ClassCastException:$ cannot be cast to
at scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:57)
at scala.collection.IndexedSeqOptimized$class.foldLeft(IndexedSeqOptimized.scala:66)
at scala.collection.mutable.ArrayOps$ofRef.foldLeft(ArrayOps.scala:186)
... 48 elided

Note (nothing to do with the error): I had to comment .setLabels(labelIndexer.labels) since "labels" is not sopprted in StringIndexer
I'm looking for more information on the Structure of Instances (Fig 1.4, page 8 ) in particular the LibSVM syntax described: class label, feature vector [feature ID, feature value]. I've tried to Google the key words but I end up with Support Vector Machine-related stuff ...
Can you please provide some links and/or bibliography on this subject ?
Thank you in advance
I'm back again with this distribution display-related question: is this the correct way to print 3 elements from the Stream result of algorithm.distribution(target) ?

val bias = Beta(5,2)
val algorithm = Importance(bias)

val streamExtract = algorithm.distribution(bias).take(3).toList


By the way, output was: List((0.0024691358024691457,0.8560160653642479), (0.0024691358024691457,0.8763925094641281), (0.0024691358024691457,0.6408510188252967))

Why is probability (0.0024691358024691457) the same for all values ? Thanks in advance !

FYI, here is the result in R for the 3 vaues above:

R: pbeta(q = c(0.8560160653642479, 0.8763925094641281, 0.6408510188252967), shape1 = 5, shape2 = 2, ncp = 0)
[1] 0.7905289 0.8365306 0.3021920
First of all thank you for this MEAP, this is book I was waiting for ! keep the good work smilie

In addtion to Couchbase and Riak, are there other "reactive" NoSQL databases (Akka- or Erlang/OTP-based) ?
Thanks Avi
Yes, it helps. I'm starting to understand the way Figaro works with provided algorithms.
I'm new to Scala. I don't know if the way I display a Poisson distribution result is the correct one. I get zero (0).
Thanks in advance for your support

scala> import com.cra.figaro.library.atomic.discrete.{Binomial, Poisson}
import com.cra.figaro.library.atomic.discrete.{Binomial, Poisson}

scala> val popularity = 100.0
popularity: Double = 100.0

scala> val numNodes = Poisson(popularity)
numNodes: com.cra.figaro.library.atomic.discrete.AtomicPoisson = Poisson(100.0)

scala> numNodes.value
res5: numNodes.Value = 0
Listing 5.3 (Product Success) calls helper function as helper(0,1,1) knowing that it should be helper(1,1,1)
Note: source code is OK.
Best regards,
Chapter 5.1.1 title: "Direct Dependencies" should be replaced by "Directed Dependencies" as well as the first word of the first paragraph.
Hello, typo error in first paragraph: "First, a value is generated for the parent. In this example, the value "average" has been generated for goodMood".
The parent is monthQuality and not goodMood.
BR, Boris

Can you please explain, as stated in pp. 34, why anotherGreetingToday is the same as greetingToday in Code2 below ?
Quick question: how can I print the string value ? I've tried println(greetingToday .toString()), etc. but it doesn't work.

class Greeting {
var string = “Hello world!”
val greetingToday = new Greeting
val greetingTomorrow = new Greeting
greetingTomorrow.string = “Howdy, universe!”

class Greeting {
var string = “Hello world!”
val greetingToday = new Greeting
val anotherGreetingToday = new Greeting
anotherGreetingToday.string = “Howdy, universe!”

Thank you !
BR, Boris
Hi, for listing 6.10 routes.js you don't mention where to save this routes.js file. The following is being displayed while running npm start: " Error: Cannot find module 'routes' " (I guess it's because it is required in app.js). Thanks, the book is great so far !