AI-ML
view release on metacpan or search on metacpan
lib/AI/ML/LinearRegression.pm view on Meta::CPAN
=head2 linear_regression
considerando X com as dimensoes(m,n) e theta com as dimensoes (n,1)
#Default is normal equation
#Option
#gradient => not use normal equation
#plot => plot data and linear
#cost => plot cost
#alpha
#n => number of iterations
=cut
sub train {
my ($self, $x, $y) = @_;
my ($thetas, $iters, $alpha, $lambda);
if( exists $self->{grad} ) {
$iters = $self->{n};
$alpha = $self->{alpha};
( run in 0.598 second using v1.01-cache-2.11-cpan-96521ef73a4 )