PearsonCorrelationMetric<T>

Models & Types · AiDotNet.Evaluation.Metrics.Regression

Computes Pearson Correlation Coefficient between predictions and actuals.

Implements: IRegressionMetric<T>

For Beginners

Pearson correlation measures linear relationships:

  • Range: -1 to 1
  • 1 = perfect positive linear relationship
  • -1 = perfect negative linear relationship
  • 0 = no linear relationship
  • Note: R² = r² for simple regression

How It Works

r = Cov(y, ŷ) / (σ_y × σ_ŷ)

Constructors

Constructor Summary
PearsonCorrelationMetric()

Properties

Property Summary
MetricDirection Direction { get; }
T MaxValue { get; }
T MinValue { get; }
bool RequiresProbabilities { get; }
bool SupportsMultiClass { get; }
string Category { get; }
string Description { get; }
string Name { get; }

Methods

Method Summary
MetricWithCI<T> ComputeWithCI(ReadOnlySpan<T> predictions, ReadOnlySpan<T> actuals, ConfidenceIntervalMethod ciMethod, double confidenceLevel, int bootstrapSamples, int? randomSeed)
T Compute(ReadOnlySpan<T> predictions, ReadOnlySpan<T> actuals)