distclassipy 0.1.6a0__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.6a0
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
 
@@ -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
 
@@ -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.6a0"
31
+ __version__ = "0.2.0"
32
+
33
+ __all__ = [
34
+ "DistanceMetricClassifier",
35
+ "EnsembleDistanceClassifier",
36
+ "Distance",
37
+ "_ALL_METRICS",
38
+ ]