InMemoryDataset<T, TInput, TOutput>
Models & Types · AiDotNet.ActiveLearning.Data
In-memory implementation of a dataset for active learning.
Implements: IExtendedDataset<T, TInput, TOutput>
For Beginners
This is the most common dataset implementation. It stores all data in memory, making it fast to access but limited by available RAM. Suitable for most datasets that fit in memory.
How It Works
Features:
Usage:
Constructors
| Constructor | Summary |
|---|---|
InMemoryDataset(TInput[] inputs, TOutput[] outputs) |
Creates a new labeled dataset. |
InMemoryDataset(TInput[] inputs, TOutput[] outputs, bool hasLabels) |
Creates a new dataset with optional labeling. |
Properties
| Property | Summary |
|---|---|
DatasetMetadata Metadata { get; } |
|
IReadOnlyList<T> SampleWeights { get; } |
|
IReadOnlyList<TInput> Inputs { get; } |
|
IReadOnlyList<TOutput> ClassLabels { get; } |
|
IReadOnlyList<TOutput> Outputs { get; } |
|
IReadOnlyList<string> FeatureNames { get; } |
|
bool HasLabels { get; } |
|
bool IsClassification { get; } |
|
int ClassCount { get; } |
|
int Count { get; } |
|
int FeatureCount { get; } |
Methods
| Method | Summary |
|---|---|
IDataset<T, TInput, TOutput> AddSamples(TInput[] inputs, TOutput[] outputs) |
|
IDataset<T, TInput, TOutput> Clone() |
|
IDataset<T, TInput, TOutput> Except(int[] indices) |
|
IDataset<T, TInput, TOutput> Merge(IDataset<T, TInput, TOutput> other) |
|
IDataset<T, TInput, TOutput> RemoveSamples(int[] indices) |
|
IDataset<T, TInput, TOutput> Shuffle(Random random) |
|
IDataset<T, TInput, TOutput> Subset(int[] indices) |
|
IDataset<T, TInput, TOutput> UpdateLabels(int[] indices, TOutput[] labels) |
|
InMemoryDataset<T, TInput, TOutput> CreateClassification(TInput[] inputs, TOutput[] outputs, TOutput[] classLabels) |
Creates a classification dataset with class labels. |
InMemoryDataset<T, TInput, TOutput> CreateEmpty() |
Creates an empty dataset. |
InMemoryDataset<T, TInput, TOutput> CreateUnlabeled(TInput[] inputs) |
Creates an unlabeled dataset. |
InMemoryDataset<T, TInput, TOutput> CreateWeighted(TInput[] inputs, TOutput[] outputs, T[] weights) |
Creates a dataset with sample weights. |
InMemoryDataset<T, TInput, TOutput> CreateWithMetadata(TInput[] inputs, TOutput[] outputs, DatasetMetadata metadata) |
Creates a dataset with metadata. |
TInput GetInput(int index) |
|
TOutput GetOutput(int index) |
|
ValueTuple<IDataset<T, TInput, TOutput>, IDataset<T, TInput, TOutput>> Split(double trainRatio, Random random) |
|
ValueTuple<TInput, TOutput> GetSample(int index) |
|
int[] GetIndices() |