The program below learns a linear relationship between a three-dimensional input and an output.
It downloads and operates on a dataset from Helmut Spaeth, Mathematical Algorithms for Linear Regression, Academic Press, 1991, ISBN 0-12-656460-4.
The data concerns pasture rent structure and grass variety and includes 67 examples. The inputs are
- the rent per acre of arable land,
- the number of milk cows per square mile, and
- the difference between pasturage and arable land
The output is the rental price per acre for this variety of grass. The program
loss function as well as a function that calculates the partial
derivative of the loss with respect to a specified element of .
This program dpends on the
HTTPpackage, which can generally be installed using the command
This program will generally take several seconds to complete execution and output the best-fit vector.