Skip to content

Commit

Permalink
docs: Improved readability
Browse files Browse the repository at this point in the history
  • Loading branch information
sidchaini committed Oct 21, 2024
1 parent e06a4db commit 9824b36
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ X, y = make_classification(
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"))
Expand Down
23 changes: 22 additions & 1 deletion distclassipy/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
This module contains the DistanceMetricClassifier introduced by Chaini et al. (2024)
in "Light Curve Classification with DistClassiPy: a new distance-based classifier"
.. autoclass:: distclassipy.classifier.DistanceMetricClassifier
:members:
:exclude-members: set_fit_request, set_predict_request
.. doctest-skip::
.. skip::
Copyright (C) 2024 Siddharth Chaini
-----
This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -440,6 +449,8 @@ def find_best_metrics(
into quantiles based on the specified feature and calculates the accuracy
of the classifier for each metric within these quantiles.
.. versionadded:: 0.2.0
Parameters
----------
clf : DistanceMetricClassifier
Expand Down Expand Up @@ -507,7 +518,17 @@ def find_best_metrics(


class EnsembleDistanceClassifier(BaseEstimator, ClassifierMixin):
"""An ensemble classifier that uses different metrics for each quantile."""
"""An ensemble classifier that uses different metrics for each quantile.
This classifier splits the data into quantiles based on a specified
feature and uses different distance metrics for each quantile to
construct an ensemble classifier for each quantile, generally leading
to better performance.
Note, however, this involves fitting the training set for each metric
to evaluate performance, making this more computationally expensive.
.. versionadded:: 0.2.0
"""

def __init__(
self,
Expand Down

0 comments on commit 9824b36

Please sign in to comment.