How to do it...

  1. We start by downloading the file from Princeton University which contains the following data:

Source: Princeton University
  1. Download source: http://data.princeton.edu/wws509/datasets/#salary.
  1. To keep things simple, we then select the yr and sl to study how the number of years in rank influences the salary. To cut down on data wrangling code, we save those two columns in a file (Year_Salary.csv), as depicted in the following table, to study their linear relationship:
  1. We visually inspect the data by using a scatter plot ...

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.