private function getSamplesMatrix(): Matrix
    {
        $samples = [];
        foreach ($this->samples as $sample) {
            array_unshift($sample, 1);
            $samples[] = $sample;
        }

        return new Matrix($samples);
    }
private function getSamplesMatrix(): Matrix
    {
        $samples = [];
        foreach ($this->samples as $sample) {
            array_unshift($sample, 1);
            $samples[] = $sample;
        }

        return new Matrix($samples);
    }
private function getSamplesMatrix ( ) : Matrix { $ samples = [ ] ; foreach ( $ this -> samples as $ sample ) { array_unshift ( $ sample , 1 ) ; $ samples [ ] = $ sample ; } return new Matrix ( $ samples ) ; }
Add one dimension for intercept calculation.
Add one dimension for intercept calculation .