Simple linear regression for generating line of best fit algorithm in scala