How it works...

In this example, we explored the features of the Isotonic Regress model. We first read the dataset file into Spark in a libsvm format. We then split the data (70/30) and proceeded. Next, we displayed the DataFrame in the console by calling the .show() function. We then created the IsotonicRegression() object and let the model run for itself by calling the fit(data) function. In this recipe, we kept it simple and did not change any default parameters, but the readers should experiment and use the JChart package to graph the line and see the effect on the increasing and stepped line result in action.

Finally, we displayed the model boundary and predictions in the console and used the model to transform the test dataset and displayed ...

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.