From 020b148ea993aa7d73041bf47359a1050b5bffa7 Mon Sep 17 00:00:00 2001 From: DavidRosen Date: Mon, 11 Oct 2021 15:46:09 -0400 Subject: [PATCH 1/3] Update metrics.rst -- say what bottom row of `classification_report_imbalanced` output contains Especially point out that the Weighted Average Recall that `classification_report_imbalanced` displays is also better known as the Accuracy! Maybe this should also be a change in the API docs for `classification_report_imbalanced` but the "Edit" link there didn't work. --- doc/metrics.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/metrics.rst b/doc/metrics.rst index 591f5ec1c..fb641e9fa 100644 --- a/doc/metrics.rst +++ b/doc/metrics.rst @@ -68,7 +68,12 @@ Summary of important metrics The :func:`classification_report_imbalanced` will compute a set of metrics per class and summarize it in a table. The parameter `output_dict` allows to get a string or a Python dictionary. This dictionary can be reused to create -a Pandas dataframe for instance. +a Pandas dataframe for instance. Its "avg/total" bottom row contains +the Weighted Average of each column (weighting is by the sup (Support), i.e. by +the true class proportions), except the sup (Support) column whose total +appears at its bottom. Also note that the avg value at the bottom of the "rec" +column is simply the Accuracy because Weighted Average Recall is just another +name for Accuracy. .. _pairwise_metrics: From 79394a37699b0449602bd1d66e97f0901aacf9c3 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Tue, 7 Dec 2021 14:13:19 +0100 Subject: [PATCH 2/3] CI solve issue of bash install file --- build_tools/azure/install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build_tools/azure/install.sh b/build_tools/azure/install.sh index d07234806..5a140315b 100755 --- a/build_tools/azure/install.sh +++ b/build_tools/azure/install.sh @@ -75,10 +75,10 @@ elif [[ "$DISTRIB" == "conda-pip-latest-tensorflow" ]]; then python -m pip install numpy scipy scikit-learn pandas tensorflow elif [[ "$DISTRIB" == "conda-latest-tensorflow" ]]; then - make_conda " python=$PYTHON_VERSION numpy scipy scikit-learn pandas tensorflow" + make_conda "python=$PYTHON_VERSION numpy scipy scikit-learn pandas tensorflow" elif [[ "$DISTRIB" == "conda-minimum-tensorflow" ]]; then - TO_INSTALL="$python=$PYTHON_VERSION" + TO_INSTALL="python=$PYTHON_VERSION" TO_INSTALL="$TO_INSTALL $(get_dep numpy $NUMPY_VERSION)" TO_INSTALL="$TO_INSTALL $(get_dep scipy $SCIPY_VERSION)" TO_INSTALL="$TO_INSTALL $(get_dep scikit-learn $SKLEARN_VERSION)" @@ -87,7 +87,7 @@ elif [[ "$DISTRIB" == "conda-minimum-tensorflow" ]]; then make_conda $TO_INSTALL elif [[ "$DISTRIB" == "conda-pip-latest-keras" ]]; then - make_conda "=$PYTHON_VERSION" + make_conda "python=$PYTHON_VERSION" python -m pip install -U pip python -m pip install numpy scipy scikit-learn pandas keras @@ -96,7 +96,7 @@ elif [[ "$DISTRIB" == "conda-latest-keras" ]]; then make_conda "=$PYTHON_VERSION numpy scipy scikit-learn pandas keras" elif [[ "$DISTRIB" == "conda-minimum-keras" ]]; then - TO_INSTALL="=$PYTHON_VERSION" + TO_INSTALL="python=$PYTHON_VERSION" TO_INSTALL="$TO_INSTALL $(get_dep numpy $NUMPY_VERSION)" TO_INSTALL="$TO_INSTALL $(get_dep scipy $SCIPY_VERSION)" TO_INSTALL="$TO_INSTALL $(get_dep scikit-learn $SKLEARN_VERSION)" @@ -105,7 +105,7 @@ elif [[ "$DISTRIB" == "conda-minimum-keras" ]]; then make_conda $TO_INSTALL elif [[ "$DISTRIB" == "conda-pip-scipy-dev" ]]; then - make_conda "=$PYTHON_VERSION" + make_conda "python=$PYTHON_VERSION" python -m pip install -U pip echo "Installing numpy and scipy master wheels" dev_anaconda_url=https://pypi.anaconda.org/scipy-wheels-nightly/simple From 43c9be7f0f81ba3eb3c48bb1f0d66124e837d6f4 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Tue, 7 Dec 2021 14:42:30 +0100 Subject: [PATCH 3/3] review --- doc/metrics.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/doc/metrics.rst b/doc/metrics.rst index fb641e9fa..315a20f88 100644 --- a/doc/metrics.rst +++ b/doc/metrics.rst @@ -65,15 +65,16 @@ each class and averaged over classes, giving an equal weight to each class. Summary of important metrics ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The :func:`classification_report_imbalanced` will compute a set of metrics -per class and summarize it in a table. The parameter `output_dict` allows -to get a string or a Python dictionary. This dictionary can be reused to create -a Pandas dataframe for instance. Its "avg/total" bottom row contains -the Weighted Average of each column (weighting is by the sup (Support), i.e. by -the true class proportions), except the sup (Support) column whose total -appears at its bottom. Also note that the avg value at the bottom of the "rec" -column is simply the Accuracy because Weighted Average Recall is just another -name for Accuracy. +The :func:`classification_report_imbalanced` will compute a set of metrics per +class and summarize it in a table. The parameter `output_dict` allows to get a +string or a Python dictionary. This dictionary can be reused to create a Pandas +dataframe for instance. + +The bottom row (i.e "avg/total") contains the weighted average by the support +(i.e column "sup") of each column. + +Note that the weighted average of the class recalls is also known as the +classification accuracy. .. _pairwise_metrics: