Metadata-Version: 2.1
Name: torch-incremental-pca
Version: 0.0.5
Summary: A PyTorch implementation of Incremental PCA
Author-email: Lukas Hauzenberger <lukas.hauzenberger@gmail.com>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: torch
Requires-Dist: numpy

# PyTorch Incremental PCA

[![PyPI Version](https://img.shields.io/pypi/v/torch-incremental-pca.svg)](https://pypi.org/project/torch-incremental-pca/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Tests](https://github.com/sirluk/torch-incremental-pca/actions/workflows/tests.yml/badge.svg)](https://github.com/sirluk/torch-incremental-pca/actions/workflows/tests.yml)

This project provides a PyTorch implementation of the Incremental PCA algorithm, inspired by the `IncrementalPCA` class from scikit-learn and this repository: [PCAonGPU](https://github.com/dnhkng/PCAonGPU/tree/main) The repository has some shortcomings with regards to the precision of operations leading to vastly different results compared to the sklearn implemtation. The IncrementalPCA class in this repo produces outputs which are very close to the sklearn implementation with the added benefit of running on GPU.

Incremental PCA is a valuable technique for dimensionality reduction when dealing with large datasets that cannot fit entirely into memory.

## Features

* **PyTorch Integration:** Seamlessly use incremental PCA within your PyTorch workflows.
* **Memory Efficiency:**  Process large datasets incrementally without loading everything into memory at once.
* **Similar API:**  Familiar interface if you've used scikit-learn's `IncrementalPCA`.
* **Customization:** Easily extend or modify the core functionality to suit your specific needs.

## Installation

```bash
pip install torch-incremental-pca
```

## Usage
```python
import torch_incremental_pca as tip

pca = tip.IncrementalPCA(n_components=32, device="cuda")
```
