rSquaredMetric
Description
 Use an RSquaredMetric object to track the
          R2 (also known as the coefficient of
      determination) when you train or test a deep neural network. 
To specify which metrics to use during training, specify the Metrics option of the trainingOptions function. You can
        use this option only when you train a network using the trainnet
        function.
To plot the metrics during training, in the training options, specify Plots as "training-progress". If you specify the
            ValidationData training option, then the software also plots and records the
        metric values for the validation data. To output the metric values to the Command Window
        during training, in the training options, set Verbose to true.
You can also access the metrics after training using the
            TrainingHistory and ValidationHistory fields from
        the second output of the trainnet function.
To specify which metrics to use when you test a neural network, use the metrics
        argument of the testnet
        function.
Creation
Description
metric = rSquaredMetricRSquaredMetric object. You can then specify metric as
          the Metrics name-value argument in the trainingOptions
          function or the metrics
          argument of the testnet
          function. With no additional options specified, this syntax is equivalent to specifying
          the metric as "rSquared".
metric = rSquaredMetric(PropertyName=Value)Name and NetworkOutput properties using name-value arguments.
Properties
Object Functions
| trainingOptions | Options for training deep learning neural network | 
| trainnet | Train deep learning neural network | 
| testnet | Test deep learning neural network | 
Examples
More About
Version History
Introduced in R2025a
