FineTuningData<T, TInput, TOutput>
Models & Types · AiDotNet.Models.Options
Container for fine-tuning training and evaluation data.
For Beginners
Think of this as a container that holds all the training examples the model needs to learn from. Different training methods need different kinds of examples.
How It Works
This class holds data for various fine-tuning methods. Different methods use different subsets of the data:
Constructors
| Constructor | Summary |
|---|---|
FineTuningData() |
Properties
| Property | Summary |
|---|---|
TInput[] Inputs { get; set; } |
Gets or sets the input data samples. |
TOutput[] ChosenOutputs { get; set; } |
Gets or sets the chosen (preferred) outputs for preference learning. |
TOutput[] Outputs { get; set; } |
Gets or sets the target outputs for supervised fine-tuning. |
TOutput[] RejectedOutputs { get; set; } |
Gets or sets the rejected outputs for preference learning. |
TOutput[] TeacherOutputs { get; set; } |
Gets or sets teacher model logits/outputs for distillation. |
TOutput[][] RankedOutputs { get; set; } |
Gets or sets ranked outputs for ranking-based methods. |
ValueTuple<TOutput, string, TOutput>[] CritiqueRevisions { get; set; } |
Gets or sets critique-revision pairs for constitutional methods. |
bool HasDistillationData { get; } |
Gets whether this data is suitable for distillation. |
bool HasPairwisePreferenceData { get; } |
Gets whether this data is suitable for pairwise preference methods. |
bool HasRLData { get; } |
Gets whether this data is suitable for RL methods. |
bool HasRankingData { get; } |
Gets whether this data is suitable for ranking methods. |
bool HasSFTData { get; } |
Gets whether this data is suitable for SFT. |
bool HasUnpairedPreferenceData { get; } |
Gets whether this data is suitable for KTO (unpaired preferences). |
bool[] DesirabilityLabels { get; set; } |
Gets or sets binary labels indicating if outputs are desirable. |
double[] Advantages { get; set; } |
Gets or sets advantages for PPO-style methods. |
double[] Rewards { get; set; } |
Gets or sets reward values for RL-based methods. |
double[] SampleWeights { get; set; } |
Gets or sets optional sample weights for weighted training. |
double[] TeacherConfidences { get; set; } |
Gets or sets teacher model confidence scores. |
double[] Values { get; set; } |
Gets or sets value estimates for critic-based methods. |
int Count { get; } |
Gets the number of samples in the dataset. |
string[] SampleIds { get; set; } |
Gets or sets optional sample identifiers for tracking. |
Methods
| Method | Summary |
|---|---|
FineTuningData<T, TInput, TOutput> Subset(int[] indices) |
Creates a subset of the data for the given indices. |
ValueTuple<FineTuningData<T, TInput, TOutput>, FineTuningData<T, TInput, TOutput>> Split(double validationRatio, int? seed) |
Splits the data into training and validation sets. |