From 9824b360d51172eec97d0038bf55255c31e2159e Mon Sep 17 00:00:00 2001 From: Siddharth Chaini <40721514+sidchaini@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:30:27 -0400 Subject: [PATCH] docs: Improved readability --- README.md | 1 + distclassipy/classifier.py | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b53a064..ee05c39 100644 --- a/README.md +++ b/README.md @@ -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")) diff --git a/distclassipy/classifier.py b/distclassipy/classifier.py index bde4ab7..f12eae7 100644 --- a/distclassipy/classifier.py +++ b/distclassipy/classifier.py @@ -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 @@ -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 @@ -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,