distclassipy 0.1.5__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: distclassipy
3
- Version: 0.1.5
3
+ Version: 0.2.0
4
4
  Summary: A python package for a distance-based classifier which can use several different distance metrics.
5
5
  Author-email: Siddharth Chaini <sidchaini@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -694,7 +694,7 @@ Requires-Python: >=3.10
694
694
  Description-Content-Type: text/markdown
695
695
  License-File: LICENSE
696
696
  Requires-Dist: joblib>=1.3.2
697
- Requires-Dist: numpy<2,>=1.25.2
697
+ Requires-Dist: numpy>=1.25.2
698
698
  Requires-Dist: pandas>=2.0.3
699
699
  Requires-Dist: scikit-learn>=1.2.2
700
700
 
@@ -740,17 +740,25 @@ X, y = make_classification(
740
740
  random_state=0,
741
741
  shuffle=False,
742
742
  )
743
- clf = dcpy.DistanceMetricClassifier(metric="canberra")
743
+ # Example usage of DistanceMetricClassifier
744
+ clf = dcpy.DistanceMetricClassifier()
744
745
  clf.fit(X, y)
745
- print(clf.predict([[0, 0, 0, 0]]))
746
+ print(clf.predict([[0, 0, 0, 0]], metric="canberra"))
747
+
748
+ # Example usage of EnsembleDistanceClassifier
749
+ ensemble_clf = dcpy.EnsembleDistanceClassifier(feat_idx=0)
750
+ ensemble_clf.fit(X, y)
751
+ print(ensemble_clf.predict(X))
746
752
  ```
747
753
 
748
754
  ## Features
749
755
  - **Distance Metric-Based Classification**: Utilizes a variety of distance metrics for classification.
750
756
  - **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.
751
757
  - **Interpretable Results**: Offers improved interpretability of classification outcomes by directly using distance metrics and feature importance, making it ideal for scientific applications.
752
- - **Efficient and Scalable**: Demonstrates lower computational requirements compared to traditional methods like Random Forests, making it suitable for large datasets
753
- - **Open Source and Accessible**: Available as an open-source Python package on PyPI, encouraging broad application in astronomy and beyond
758
+ - **Efficient and Scalable**: Demonstrates lower computational requirements compared to traditional methods like Random Forests, making it suitable for large datasets.
759
+ - **Open Source and Accessible**: Available as an open-source Python package on PyPI, encouraging broad application in astronomy and beyond.
760
+ - **(NEW) Ensemble Distance Classification**: Leverages an ensemble approach to use different distance metrics for each quantile, improving classification performance across diverse data distributions.
761
+ - **(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.
754
762
 
755
763
  ## Documentation
756
764
 
@@ -765,27 +773,30 @@ DistClassiPy is released under the [GNU General Public License v3.0](https://www
765
773
  ## Citation
766
774
 
767
775
  If you use DistClassiPy in your research or project, please consider citing the paper:
768
- > Chaini, S., Mahabal, A., Kembhavi, A., & Bianco, F. B. (2024). Light Curve Classification with DistClassiPy: a new distance-based classifier. arXiv. https://doi.org/10.48550/arXiv.2403.12120
776
+ > 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.
769
777
 
770
778
  ### Bibtex
771
779
 
772
780
 
773
781
  ```bibtex
