Multivariate Gradient Descent in Julia
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
includes a loss
function as well as a function that calculates the partial
derivative of the loss with respect to a specified element of .
Note:
-
This program dpends on the
HTTP
package, which can generally be installed using the commandPkg.add("HTTP")
-
This program will generally take several seconds to complete execution and output the best-fit vector.