Skip to main content

A python package for a distance-based classifier which can use several different distance metrics.

Project description

DistClassiPy Logo


PyPI Installs Codecov License - GPL-3 Code style: black

arXiv ascl:2403.002

A python package for a distance-based classifier which can use several different distance metrics.

Installation

To install DistClassiPy, run the following command:

pip install distclassipy

Usage

Here's a quick example to get you started with DistClassiPy:

import distclassipy as dcpy
from sklearn.datasets import make_classification

X, y = make_classification(
    n_samples=1000,
    n_features=4,
    n_informative=2,
    n_redundant=0,
    random_state=0,
    shuffle=False,
)
# Example usage of DistanceMetricClassifier
clf = dcpy.DistanceMetricClassifier()
clf.fit(X, y)
print(clf.predict([[0, 0, 0, 0]], metric="canberra"))

# Example usage of EnsembleDistanceClassifier
ensemble_clf = dcpy.EnsembleDistanceClassifier(feat_idx=0)
ensemble_clf.fit(X, y)
print(ensemble_clf.predict(X))

Features

  • Distance Metric-Based Classification: Utilizes a variety of distance metrics for classification.
  • Customizable for Scientific Goals: Allows fine-tuning based on scientific objectives by selecting appropriate distance metrics and features, enhancing both computational efficiency and model performance.
  • Interpretable Results: Offers improved interpretability of classification outcomes by directly using distance metrics and feature importance, making it ideal for scientific applications.
  • Efficient and Scalable: Demonstrates lower computational requirements compared to traditional methods like Random Forests, making it suitable for large datasets.
  • Open Source and Accessible: Available as an open-source Python package on PyPI, encouraging broad application in astronomy and beyond.
  • (NEW) Ensemble Distance Classification: Leverages an ensemble approach to use different distance metrics for each quantile, improving classification performance across diverse data distributions.
  • (NEW) Expanded Distance Metrics: DistClassiPy now offers 43 built-in distance metrics, an increase from the previous 18. Additionally, users can still define and use custom distance metrics as needed.

Documentation

For more detailed information about the package and its functionalities, please refer to the official documentation.

Contributing

Contributions are welcome! If you have suggestions for improvements or bug fixes, please feel free to open an issue or submit a pull request.

License

DistClassiPy is released under the GNU General Public License v3.0. See the LICENSE file for more details.

Citation

If you use DistClassiPy in your research or project, please consider citing the paper:

Chaini, S., Mahabal, A., Kembhavi, A., & Bianco, F. B. (2024). Light Curve Classification with DistClassiPy: a new distance-based classifier. Astronomy and Computing. https://doi.org/10.1016/j.ascom.2024.100850.

Bibtex

@ARTICLE{2024A&C....4800850C,
       author = {{Chaini}, S. and {Mahabal}, A. and {Kembhavi}, A. and {Bianco}, F.~B.},
        title = "{Light curve classification with DistClassiPy: A new distance-based classifier}",
      journal = {Astronomy and Computing},
     keywords = {Variable stars (1761), Astronomy data analysis (1858), Open source software (1866), Astrostatistics (1882), Classification (1907), Light curve classification (1954), Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Solar and Stellar Astrophysics, Computer Science - Machine Learning},
         year = 2024,
        month = jul,
       volume = {48},
          eid = {100850},
        pages = {100850},
          doi = {10.1016/j.ascom.2024.100850},
archivePrefix = {arXiv},
       eprint = {2403.12120},
 primaryClass = {astro-ph.IM},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2024A&C....4800850C},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Authors

Siddharth Chaini, Ashish Mahabal, Ajit Kembhavi and Federica B. Bianco.

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

distclassipy-0.2.2a2.tar.gz (58.4 kB view details)

Uploaded Source

Built Distribution

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

distclassipy-0.2.2a2-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

Details for the file distclassipy-0.2.2a2.tar.gz.

File metadata

  • Download URL: distclassipy-0.2.2a2.tar.gz
  • Upload date:
  • Size: 58.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for distclassipy-0.2.2a2.tar.gz
Algorithm Hash digest
SHA256 b9d1ae3dc3262ae20247609d5499cffda56beeda0bfaacf72341f4883429d5bf
MD5 294cdc073a642726ff3308b04f2fff30
BLAKE2b-256 fceb5463dfdf7234e49be61d48fa97fb7fda65d0076429b8c44cca10bd90f186

See more details on using hashes here.

Provenance

The following attestation bundles were made for distclassipy-0.2.2a2.tar.gz:

Publisher: publish-to-pypi.yml on sidchaini/DistClassiPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file distclassipy-0.2.2a2-py3-none-any.whl.

File metadata

  • Download URL: distclassipy-0.2.2a2-py3-none-any.whl
  • Upload date:
  • Size: 43.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for distclassipy-0.2.2a2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e8a6b6f59a6063738ca018d4355129334a8fd967a311b274019a0eb63e72c1e
MD5 6745321f82f9f2831ec0db4d64a6a3f0
BLAKE2b-256 8db30be1953beadfac82e2c7db46db58093102213c185eebfab016f7904de49d

See more details on using hashes here.

Provenance

The following attestation bundles were made for distclassipy-0.2.2a2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on sidchaini/DistClassiPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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