public function batch(int $n = 50) : array
    {
        $sChunks = array_chunk($this->samples, $n);
        $lChunks = array_chunk($this->labels, $n);

        $batches = [];

        foreach ($sChunks as $i => $samples) {
            $batches[] = self::quick($samples, $lChunks[$i]);
        }

        return $batches;
    }
public function batch(int $n = 50) : array
    {
        $sChunks = array_chunk($this->samples, $n);
        $lChunks = array_chunk($this->labels, $n);

        $batches = [];

        foreach ($sChunks as $i => $samples) {
            $batches[] = self::quick($samples, $lChunks[$i]);
        }

        return $batches;
    }
public function batch ( int $ n = 50 ) : array { $ sChunks = array_chunk ( $ this -> samples , $ n ) ; $ lChunks = array_chunk ( $ this -> labels , $ n ) ; $ batches = [ ] ; foreach ( $ sChunks as $ i => $ samples ) { $ batches [ ] = self :: quick ( $ samples , $ lChunks [ $ i ] ) ; } return $ batches ; }
Generate a collection of batches of size n from the dataset. If there are
not enough samples to fill an entire batch, then the dataset will contain
as many samples and labels as possible.

@param int $n
@return array
Generate a collection of batches of size n from the dataset . If there are not enough samples to fill an entire batch then the dataset will contain as many samples and labels as possible .