Skip to main content

Linear Discriminant Analysis on Particle Positions

Project description

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:

  1. Python>=3.6
  2. numpy
  3. torch>=1.11 (==1.11 if option 4 is used)
  4. sklearn
  5. 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)

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

posLDA-0.0.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

posLDA-0.0.2-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file posLDA-0.0.2.tar.gz.

File metadata

  • Download URL: posLDA-0.0.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.3

File hashes

Hashes for posLDA-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f2b279ccfe81c6e5ca96aa0d3668e5bf35eea2cb6a2c7867c5abcf57d2aa4291
MD5 27c26ee39202355748c9ec5c0863e4d8
BLAKE2b-256 b1ba65711d9bf875b05388911a64cdd8e652e7984cf36ee590fe120875f03f57

See more details on using hashes here.

File details

Details for the file posLDA-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: posLDA-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.3

File hashes

Hashes for posLDA-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 557349558df890ace7704a348cab2f5072ed06e17181255d493d03f7415b85f0
MD5 5fbd1ae0e16e7f24d813f3e715eebb00
BLAKE2b-256 2f6abed86dc4110164a594b0d6a28e2699f412e4b790cecd6301d1b851ff309e

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