posLDA
Overview
This is a package to perform Linear Discriminant Analysis (LDA) on particle positions taking into account the rotational invariance of these positions.
Dependencies
This package is dependent on the following packages:
- Python>=3.6
- numpy
- torch>=1.11 (==1.11 if option 4 is used)
- sklearn
- shapeGMMTorch
Installation
After the dependencies have been installed, the package can be installed from pip
pip install posLDA
or by downloading from github and then running
python setup.py install
Usage
This package is designed to mimic the usage of the sklearn package. You first initiliaze the object and then you can transform additional data.
Initialize:
from posLDA import pLDA
plda = pLDA.pLDA(training_set_positions, cluster_ids)
During initialization, the following options are availble:
- rot_type - string defining the type of rotational alignment to use. Options are 'kronecker' and 'uniform'. Defualt is 'uniform'.
- kabsch_thresh - float dictating convergence criteria for each alignment step. Default value is 1e-1.
- dtype - Torch data type to be used. Default is torch.float32.
- device - Torch device to be used. Default is torch.device('cuda:0') device.
Fit:
plda.fit(training_set_positions, cluster_ids)
Transform:
transformed_positions = plda.transform(full_trajectory_positions)
Attributes
After being properly fit, a pLDA object will have the following attributes:
- n_clusters - integer of how many clusters were in tranining cluster_id array
- n_atoms - integer of how many atoms were in the training data
- n_training_frames - integer of how many frames were in the training data
- lda - sklearn LDA object fit using training data
- lda_vecs - (n_atoms x 3, n_clusters-1) float array of LD vectors
- lda_projection - (n_training_frames, n_clusters-1) float array of LD projections for training data
- center - (n_atoms, 3) float array of global center/average
Uniform covariance specific attributes
- var - (n_clusters) float of global variance
Kronecker covariance specific attributes
- precision - (n_atoms, n_atoms) float array of global precision (inverse covariance)
Metadata
Release files for posLDA 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| posLDA-0.0.2.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| posLDA-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.4 kB
Release files / posLDA-0.0.2.tar.gz
| Download URL | posLDA-0.0.2.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2b279ccfe81c6e5ca96aa0d3668e5bf35eea2cb6a2c7867c5abcf57d2aa4291
|
|
BLAKE2b-256 checksum How to use checksums |
b1ba65711d9bf875b05388911a64cdd8e652e7984cf36ee590fe120875f03f57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.3
|
Release files / posLDA-0.0.2-py3-none-any.whl
| Download URL | posLDA-0.0.2-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
557349558df890ace7704a348cab2f5072ed06e17181255d493d03f7415b85f0
|
|
BLAKE2b-256 checksum How to use checksums |
2f6abed86dc4110164a594b0d6a28e2699f412e4b790cecd6301d1b851ff309e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.3
|