ModelStats<T, TInput, TOutput>
Models & Types · AiDotNet.Statistics
Represents a collection of statistical metrics for evaluating and analyzing machine learning models.
For Beginners
Think of ModelStats as a report card for your AI model.
Just like a school report card shows how well a student is doing in different subjects, ModelStats shows how well your AI model is performing in different areas. It helps you:
- Understand how accurate your model’s predictions are
- See which features (inputs) are most important
- Check if your model is too simple or too complex
- Compare your model’s performance to simpler alternatives
This information helps you improve your model and decide if it’s ready to use in real-world situations.
How It Works
This class calculates and stores various statistical measures that help assess the performance, fit, and characteristics of a machine learning model. It includes metrics for model accuracy, feature importance, model complexity, and various distance and similarity measures.
Properties
| Property | Summary |
|---|---|
Dictionary<string, TOutput> FeatureValues { get; set; } |
Gets a dictionary mapping feature names to their values. |
IFullModel<T, TInput, TOutput> Model { get; } |
Gets the full model being evaluated. |
List<T> LeaveOneOutPredictiveDensities { get; set; } |
|
List<T> PosteriorPredictiveSamples { get; set; } |
|
List<T> VIFList { get; set; } |
|
List<string> FeatureNames { get; set; } |
Gets the names of the features used in the model. |
Matrix<T> CorrelationMatrix { get; set; } |
|
Matrix<T> CovarianceMatrix { get; set; } |
|
T CalinskiHarabaszIndex { get; set; } |
|
T ConditionNumber { get; set; } |
|
T CosineSimilarity { get; set; } |
|
T DaviesBouldinIndex { get; set; } |
|
T EffectiveNumberOfParameters { get; set; } |
|
T EuclideanDistance { get; set; } |
|
T HammingDistance { get; set; } |
|
T JaccardSimilarity { get; set; } |
|
T LogLikelihood { get; set; } |
|
T LogPointwisePredictiveDensity { get; set; } |
|
T MahalanobisDistance { get; set; } |
|
T ManhattanDistance { get; set; } |
|
T MarginalLikelihood { get; set; } |
|
T MeanAveragePrecision { get; set; } |
|
T MeanReciprocalRank { get; set; } |
|
T MutualInformation { get; set; } |
|
T NormalizedDiscountedCumulativeGain { get; set; } |
|
T NormalizedMutualInformation { get; set; } |
|
T ObservedTestStatistic { get; set; } |
|
T ReferenceModelMarginalLikelihood { get; set; } |
|
T SilhouetteScore { get; set; } |
|
T VariationOfInformation { get; set; } |
|
TInput Features { get; } |
Gets the feature values used in the model. |
TOutput Actual { get; } |
Gets the actual (observed) values from the dataset. |
TOutput Predicted { get; } |
Gets the predicted values from the model. |
Vector<T> AutoCorrelationFunction { get; set; } |
Gets the Auto-Correlation Function, which measures the correlation between a time series and a lagged version of itself. |
Vector<T> PartialAutoCorrelationFunction { get; set; } |
Gets the Partial Auto-Correlation Function, which measures the direct relationship between an observation and its lag. |
int FeatureCount { get; set; } |
Gets the number of features (input variables) used in the model. |
Methods
| Method | Summary |
|---|---|
ModelStats<T, TInput, TOutput> Empty() |
Creates an empty instance of the ModelStats<T> class. |
T GetMetric(MetricType metricType) |
Retrieves the value of a specific metric. |
bool HasMetric(MetricType metricType) |
Checks if a specific metric is available in this ModelStats instance. |