From ad02551e84801fe921e7a72df424b9c88871418a Mon Sep 17 00:00:00 2001 From: Kazuki Adachi Date: Sat, 12 Oct 2024 22:51:05 +0900 Subject: [PATCH] Modify docstring for rank correlation metrics (#3291) * add SpearmanRankCorrelation metric * add KendallRankCorrelation metric * add import check of scipy * fix type hints * fix formatting error * minor modification to docstring * add versionadded directive to docstring * add description for skip_unrolling argument * remove check_compute_fn argument * minor update on docstring * Revert "remove check_compute_fn argument" This reverts commit 642b3f63315421df60826bbabd6332f94538f60e. * add description for check_compute_fn argument --------- Co-authored-by: vfdev --- ignite/metrics/regression/kendall_correlation.py | 3 +++ ignite/metrics/regression/spearman_correlation.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ignite/metrics/regression/kendall_correlation.py b/ignite/metrics/regression/kendall_correlation.py index 04090d0d7d9..7ad87b22402 100644 --- a/ignite/metrics/regression/kendall_correlation.py +++ b/ignite/metrics/regression/kendall_correlation.py @@ -55,6 +55,9 @@ class KendallRankCorrelation(EpochMetric): form expected by the metric. This can be useful if, for example, you have a multi-output model and you want to compute the metric with respect to one of the outputs. By default, metrics require the output as ``(y_pred, y)`` or ``{'y_pred': y_pred, 'y': y}``. + check_compute_fn: if True, ``compute_fn`` is run on the first batch of data to ensure there are no + issues. If issues exist, user is warned that there might be an issue with the ``compute_fn``. + Default, True. device: specifies which device updates are accumulated on. Setting the metric's device to be the same as your ``update`` arguments ensures the ``update`` method is non-blocking. By default, CPU. diff --git a/ignite/metrics/regression/spearman_correlation.py b/ignite/metrics/regression/spearman_correlation.py index f5cc3cfff7b..175198ed688 100644 --- a/ignite/metrics/regression/spearman_correlation.py +++ b/ignite/metrics/regression/spearman_correlation.py @@ -46,6 +46,9 @@ class SpearmanRankCorrelation(EpochMetric): form expected by the metric. This can be useful if, for example, you have a multi-output model and you want to compute the metric with respect to one of the outputs. By default, metrics require the output as ``(y_pred, y)`` or ``{'y_pred': y_pred, 'y': y}``. + check_compute_fn: if True, ``compute_fn`` is run on the first batch of data to ensure there are no + issues. If issues exist, user is warned that there might be an issue with the ``compute_fn``. + Default, True. device: specifies which device updates are accumulated on. Setting the metric's device to be the same as your ``update`` arguments ensures the ``update`` method is non-blocking. By default, CPU.