Dokumentation (english)

Dimensionality Reduction

Reducing the number of features while preserving essential information

Dimensionality reduction transforms high-dimensional data into fewer dimensions while retaining the most important information. This makes data easier to visualize, speeds up training, reduces memory usage, and can improve model performance by removing noise.

Why Reduce Dimensions

Curse of dimensionality: As features increase, data becomes sparse. Points are far apart in high-dimensional space, making patterns harder to detect. Distance-based algorithms like KNN struggle because distances become less meaningful.

Computational efficiency: Fewer features mean faster training and prediction. A dataset with 1000 features takes much longer to process than one with 50.

Visualization: Humans can't visualize beyond 3 dimensions. Reducing to 2-3 dimensions allows you to plot and explore data patterns visually.

Noise reduction: Many features are redundant or irrelevant. Removing them can improve model performance by eliminating noise.

Storage: Smaller representations save memory and disk space, especially important for large datasets.

Types of Dimensionality Reduction

Linear Methods

Principal Component Analysis (PCA): Finds orthogonal directions of maximum variance. Projects data onto these principal components. Fast, interpretable, works well when relationships are linear.

Linear Discriminant Analysis (LDA): Supervised method that finds directions maximizing class separation. Unlike PCA, it uses class labels to find discriminative features.

Singular Value Decomposition (SVD): Matrix factorization technique closely related to PCA. Used in recommendation systems and text analysis (LSA).

Nonlinear Methods

t-SNE (t-Distributed Stochastic Neighbor Embedding): Preserves local structure by keeping similar points close together. Excellent for visualization but slow on large datasets and doesn't support new data points directly.

UMAP (Uniform Manifold Approximation and Projection): Similar goals to t-SNE but faster and better at preserving global structure. Can embed new points after fitting.

Autoencoders: Neural networks that compress data through a bottleneck layer. The encoder learns a compact representation, the decoder reconstructs the original. Flexible but requires more data and tuning.

Kernel PCA: Applies PCA in a higher-dimensional space using kernel trick. Captures nonlinear relationships.

Feature Selection vs Feature Extraction

Feature selection: Choose a subset of original features. Removes irrelevant or redundant features but keeps the rest unchanged. Examples: mutual information, L1 regularization, recursive feature elimination.

Feature extraction: Create new features by combining or transforming originals. PCA, t-SNE, autoencoders are feature extraction methods. New features may be harder to interpret but can capture complex patterns.

Both reduce dimensions, but feature selection maintains interpretability by keeping original features.

Choosing a Method

Linear relationships, need interpretability: PCA or SVD. Fast, stable, and the components tell you which original features matter.

Classification with labeled data: LDA finds directions that separate classes best.

Visualization: t-SNE or UMAP for 2D/3D plots. t-SNE for local structure, UMAP for balance between local and global. Often used before clustering to visualize groups.

Very high dimensions, complex patterns: Autoencoders if you have enough data and need to embed new points.

Need to apply to new data: PCA, UMAP, autoencoders support transforming new points. t-SNE requires refitting.

Practical Considerations

Standardization: Scale features before applying PCA or other distance-based methods. Different scales bias the results toward high-variance features.

Explained variance: With PCA, check cumulative explained variance. Keep enough components to retain 80-95% of variance.

Validation: Dimensionality reduction is unsupervised, but validate on downstream tasks. Does the reduced data still predict well?

Interpretability tradeoff: Lower dimensions are easier to work with but may lose information. Balance compression against performance.

Computational cost: PCA is fast even on large datasets. t-SNE is slow beyond tens of thousands of points. UMAP and autoencoders scale better.

Common Pitfalls

Applying before split: Fit dimensionality reduction only on training data, then transform test data. Otherwise you leak information.

Over-reduction: Removing too many dimensions loses critical information. Check performance on validation set.

Assuming linearity: PCA assumes linear combinations of features capture variance. If relationships are highly nonlinear, consider kernel methods or autoencoders.

Interpreting t-SNE distances: t-SNE preserves neighborhoods, not distances. Cluster sizes and gaps between clusters are not meaningful.


Command Palette

Search for a command to run...

Schnellzugriffe
STRG + KSuche
STRG + DNachtmodus / Tagmodus
STRG + LSprache ändern

Software-Details
Kompiliert vor etwa 13 Stunden
Release: v4.0.0-production
Buildnummer: master@27db988
Historie: 34 Items