O'Reilly logo

Practical Predictive Analytics by Ralph Winters

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

Plotting the results

One way to plot this in Spark is to construct a histogram of the probabilities, using the midpoints of the binned range (centroids) for the x axis and the raw counts for each bin plotted on the y axis.

x=SparkR::histogram(preds_train,preds_train$prediction, nbins = 100) x$centroids=round(x$centroids,2) display(x)

After the display command has run, click on the Plot Icon (2nd Icon at the bottom left), and click on "Plot Options". The customize plot screen will then display:

  1. Set Display type to Grouped Bar Chart using a combination of the drop down selection and radio buttons.
  2. Drag counts from All Fields to Values.
  3. Drag Centroids to Keys.

Centroids represent the midpoints of the bars. In the code above, we rounded them ...

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