774
- @ARTICLE{chaini2024light,
775
- author = {{Chaini}, Siddharth and {Mahabal}, Ashish and {Kembhavi}, Ajit and {Bianco}, Federica B.},
776
- title = "{Light Curve Classification with DistClassiPy: a new distance-based classifier}",
777
- journal = {arXiv e-prints},
778
- keywords = {Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Solar and Stellar Astrophysics, Computer Science - Machine Learning},
779
- year = 2024,
780
- month = mar,
781
- eid = {arXiv:2403.12120},
782
- pages = {arXiv:2403.12120},
783
- archivePrefix = {arXiv},
782
+ @ARTICLE{2024A&C....4800850C,
783
+ author = {{Chaini}, S. and {Mahabal}, A. and {Kembhavi}, A. and {Bianco}, F.~B.},
784
+ title = "{Light curve classification with DistClassiPy: A new distance-based classifier}",
785
+ journal = {Astronomy and Computing},
786
+ 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},
787
+ year = 2024,
788
+ month = jul,
789
+ volume = {48},
790
+ eid = {100850},
791
+ pages = {100850},
792
+ doi = {10.1016/j.ascom.2024.100850},
793
+ archivePrefix = {arXiv},
784
794
  eprint = {2403.12120},
785
- primaryClass = {astro-ph.IM},
786
- adsurl = {https://ui.adsabs.harvard.edu/abs/2024arXiv240312120C},
787
- adsnote = {Provided by the SAO/NASA Astrophysics Data System}
795
+ primaryClass = {astro-ph.IM},
796
+ adsurl = {https://ui.adsabs.harvard.edu/abs/2024A&C....4800850C},
797
+ adsnote = {Provided by the SAO/NASA Astrophysics Data System}
788
798
  }
799
+
789
800
  ```
790
801
 
791
802
 
@@ -40,17 +40,25 @@ X, y = make_classification(
40
40
  random_state=0,
41
41
  shuffle=False,
42
42
  )
43
- clf = dcpy.DistanceMetricClassifier(metric="canberra")
43
+ # Example usage of DistanceMetricClassifier
44
+ clf = dcpy.DistanceMetricClassifier()
44
45
  clf.fit(X, y)
45
- print(clf.predict([[0, 0, 0, 0]]))
46
+ print(clf.predict([[0, 0, 0, 0]], metric="canberra"))
47
+
48
+ # Example usage of EnsembleDistanceClassifier
49
+ ensemble_clf = dcpy.EnsembleDistanceClassifier(feat_idx=0)
50
+ ensemble_clf.fit(X, y)
51
+ print(ensemble_clf.predict(X))
46
52
  ```
47
53
 
48
54
  ## Features
49
55
  - **Distance Metric-Based Classification**: Utilizes a variety of distance metrics for classification.
50
56
  - **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.
51
57
  - **Interpretable Results**: Offers improved interpretability of classification outcomes by directly using distance metrics and feature importance, making it ideal for scientific applications.
52
- - **Efficient and Scalable**: Demonstrates lower computational requirements compared to traditional methods like Random Forests, making it suitable for large datasets
53
- - **Open Source and Accessible**: Available as an open-source Python package on PyPI, encouraging broad application in astronomy and beyond
58
+ - **Efficient and Scalable**: Demonstrates lower computational requirements compared to traditional methods like Random Forests, making it suitable for large datasets.
59
+ - **Open Source and Accessible**: Available as an open-source Python package on PyPI, encouraging broad application in astronomy and beyond.
60
+ - **(NEW) Ensemble Distance Classification**: Leverages an ensemble approach to use different distance metrics for each quantile, improving classification performance across diverse data distributions.
61
+ - **(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.
54
62
 
55
63
  ## Documentation
56
64
 
@@ -65,27 +73,30 @@ DistClassiPy is released under the [GNU General Public License v3.0](https://www
65
73
  ## Citation
66
74
 
67
75
  If you use DistClassiPy in your research or project, please consider citing the paper:
68
- > Chaini, S., Mahabal, A., Kembhavi, A., & Bianco, F. B. (2024). Light Curve Classification with DistClassiPy: a new distance-based classifier. arXiv. https://doi.org/10.48550/arXiv.2403.12120
76
+ > 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.
69
77
 
70
78
  ### Bibtex
71
79
 
72
80
 
73
81
  ```bibtex
74
- @ARTICLE{chaini2024light,
75
- author = {{Chaini}, Siddharth and {Mahabal}, Ashish and {Kembhavi}, Ajit and {Bianco}, Federica B.},
76
- title = "{Light Curve Classification with DistClassiPy: a new distance-based classifier}",
77
- journal = {arXiv e-prints},
78
- keywords = {Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Solar and Stellar Astrophysics, Computer Science - Machine Learning},
79
- year = 2024,
80
- month = mar,
81
- eid = {arXiv:2403.12120},
82
- pages = {arXiv:2403.12120},
83
- archivePrefix = {arXiv},
82
+ @ARTICLE{2024A&C....4800850C,
83
+ author = {{Chaini}, S. and {Mahabal}, A. and {Kembhavi}, A. and {Bianco}, F.~B.},
84
+ title = "{Light curve classification with DistClassiPy: A new distance-based classifier}",
85
+ journal = {Astronomy and Computing},
86
+ 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},
87
+ year = 2024,
88
+ month = jul,
89
+ volume = {48},
90
+ eid = {100850},
91
+ pages = {100850},
92
+ doi = {10.1016/j.ascom.2024.100850},
93
+ archivePrefix = {arXiv},
84
94
  eprint = {2403.12120},
85
- primaryClass = {astro-ph.IM},
86
- adsurl = {https://ui.adsabs.harvard.edu/abs/2024arXiv240312120C},
87
- adsnote = {Provided by the SAO/NASA Astrophysics Data System}
95
+ primaryClass = {astro-ph.IM},
96
+ adsurl = {https://ui.adsabs.harvard.edu/abs/2024A&C....4800850C},
97
+ adsnote = {Provided by the SAO/NASA Astrophysics Data System}
88
98
  }
99
+
89
100
  ```
90
101
 
91
102
 
@@ -22,7 +22,17 @@ You should have received a copy of the GNU General Public License
22
22
  along with this program. If not, see <https://www.gnu.org/licenses/>.
23
23
  """
24
24
 
25
- from .classifier import DistanceMetricClassifier # noqa
26
- from .distances import Distance # noqa
25
+ from .classifier import (
26
+ DistanceMetricClassifier,
27
+ EnsembleDistanceClassifier,
28
+ )
29
+ from .distances import Distance, _ALL_METRICS
27
30
 
28
- __version__ = "0.1.5"
31
+ __version__ = "0.2.0"
32
+
33
+ __all__ = [
34
+ "DistanceMetricClassifier",
35
+ "EnsembleDistanceClassifier",
36
+ "Distance",
37
+ "_ALL_METRICS",
38
+ ]