protected function fit(Dataset $dataset) : void
    {
        foreach ($this->transformers as $transformer) {
            if ($transformer instanceof Stateful) {
                $transformer->fit($dataset);

                if ($this->logger) {
                    $this->logger->info('Fitted '
                        . Params::shortName($transformer));
                }
            }

            $dataset->apply($transformer);

            if ($this->logger) {
                $this->logger->info('Applied '
                    . Params::shortName($transformer));
            }
        }
    }
protected function fit(Dataset $dataset) : void
    {
        foreach ($this->transformers as $transformer) {
            if ($transformer instanceof Stateful) {
                $transformer->fit($dataset);

                if ($this->logger) {
                    $this->logger->info('Fitted '
                        . Params::shortName($transformer));
                }
            }

            $dataset->apply($transformer);

            if ($this->logger) {
                $this->logger->info('Applied '
                    . Params::shortName($transformer));
            }
        }
    }
protected function fit ( Dataset $ dataset ) : void { foreach ( $ this -> transformers as $ transformer ) { if ( $ transformer instanceof Stateful ) { $ transformer -> fit ( $ dataset ) ; if ( $ this -> logger ) { $ this -> logger -> info ( 'Fitted ' . Params :: shortName ( $ transformer ) ) ; } } $ dataset -> apply ( $ transformer ) ; if ( $ this -> logger ) { $ this -> logger -> info ( 'Applied ' . Params :: shortName ( $ transformer ) ) ; } } }
Fit the transformer middelware to a dataset.

@param \Rubix\ML\Datasets\Dataset $dataset
Fit the transformer middelware to a dataset .