DictionaryLearning<T>

Models & Types · AiDotNet.Preprocessing.DimensionalityReduction

Dictionary Learning for sparse representation.

Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → DictionaryLearning<T>

For Beginners

Dictionary Learning is like building a “parts library”:

  • Dictionary: Collection of basic building blocks (atoms)
  • Sparse codes: Which parts to use and how much (mostly zeros)
  • Goal: Represent each sample using few dictionary atoms
  • Used for: Image denoising, compression, feature extraction

How It Works

Dictionary Learning finds a dictionary D and sparse codes A such that X ≈ D × A. The dictionary atoms (columns of D) form a basis that allows sparse representation of the data.

Unlike PCA which enforces orthogonality, dictionary learning allows overcomplete dictionaries (more atoms than dimensions) and enforces sparsity on the codes.

Constructors

Constructor Summary
DictionaryLearning(int? nComponents, double alpha, int maxIter, double tol, DictionaryFitAlgorithm fitAlgorithm, SparseCodingAlgorithm transformAlgorithm, int? randomState, int[] columnIndices) Creates a new instance of DictionaryLearning.

Properties

Property Summary
DictionaryFitAlgorithm FitAlgorithm { get; } Gets the dictionary fitting algorithm.
Matrix<T> Components { get; } Gets the dictionary atoms (each row is an atom).
SparseCodingAlgorithm TransformAlgorithm { get; } Gets the sparse coding algorithm for transform.
Vector<T> Mean { get; } Gets the mean of each feature.
bool SupportsInverseTransform { get; } Gets whether this transformer supports inverse transformation.
double Alpha { get; } Gets the sparsity penalty.
int NComponents { get; } Gets the number of dictionary atoms.

Methods

Method Summary
string[] GetFeatureNamesOut(string[] inputFeatureNames) Gets the output feature names after transformation.