Apache Spark Deep Learning Cookbook
上QQ阅读APP看书,第一时间看更新

How it works...

This section explains how an array is plotted as a scatterplot:

  1. The matplotlib library is imported into the Jupyter notebook and the matplotlib library is configured to plot visualizations inline in the cells of the Jupyter notebook
  2. The minimum and maximum values of the x and y-axes are determined to size up our plot and give us an optimal looking graph.  The output of the script can be seen in the following screenshot:
  1. A 10-point pixel buffer has been added to each axis to ensure all data points are captured without being cut off.
  2. A loop is created to iterate through each row of values and plot the weight versus the height.

  3. Additionally, a different style point is assigned to the Female gender, x, and the Male gender, o.

  1. The output of the script to plot the Weight vs Height by Gender can be seen in the following screenshot: