Skip to main content

Non-negative matrix factorization

Project description

BigNmf

BigNmf (Big Data NMF) is a python package for performing single NMF and joint NMF algorithms. NMF (Non-negative matrix factorization) is a unsupervised classification algorithm.

Installation

This package is available on the PyPi repository. Therefore you can install, by running the following.

pip3 install bignmf

Usage

The following is an example code snippet for running the nmf.

1. Single NMF

from bignmf.datasets.datasets import Datasets
from bignmf.models.snmf.standard import StandardNmf

Datasets.list_all()
data=Datasets.read("SimulatedX1")
k = 3
iter =100
trials = 50

model = StandardNmf(data,k)
model.run(trials, iter, verbose=0)
print(model.error)
model.cluster_data()
model.calc_consensus_matrices()
print(model.h_cluster)

2. Joint NMF

from bignmf.models.jnmf.integrative import IntegrativeJnmf
from bignmf.datasets.datasets import Datasets

Datasets.list_all()
data_dict = {}
data_dict["sim1"] = Datasets.read("SimulatedX1")
data_dict["sim2"] = Datasets.read("SimulatedX2")

k = 3
iter =100
trials = 50
lamb = 0.1

model = IntegrativeJnmf(data_dict, k, lamb)
model = StandardNmf(data,k)
model.run(trials, iter, verbose=0)
print(model.error)
model.cluster_data()
model.calc_consensus_matrices()
print(model.h_cluster)

Here is the extensive documentation for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bignmf-1.0.2.tar.gz (6.8 kB view hashes)

Uploaded Source

Built Distribution

bignmf-1.0.2-py3-none-any.whl (19.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page