A python package for MF (matrix factorization) based DR (dimensionality reduction) algorithms.
Project description
pyMFDR
A python package for MF (matrix factorization) based DR (dimensionality reduction) algorithms.
This repo contains the source and research materials for the article "Matrix Factorization Based Dimensionality Reduction Algorithms - A Comparative Study on Spectroscopic Profiling Data" by Zhang, et al. (Analytical Chemistry, 2022, DOI: 10.1021/acs.analchem.2c01922, https://pubs.acs.org/action/showCitFormats?doi=10.1021/acs.analchem.2c01922)
Content of repo ├── src : source code ├── data : contains the dataset (.csv) used for the research └── notebooks : contains the jupyter notebook for the research
Installation
pip install pyMFDR
How to use
Download the sample dataset from the /data folder Use the following sample code to use the package:
# import the library from pyMFDR import mfdr # load the dataset or generate a toy dataset by X,y = mvg(md = 2) df = pd.read_csv('7047_C02.csv') X = df.iloc[:,2:cols-1].values # -1 for removing the last column that contains NAN y = df.iloc[:,1].values.ravel() # first col is index and not used in this study # get a list of available MFDR algorithms mfdr.get_algorithms() # it will ouptut ['PCA', 'NMF', 'LAE', 'RP', 'SRP', 'VQ', 'AA', 'ICA'] # Run PCA on X. It will return W, H, Xr and the inner algorithm object. W,H,Xr,o = mfdr.mf(X, 3, alg = 'PCA', display = False) # evaluate the dimensionality reduction quality by various metrics mfdr.evaluate_dr(X,W,Xr) # visualize H mfdr.visualize_dictionary(H)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyMFDR-0.1.4.tar.gz
.
File metadata
- Download URL: pyMFDR-0.1.4.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d89c9d1642e56ccecf6118d0bcec4e558a7533281b7314fea917b0c25612911 |
|
MD5 | 14dcf49640417a2e23195fec3c40553a |
|
BLAKE2b-256 | 85b4f50d85b142e6e5d5b6f00180acd86552bdbcc1fa37a3718d7e1f7f2597c4 |
File details
Details for the file pyMFDR-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: pyMFDR-0.1.4-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e62f86f1ee7d9656c8c917193bb67570031f928cbd37b46756fae71d661f9038 |
|
MD5 | 87030ee5f5d7f8f7191d7edaf41d06bc |
|
BLAKE2b-256 | 083bc10547fc16c3fad867502959fb3f17f1352ba7157215998146cdf76347e8 |