public function batch(int $n = 50) : array
    {
        $batches = [];

        $samples = $this->samples;

        foreach (array_chunk($this->samples, $n) as $batch) {
            $batches[] = self::quick($batch);
        }

        return $batches;
    }
public function batch(int $n = 50) : array
    {
        $batches = [];

        $samples = $this->samples;

        foreach (array_chunk($this->samples, $n) as $batch) {
            $batches[] = self::quick($batch);
        }

        return $batches;
    }
public function batch ( int $ n = 50 ) : array { $ batches = [ ] ; $ samples = $ this -> samples ; foreach ( array_chunk ( $ this -> samples , $ n ) as $ batch ) { $ batches [ ] = self :: quick ( $ batch ) ; } 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 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 as possible .