Skip to main content

An integrated Python toolkit for classifiability analysis.

Project description

cla (classifiability analysis)

A unified classifiability analysis framework based on meta-learner and its application in spectroscopic profiling data [J]. Applied Intelligence, 2021, doi: 10.1007/s10489-021-02810-8

pyCLAMs: An integrated Python toolkit for classifiability analysis [J]. SoftwareX, Volume 18, June 2022, 101007, doi: 10.1016/j.softx.2022.101007

Warning

Since 0.3.x, we have reorganized the package structure. Any upper app should be revised accordingly.
Since 1.0.0, we stopped pyCLAMs and switch to cla.

Installation

pip install cla (pyCLAMs for versions under 1.0.0)
pip install rpy2
Install the R runtime and the ECol library (https://github.com/lpfgarcia/ECoL).

Run 'install.packages("ECoL")' in R. It will take very long time. You must wait for the installation to complete.
Sometimes, you may want to change the CRAN mirror. Under the "Packages" menu, click "Set CRAN Mirror".
After installation, you can check by R command 'installed.packages()'.

How to use

Download the sample dataset from the /data folder Use the following sample code to use the package:

  # import clams # (for versions < 1.0.0)  
  from cla import metrics # (for versions > 1.0.0)  

  # load the dataset or generate a toy dataset by X,y = mvg(md = 2)
  df = pd.read_csv('sample.csv')
  X = np.array(df.iloc[:,:-1]) # skip first and last cols
  y = np.array(df.iloc[:,-1])

  # get all metrics
  metrics.get_metrics(X,y) # Return a dictionary of all metrics

  # get metrics as JSON
  metrics.get_json(X,y)

  # get an html report and display in Jupyter notebook
  from IPython.display import display, HTML
  display(HTML(metrics.get_html(X,y)))

Start the web GUI

  1. python -m cla.gui.run
  2. Open http://localhost:5005/ in your browser.
3. A ready-to-use online demo is http://spacs.brahma.pub/research/CLA

Metrics and functions added since the original publication

1. metrics

classification.Mean_KLD - mean KLD (Kullback-Leibler divergence) between ground truth and predicted one-hot encodings
correlation.r2 - R2, the R-squared effect size
test.CHISQ, test.CHISQ.log10, test.CHISQ.CHI2 - Chi-squared test
classification.McNemar, classification.McNemar.CHI2 - McNemar test on the groud-truth and classifier's prediction
classification.SVM.Margin - the linear-SVC's margin width
test.student, test.student.min, test.student.min.log10, test.student.T, test.student.T.max
test.KW, test.KW.min, test.KW.min.log10, test.KW.H, test.KW.H.max
test.Median, test.Median.min, test.Median.min.log10, test.Median.CHI2, test.Median.CHI2.max

2. refactor

Integrate some existing packages and reorganize the package structure.

module sub-module description standalone pypi package (if any) publication
cla cla.metrics Provides various classifiability analysis metrics. pyCLAMs pyCLAMs: An integrated Python toolkit for classifiability analysis [J]. SoftwareX, Volume 18, June 2022, 101007, doi: 10.1016/j.softx.2022.101007
cla.unify Provide a method for unifying multiple atom metrics. N/A A unified classifiability analysis framework based on meta-learner and its application in spectroscopic profiling data [J]. Applied Intelligence, 2021, doi: 10.1007/s10489-021-02810-8
cla.vis Data visualization and plotting functions. N/A N/A
cla.gui Provide a user-friendly GUI. wCLAMs N/A

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

cla-1.1.0.tar.gz (132.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cla-1.1.0-py3-none-any.whl (135.1 kB view details)

Uploaded Python 3

File details

Details for the file cla-1.1.0.tar.gz.

File metadata

  • Download URL: cla-1.1.0.tar.gz
  • Upload date:
  • Size: 132.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for cla-1.1.0.tar.gz
Algorithm Hash digest
SHA256 39ab8cbea46a9f310c4748522edb7f8a8975cd7b73f4c6c2fe8237db5f5caf25
MD5 544378801ce8dc867f5be81c7fda981d
BLAKE2b-256 61bca601d0d4e55e50ef7d2d45f9888d4d2a98e0e1341687510fdc57be5c8173

See more details on using hashes here.

File details

Details for the file cla-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: cla-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 135.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for cla-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85e883c55591d12d80fe250310a365851900153df71264a0a6a70509fe201f2c
MD5 8cc99e98ea0f95d7e06987ddca693301
BLAKE2b-256 77d436a381b07d55e2c1be24eb9f233c395515509a7a3f1d90219c79fbfb9bf8

See more details on using hashes here.

Supported by

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