O'Reilly logo

Big Data Analytics Beyond Hadoop: Real-Time Applications with Storm, Spark, and More Hadoop Alternatives by Vijay Srinivas Agneeswaran Ph.D

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A. Code Sketches

This appendix presents the code sketches referred to in the various chapters.

NOTE: The Image character indicates code that didn’t fit on one line and wrapped to the next line.

Code for Naive Bayes PMML Scoring in Spark

This section contains the code for the Naive Bayes Predictive Modeling Markup Language (PMML) support in Spark, as referred to in Chapter 3, “Realizing Machine Learning Algorithms with Spark.”

NaiveBayesHandler.java

package pmml.parser; import java.io.PrintWriter; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required