A Pipeline is a meta-estimator that transforms an input Dataset by applying a sequence of Transformer middleware before passing the data to a base estimator.
When you call a method on the Pipeline (like train or predict), it automatically fits the training set and transforms the dataset through the provided transformers. The transformed data is then handed to the base estimator.
Key Behaviors:
- Dataset Modification: The
Pipeline modifies the input dataset during the fitting process. If you need to preserve the original, unmodified dataset in memory, you must clone the dataset object before passing it to the Pipeline. - Elastic Mode: If the
elastic parameter is set to true, the Pipeline will automatically update the fitting of Elastic transformers during partial training (online learning). - Compatibility: The data type compatibility of a
Pipeline depends on the specific transformers and the base learner used.
use Rubix\
ML\
Pipeline;
use Rubix\
ML\
Transformers\
MissingDataImputer;
use Rubix\
ML\
Transformers\
OneHotEncoder;
use Rubix\
ML\
Transformers\
PrincipalComponentAnalysis;
use Rubix\
ML\
Classifiers\
SoftmaxClassifier;
$estimator = new Pipeline([
new MissingDataImputer(),
new OneHotEncoder(),
new PrincipalComponentAnalysis(20),
], new SoftmaxClassifier(128), true);