linear-regression ( X y lr n-iters -- )


Vocabulary
tensors.demos

Inputs
Xan object
yan object
lran object
n-itersan object


Outputs
None

Definition


:: linear-regression ( X y lr n-iters -- )
X normalize y shape>> first 1 2array ones swap 2array
hstack :> X-norm X-norm shape>> second 1 2array
zeros :> params X-norm y params compute-cost
number>string "The initial cost is " swap append print
X-norm y params lr n-iters gradient-descent
"The optimal parameters are " print .
last number>string "The final cost was " swap append print ;