Skip to main content

Non-negative matrix factorization

Project description

BigNmf

Build Status Read the Docs PyPI version License: MIT

BigNmf (Big Data NMF) is a python 3 package for conducting analysis using NMF algorithms.

NMF Introduction

NMF (Non-negative matrix factorization) factorizes a non-negative input matrix into non-negative factors. The algorithm has an inherent clustering property and has been gaining attention in various fields especially in biological data analysis.

Brunet et al in their paper demonstrated NMF's superior capability in clustering the leukemia dataset compared to standard clustering algorithms like Hierarchial clustering and Self-organizeing maps.

Available algorithms

The following are the algorithms currently available. If you would like to know more about the algorithm, the links below lead to their papers of origin.

Installation

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

pip3 install bignmf

Usage

The following examples illustrate typical usage of the algorithm.

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)

# Runs the model
model.run(trials, iter, verbose=0)
print(model.error)

# Clusters the data
model.cluster_data()
print(model.h_cluster)

#Calculates the consensus matrices
model.calc_consensus_matrices() 
print(model.consensus_matrix_w)

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)
# Runs the model
model.run(trials, iter, verbose=0)
print(model.error)

# Clusters the data
model.cluster_data()
print(model.h_cluster)

#Calculates the consensus matrices
model.calc_consensus_matrices() 
print(model.consensus_matrix_w)

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.5.tar.gz (95.5 kB view details)

Uploaded Source

Built Distribution

bignmf-1.0.5-py3-none-any.whl (99.6 kB view details)

Uploaded Python 3

File details

Details for the file bignmf-1.0.5.tar.gz.

File metadata

  • Download URL: bignmf-1.0.5.tar.gz
  • Upload date:
  • Size: 95.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for bignmf-1.0.5.tar.gz
Algorithm Hash digest
SHA256 b03e3316cdc402e07f8906ca9f969505ee7045a54acf1580fe357d3353f64756
MD5 ada1ea56548ec58667a8c3572442ba84
BLAKE2b-256 cb591c440b30762fa24409ca427ba220de29196708c5c0d3cb2189c1469a20de

See more details on using hashes here.

File details

Details for the file bignmf-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: bignmf-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 99.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for bignmf-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0ffc85ca9e85df0bda52947fdf3604b3e10fdd1c4ee7e89bbe023d529a1d27fa
MD5 5d2240afc6a0ae76cde15bc49059e365
BLAKE2b-256 3ec318178ae33fdbe4311f5b80259491a52fc9f77c79740a787c1fef13f76510

See more details on using hashes here.

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