Table of Contents

Enum FitnessCalculatorType

Namespace
AiDotNet.Enums
Assembly
AiDotNet.dll

Specifies different loss functions and fitness calculators for evaluating model performance.

public enum FitnessCalculatorType

Fields

AdjustedRSquared = 3

A modified version of R-squared that adjusts for the number of predictors in the model.

BinaryCrossEntropy = 5

Measures the cross-entropy loss for binary classification problems.

CategoricalCrossEntropy = 6

Measures the cross-entropy loss for multi-class classification problems.

Custom = 15

A custom loss function or fitness calculator defined by the user.

ExponentialLoss = 14

Calculates the exponential loss, which heavily penalizes large errors.

HuberLoss = 8

Calculates the Huber loss, which combines properties of MSE and MAE.

LogCosh = 4

Calculates the logarithm of the hyperbolic cosine of the prediction error.

MaxError = 9

Measures the maximum deviation between predicted and actual values.

MeanAbsoluteError = 1

Calculates the average of the absolute differences between predicted and actual values.

MeanAbsolutePercentageError = 13

Measures the mean absolute percentage error.

MeanSquaredError = 0

Calculates the average of the squared differences between predicted and actual values.

MeanSquaredLogError = 10

Calculates the mean squared logarithmic error.

MedianAbsoluteError = 11

Measures the median absolute error between predicted and actual values.

OrdinalRegressionLoss = 7

A loss function specifically designed for ordinal regression problems.

RSquared = 2

Measures the proportion of variance in the dependent variable explained by the independent variables.

RootMeanSquaredError = 12

Calculates the root mean squared error.

Remarks

For Beginners: Loss functions and fitness calculators measure how well your AI model's predictions match the actual data.

Think of these metrics like grades on a test:

  • They tell you how well your model is performing
  • Different metrics focus on different aspects of performance
  • For most loss functions, lower values mean better performance
  • For some metrics (like R-squared), higher values mean better performance

When building AI models, you need ways to:

  • Compare different models to choose the best one
  • Know when to stop training your model
  • Understand if your model is actually learning useful patterns
  • Detect if your model is overfitting (memorizing data instead of learning)

Different metrics are better for different situations, so it's common to look at multiple metrics when evaluating a model.