Contenuto principale

ricaComponent

Pipeline component for feature extraction using reconstruction independent component analysis (RICA)

Since R2026a

    Description

    ricaComponent is a pipeline component that performs feature extraction using reconstruction independent component analysis (RICA). The pipeline component uses the functionality of the rica function during the learn phase to extract features from the data. The component uses the functionality of the transform function during the run phase to transform new data into the extracted features.

    Creation

    Description

    component = ricaComponent creates a pipeline component for feature extraction using RICA.

    component = ricaComponent(Name=Value) sets writeable Properties using one or more name-value arguments. For example, NumComponents=5 specifies to extract five components (transformed features).

    example

    Properties

    expand all

    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 components (transformed features) to extract, specified as a positive integer scalar.

    If you do not specify the NumComponents value, the software extracts all components.

    Example: c = ricaComponent(NumComponents=5)

    Example: c.NumComponents = 10

    Data Types: single | double

    Contrast function, specified as "logcosh", "exp", or "sqrt". The contrast function is a smooth function included in the objective function. For more information, see ContrastFcn.

    Example: c = ricaComponent(ContrastFcn="exp")

    Example: c.ContrastFcn = "sqrt"

    Data Types: char | string

    Relative convergence tolerance on the gradient norm, specified as a positive numeric scalar. This gradient is the gradient of the objective function.

    Example: c = ricaComponent(GradientTolerance=1e-4)

    Example: c.GradientTolerance = 1e-8

    Data Types: single | double

    Transformation weights that initialize the optimization, specified as a p-by-NumComponents numeric matrix, where p is the number of features in the first input argument of learn used by the component.

    If you do not specify the InitialTransformWeights value, the software uses a matrix of normally distributed random numbers.

    Example: c = ricaComponent(InitialTransformWeights=randn(100,20))

    Example: c.InitialTransformWeights = 2*randn(100,20)

    Data Types: single | double

    Maximum number of iterations, specified as a positive integer scalar.

    Example: c = ricaComponent(IterationLimit=1e6)

    Example: c.IterationLimit = 1e4

    Data Types: single | double

    Regularization coefficient value for the transform weight matrix, specified as a positive numeric scalar.

    Example: c = ricaComponent(Lambda=0.1)

    Example: c.Lambda = 0.5

    Data Types: single | double

    Non-Gaussianity of the sources, specified as a length-NumComponents vector of 1 and –1 values. A value of 1 indicates that the corresponding source is super-Gaussian, with a sharp peak at 0, and a value of –1 indicates that the corresponding source is sub-Gaussian.

    If you do not specify the NonGaussianityIndicator value, the software uses a vector of all 1 values.

    Example: c = ricaComponent(NonGaussianityIndicator=ones(20,1))

    Example: c.NonGaussianityIndicator = [ones(19,1); -1]

    Data Types: single | double

    Flag to standardize the predictor data before performing feature extraction, specified as a numeric or logical 0 (false) or 1 (true). A value of 1 indicates to center and scale each numeric predictor.

    Example: c = ricaComponent(Standardize=true)

    Example: c.Standardize = false

    Data Types: single | double | logical

    Absolute convergence tolerance on the step size, specified as a positive numeric scalar.

    Example: c = ricaComponent(StepTolerance=1e-4)

    Example: c.StepTolerance = 1e-8

    Data Types: single | double

    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 = ricaComponent(Name="Extractor")

    Example: c.Name = "RICAExtractor"

    Data Types: char | string

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

    Example: c = ricaComponent(Inputs="X")

    Example: c.Inputs = "X1"

    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 = ricaComponent(Outputs="ExtractedX")

    Example: c.Outputs = "ExtractedX1"

    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.

    Example: c = ricaComponent(InputTags=0)

    Example: c.InputTags = 1

    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 = ricaComponent(OutputTags=0)

    Example: c.OutputTags = 1

    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.

    Learned RICA model, returned as a ReconstructionICA model object.

    This property is read-only.

    Names of the variables used by the component to extract features, returned as a string array. The variables correspond to columns in the 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 extraction using RICA. Specify to extract 3 components.

    component = ricaComponent(NumComponents=3)
    component = 
    
      ricaComponent with properties:
    
                 Name: "RICA"
               Inputs: "DataIn"
            InputTags: 1
              Outputs: "DataOut"
           OutputTags: 1
    
       
    Learnables (HasLearned = false)
            RICAModel: []
        UsedVariables: []
    
       
    Learn Parameters (unlocked)
        NumComponents: 3
    
    
    Show all parameters

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

    Read the fisheriris data set into a table. Store the predictor and response data in the tables X and Y, respectively.

    fisheriris = readtable("fisheriris.csv");
    X = fisheriris(:,1:end-1);
    Y = fisheriris(:,end);

    Use the learn object function to create a RICA model from the predictor data X.

    component = learn(component,X)
    component = 
    
      ricaComponent with properties:
    
                 Name: "RICA"
               Inputs: "DataIn"
            InputTags: 1
              Outputs: "DataOut"
           OutputTags: 1
    
       
    Learnables (HasLearned = true)
            RICAModel: [1×1 ReconstructionICA]
        UsedVariables: ["SepalLength"    "SepalWidth"    "PetalLength"    "PetalWidth"]
    
       
    Learn Parameters (locked)
        NumComponents: 3
    
    
    Show all parameters

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

    In the RICA model, find the feature transformation weights used for extracting features.

    weights = component.RICAModel.TransformWeights
    weights =
    
        0.3135   -0.5087    0.7298
        0.5986    0.6627    0.3360
       -0.6695    0.0771    0.5640
       -0.3086    0.5442    0.1909

    Version History

    Introduced in R2026a