Main Content

parallel

Connect components or pipelines in parallel to create pipeline

Since R2026a

    Description

    pipeline = parallel(pipe1,...,pipeN) creates a pipeline (pipeline) by connecting components or pipelines pipe1 through pipeN in parallel. Use parallel to model conceptually simultaneous, order-independent processes or workflows.

    parallel creates a pipeline with input and output ports determined by the unique tags in the inputs and outputs of pipe1,...,pipeN. Each unique tag creates a unique port. The function then connects the inputs and outputs of pipe1,...,pipeN to the pipeline inputs and outputs with matching tags. During pipeline execution, data from each pipeline input is copied to each connected component input. Data from component outputs are joined together at the pipeline outputs to which they connect. The join operation defaults to horizontal concatenation.

    pipe1 through pipeN must have unique names. parallel renames any component that has the same name as another component already in the pipeline. New names consist of the original name with a numeric suffix.

    example

    pipeline = parallel(pipe1,...,pipeN,ExpandSubpipelines=expandflag) creates a pipeline where the pipeline elements of pipe1,...,pipeN are either expanded or collapsed, based on the value of expandflag.

    Examples

    collapse all

    Create a pipeline by connecting two components in parallel.

    normalizer = normalizerComponent;
    oneHotEncoder = oneHotEncoderComponent;
    pipeline = parallel(normalizer,oneHotEncoder)
    pipeline = 
    
      LearningPipeline with properties:
    
                 Name: "defaultName"
               Inputs: "DataIn"
            InputTags: 1
              Outputs: "DataCombined"
           OutputTags: 1
    
           Components: struct with 2 entries
          Connections: [4×2 table]
    
        HasLearnables: true
           HasLearned: false
    
    
    Show summary of the components

    Input Arguments

    collapse all

    Element to connect to another element in parallel, specified as a LearningPipeline object or a learning component object in one of the following tables.

    Data Preprocessing Components

    ComponentPurpose
    equalWidthBinnerComponentGrouping data into equal-width bins
    frequencyEncoderComponentFrequency encoding categorical variables
    kmeansEncoderComponentFeature extraction using k-means clustering
    normalizerComponentNormalizing data
    observationImputerComponentImputing missing values
    observationRemoverComponentRemoving observations
    oneHotEncoderComponentEncoding categorical data into one-hot vectors
    outlierImputerComponentImputing outlier values
    outlierRemoverComponentRemoving outlier values
    pcaComponentPrincipal component analysis (PCA)
    quantileBinnerComponentBinning data into equally probable bins
    ricaComponentFeature extraction using reconstruction independent component analysis (RICA)
    sparseFilterComponentFeature extraction using sparse filtering

    Feature Selection and Engineering Components

    ComponentPurpose
    featureSelectionClassificationANOVAComponentFeature selection using one-way ANOVA test
    featureSelectionClassificationChi2ComponentFeature selection using chi-square tests
    featureSelectionClassificationKruskalWallisComponentFeature selection using Kruskal-Wallis test
    featureSelectionClassificationMRMRComponentMinimum redundancy maximum relevance (MRMR) feature selection in classification workflow
    featureSelectionClassificationNCAComponentNeighborhood component analysis (NCA) feature selection in classification workflow
    featureSelectionClassificationReliefFComponentReliefF feature selection in classification workflow
    featureSelectionRegressionFTestComponentFeature selection using F-tests
    featureSelectionRegressionMRMRComponentMinimum redundancy maximum relevance (MRMR) feature selection in regression workflow
    featureSelectionRegressionNCAComponentNeighborhood component analysis (NCA) feature selection in regression workflow
    featureSelectionRegressionReliefFComponentReliefF feature selection in regression workflow
    variableSelectorComponentManual variable selection

    Classification Model Components

    ComponentPurpose
    classificationDiscriminantComponentDiscriminant analysis classification
    classificationECOCComponentMulticlass classification using error-correcting output codes (ECOC) model
    classificationEnsembleComponentEnsemble classification
    classificationGAMComponentBinary classification using generalized additive model (GAM)
    classificationKernelComponentClassification using Gaussian kernel with random feature expansion
    classificationKNNComponentClassification using k-nearest neighbor model
    classificationLinearComponentBinary classification of high-dimensional data using a linear model
    classificationNaiveBayesComponentMulticlass classification using a naive Bayes model
    classificationNeuralNetworkComponentClassification using a neural network model
    classificationSVMComponentOne-class and binary classification using a support vector machine (SVM) classifier
    classificationTreeComponentDecision tree classifier

    Regression Model Components

    ComponentPurpose
    regressionEnsembleComponentEnsemble regression
    regressionGAMComponentRegression using generalized additive model (GAM)
    regressionGPComponentGaussian process regression
    regressionKernelComponentKernel regression using explicit feature expansion
    regressionLinearComponentLinear regression
    regressionNeuralNetworkComponentNeural network regression
    regressionSVMComponentRegression using a support vector machine (SVM)
    regressionTreeComponentDecision tree regression

    Custom Components

    ComponentPurpose
    functionComponentCustom function

    Flag for expanding the subpipelines of pipeline, specified as true (1) or false (0). A value of true expands all the pipeline elements of pipe1,...,pipeN in pipeline. A value of false collapses all the pipeline elements of pipe1,...,pipeN.

    You can choose to expand subpipelines after creating a pipeline by using the expand function.

    Data Types: logical

    Output Arguments

    collapse all

    New pipeline created from components or pipelines, returned as a LearningPipeline object.

    Version History

    Introduced in R2026a