FoldResult<T, TInput, TOutput>

Models & Types · AiDotNet.Models.Results

Represents the results of a single fold in cross-validation.

For Beginners

A FoldResult contains all the performance metrics for one “fold” in cross-validation. Think of it like a report card for a single test of your model, where the model was trained on one subset of your data and tested on another.

Constructors

Constructor Summary
FoldResult(int foldIndex, Vector<T> trainingActual, Vector<T> trainingPredicted, Vector<T> validationActual, Vector<T> validationPredicted, Dictionary<string, T> featureImportance, TimeSpan? trainingTime, TimeSpan? evaluationTime, int featureCount, IFullModel<T, TInput, TOutput> model, ClusteringMetrics<T> clusteringMetrics, int[] trainingIndices, int[] validationIndices) Creates a new instance of the FoldResult class.

Properties

Property Summary
ClusteringMetrics<T> ClusteringMetrics { get; } Gets the clustering quality metrics for this fold, if applicable.
Dictionary<string, T> FeatureImportance { get; } Gets the feature importance scores for this fold.
ErrorStats<T> TrainingErrors { get; } Gets the error statistics for the training data.
ErrorStats<T> ValidationErrors { get; } Gets the error statistics for the validation data.
IFullModel<T, TInput, TOutput> Model { get; } Gets the trained model instance for this fold.
PredictionStats<T> ValidationPredictionStats { get; } Gets the prediction statistics for the validation data.
TimeSpan EvaluationTime { get; } Gets the time taken to evaluate the model for this fold.
TimeSpan TrainingTime { get; } Gets the time taken to train the model for this fold.
Vector<T> ActualValues { get; } Gets the actual values from the validation dataset.
Vector<T> PredictedValues { get; } Gets the predicted values for the validation dataset.
int FoldIndex { get; } Gets the index of this fold in the cross-validation process.
int[] TrainingIndices { get; } Gets the indices of the training samples in this fold.
int[] ValidationIndices { get; } Gets the indices of the validation samples in this fold.