Skip to content

fwebler/pst-NMF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Stability Non-negative Matrix Factorization (staNMF)

This repository contains implementations for computing the stability of non-negative matrix factorizations (staNMF).

Table of Contents

  1. Installation
  2. Usage
  3. Description of the Code
  4. Contributing
  5. License

Installation

  1. Clone the repository:
git clone https://github.com/fwebler/pst-NMF.git
  1. Navigate to the cloned directory:
cd pst-NMF
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

You can execute the main.py code as a standard Python script using the MNIST example data or replace it with your own data:

python main.py

Description of the Code

staNMF

This class provides methods for computing non-negative matrix factorization (NMF) and evaluating its stability. Key features include:

  • Loading data from a file or directly as a numpy array.
  • Generating initial guesses for factorization.
  • Performing NMF.
  • Calculating instability metrics.
  • Plotting the instability results.

MNIST Data Processing Script

The second script uses the staNMF class to apply stability non-negative matrix factorization to the MNIST dataset. The steps include:

  1. Loading the MNIST dataset.
  2. Preprocessing the data using MinMax scaling.
  3. Applying staNMF.
  4. Plotting instability results for different values of K.

Parallel processing is utilized for different values of K, and results are aggregated for visualization.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

Parallelized Stability Non-Negative Matrix Factorization (pst-NMF)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages