Skip to content

Commit

Permalink
Add note for ordering multiclass business value matrix (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikml committed Jul 29, 2024
1 parent a954428 commit 87f0d48
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs/how_it_works/business_value.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ observations in that cell of the :term:`confusion matrix<Confusion Matrix>`. Usi
matrix notation the element on the i-th row and j-column of the business value matrix tells us the value
of the i-th target when we have predicted the j-th value.

.. note::
In Multiclass classification the classes are ordered alphanumerically.
This is used in the creation of the confusion matrix. The rows of the confusion matrix
represent target values in the corresponding alphanumerical order. And the columns
of the confusion matrix represent predicted classes in the same alphanumerical order.
Therefore the elements of the business value matrix should be constructed accordingly.

For binary classification this formula is easier to manage hence we will use it as an example. Classificatio problems
with more classes follow the same pattern.
Using the `sklearn confusion matrix convention`_ we designate label 0 as negative and label 1 as positive.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ the following parameter specifications:
The format of the business value matrix must be specified so that each element represents the business
value of it's respective confusion matrix element. Hence the element on the i-th row and j-column of the
business value matrix tells us the value of the i-th target when we have predicted the j-th value.
It can be provided as a list of lists or a numpy array.
The target values that each column and row refer are sorted alphanumerically for both
the confusion matrix and the business value matrices.

The business value matrix can be provided as a list of lists or a numpy array.
For more information about the business value matrix,
check out the :ref:`Business Value "How it Works" page<business-value-deep-dive>`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ parameters:
The format of the business value matrix must be specified so that each element represents the business
value of it's respective confusion matrix element. Hence the element on the i-th row and j-column of the
business value matrix tells us the value of the i-th target when we have predicted the j-th value.
It can be provided as a list of lists or a numpy array.
The target values that each column and row refer are sorted alphanumerically for both
the confusion matrix and the business value matrices.

The business value matrix can be provided as a list of lists or a numpy array.
For more information about the business value matrix,
check out the :ref:`Business Value "How it Works" page<business-value-deep-dive>`.

Expand Down

0 comments on commit 87f0d48

Please sign in to comment.