How it works...

We began by loading the data file newsCorpora.csv and then by way of the randomSplit() method attached to the dataset object, we split the dataset.

Get Apache Spark 2.x Machine Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.