IDataset<T, TInput, TOutput>
Interfaces · AiDotNet.Interfaces
Interface for datasets used in active learning scenarios.
Known implementations: IExtendedDataset<T, TInput, TOutput>
For Beginners
A dataset in machine learning is a collection of samples, where each sample has input features (X) and optionally output labels (Y). This interface provides a unified way to work with datasets in active learning.
How It Works
Key Concepts:
Active Learning Usage:
Properties
| Property | Summary |
|---|---|
IReadOnlyList<TInput> Inputs { get; } |
Gets the input features for all samples. |
IReadOnlyList<TOutput> Outputs { get; } |
Gets the output labels for all samples. |
bool HasLabels { get; } |
Gets whether this dataset has labels for all samples. |
int Count { get; } |
Gets the number of samples in the dataset. |
Methods
| Method | Summary |
|---|---|
IDataset<T, TInput, TOutput> AddSamples(TInput[] inputs, TOutput[] outputs) |
Adds samples with labels to the dataset. |
IDataset<T, TInput, TOutput> Clone() |
Creates a shallow copy of this dataset. |
IDataset<T, TInput, TOutput> Except(int[] indices) |
Creates a subset of the dataset excluding the specified indices. |
IDataset<T, TInput, TOutput> Merge(IDataset<T, TInput, TOutput> other) |
Merges another dataset into this one. |
IDataset<T, TInput, TOutput> RemoveSamples(int[] indices) |
Removes samples at the specified indices from the dataset. |
IDataset<T, TInput, TOutput> Shuffle(Random random) |
Shuffles the dataset and returns a new shuffled dataset. |
IDataset<T, TInput, TOutput> Subset(int[] indices) |
Creates a subset of the dataset containing only the specified indices. |
IDataset<T, TInput, TOutput> UpdateLabels(int[] indices, TOutput[] labels) |
Updates the labels for specific samples. |
TInput GetInput(int index) |
Gets the input features for a specific sample. |
TOutput GetOutput(int index) |
Gets the output label for a specific sample. |
ValueTuple<IDataset<T, TInput, TOutput>, IDataset<T, TInput, TOutput>> Split(double trainRatio, Random random) |
Splits the dataset into training and test sets. |
ValueTuple<TInput, TOutput> GetSample(int index) |
Gets both input and output for a specific sample. |
int[] GetIndices() |
Gets the indices of all samples in this dataset. |