Main Content

featureSelectionRegressionMRMRComponent

Pipeline component for performing MRMR feature selection in regression workflow

Since R2026a

    Description

    featureSelectionRegressionMRMRComponent is a pipeline component that performs feature selection using minimum redundancy maximum relevance (MRMR). The pipeline component uses the functionality of the fsrmrmr function during the learn phase to identify the important predictors in the data. During the run phase, the component selects the same predictors from a new data set.

    Creation

    Description

    component = featureSelectionRegressionMRMRComponent creates a pipeline component for feature selection using the minimum redundancy maximum relevance (MRMR) algorithm. Use the component when creating a pipeline for regression. If you want to perform MRMR feature selection as part of a classification workflow, use featureSelectionClassificationMRMRComponent instead.

    component = featureSelectionRegressionMRMRComponent(Name=Value) sets writable Properties using one or more name-value arguments. For example, NumFeatures=10 specifies to select 10 important features.

    example

    Properties

    expand all

    Structural Parameters

    The software sets structural parameters when you create the component. You cannot modify structural parameters after creating the component.

    This property is read-only after the component is created.

    Observation weights flag, specified as 0 (false) or 1 (true). If UseWeights is true, the component adds a third input "W" to the Inputs component property, and a third input tag 3 to the InputTags component property.

    Example: c = featureSelectionRegressionMRMRComponent(UseWeights=1)

    Data Types: logical

    Learn Parameters

    The software sets learn parameters when you create the component. You can modify learn parameters using dot notation any time before you use the learn object function. Any unset learn parameters use the corresponding default values.

    Number of features (predictors) to select, specified as a positive integer scalar.

    If you do not specify the NumFeatures or RelativeScoreThreshold value, the software selects all features. You cannot specify both NumFeatures and RelativeScoreThreshold.

    Example: c = featureSelectionRegressionMRMRComponent(NumFeatures=5)

    Example: c.NumFeatures = 10

    Data Types: single | double

    Relative score threshold for selecting features, specified as a numeric scalar in the range (0,1]. If a feature (predictor) has a score greater than or equal to the RelativeScoreThreshold value, then the software selects the feature.

    If you do not specify the NumFeatures or RelativeScoreThreshold value, the software selects all features. You cannot specify both NumFeatures and RelativeScoreThreshold.

    Example: c = featureSelectionRegressionMRMRComponent(RelativeScoreThreshold=0.05)

    Example: c.RelativeScoreThreshold = 0.1

    Data Types: single | double

    Indicator to use missing values in the features (predictors), specified as either true to use the values for feature ranking and selection, or false to discard the values. For more information, see UseMissing.

    Example: c = featureSelectionRegressionMRMRComponent(UseMissing=true)

    Example: c.UseMissing = false

    Data Types: logical

    Component Properties

    The software sets component properties when you create the component. You can modify the component properties (excluding HasLearnables and HasLearned) using dot notation at any time. You cannot modify the HasLearnables and HasLearned properties directly.

    Component identifier, specified as a character vector or string scalar.

    Example: c = featureSelectionRegressionMRMRComponent(Name="FeatureSelector")

    Example: c.Name = "MRMRSelector"

    Data Types: char | string

    Names of the input ports, specified as a character vector, string array, or cell array of character vectors. If UseWeights is true, the component adds the input port "W" to Inputs.

    Example: c = featureSelectionRegressionMRMRComponent(Inputs=["Data1","Data2"])

    Example: c.Inputs = ["X1","Y1"]

    Data Types: char | string | cell

    Names of the output ports, specified as a character vector, string array, or cell array of character vectors.

    Example: c = featureSelectionRegressionMRMRComponent(Outputs=["newX","importance"])

    Example: c.Outputs = ["X","S"]

    Data Types: char | string | cell

    Tags that enable the automatic connection of the component inputs with other components or pipelines, specified as a nonnegative integer vector. If you specify InputTags, the number of tags must match the number of inputs in Inputs. If UseWeights is true, the component adds a third input tag to InputTags.

    Example: c = featureSelectionRegressionMRMRComponent(InputTags=[1 0])

    Example: c.InputTags = [1 2]

    Data Types: single | double

    Tags that enable the automatic connection of the component outputs with other components or pipelines, specified as a nonnegative integer vector. If you specify OutputTags, the number of tags must match the number of outputs in Outputs.

    Example: c = featureSelectionRegressionMRMRComponent(OutputTags=[1 0])

    Example: c.OutputTags = [1 NaN]

    Data Types: single | double

    This property is read-only.

    Indicator for the learnables, returned as 1 (true). A value of 1 indicates that the component contains Learnables.

    Data Types: logical

    This property is read-only.

    Indicator showing the learning status of the component, returned as 0 (false) or 1 (true). A value of 1 indicates that the learn object function has been applied to the component, and the Learnables are nonempty.

    Data Types: logical

    Learnables

    The software sets learnables when you use the learn object function. You cannot modify learnables directly.

    This property is read-only.

    Names of the features selected by the component, returned as a string array. The features correspond to columns in the first data argument of learn.

    Data Types: string

    This property is read-only.

    Names of the variables used by the component to select features, returned as a string array. The variables correspond to columns in the first data argument of learn.

    Data Types: string

    Object Functions

    learnInitialize and evaluate pipeline or component
    runExecute pipeline or component for inference after learning
    resetReset pipeline or component
    seriesConnect components in series to create pipeline
    parallelConnect components or pipelines in parallel to create pipeline
    viewView diagram of pipeline inputs, outputs, components, and connections

    Examples

    collapse all

    Create a pipeline component that performs feature selection using MRMR in a regression workflow. Specify to select 5 features.

    component = featureSelectionRegressionMRMRComponent(NumFeatures=5)
    component = 
    
      featureSelectionRegressionMRMRComponent with properties:
    
                     Name: "FeatureSelectionRegressionMRMR"
                   Inputs: ["X"    "Y"]
                InputTags: [1 2]
                  Outputs: ["XSelected"    "Scores"]
               OutputTags: [1 NaN]
    
       
    Learnables (HasLearned = false)
        SelectedVariables: []
            UsedVariables: []
    
       
    Structural Parameters (locked)
               UseWeights: 0
    
       
    Learn Parameters (unlocked)
              NumFeatures: 5
    
    
    Show all parameters

    component is a featureSelectionRegressionMRMRComponent object that contains two learnables: SelectedVariables and UsedVariables. The properties remain empty until you pass data to the component during the learn phase.

    Load the carbig data set. Store the predictor and response data in the tables X and Y, respectively.

    load carbig
    X = table(Acceleration,Cylinders,Displacement, ...
        Horsepower,Model_Year,Weight,Origin);
    Y = table(MPG);

    Use the learn object function to select features from the predictor data X.

    component = learn(component,X,Y)
    component = 
    
      featureSelectionRegressionMRMRComponent with properties:
    
                     Name: "FeatureSelectionRegressionMRMR"
                   Inputs: ["X"    "Y"]
                InputTags: [1 2]
                  Outputs: ["XSelected"    "Scores"]
               OutputTags: [1 NaN]
    
       
    Learnables (HasLearned = true)
        SelectedVariables: ["Displacement"    "Model_Year"    "Weight"    "Cylinders"    "Horsepower"]
            UsedVariables: ["Acceleration"    "Cylinders"    "Displacement"    "Horsepower"    "Model_Year"    "Weight"]
    
       
    Structural Parameters (locked)
               UseWeights: 0
    
       
    Learn Parameters (locked)
              NumFeatures: 5
    
    
    Show all parameters

    The SelectedVariables and UsedVariables properties are nonempty, and the HasLearned property is set to true.

    Find the names of the selected features.

    names = component.SelectedVariables
    names = 
    
      1×5 string array
    
        "Displacement"    "Model_Year"    "Weight"    "Cylinders"    "Horsepower"

    Version History

    Introduced in R2026a

    See Also