Skip to content

Commit f08aba5

Browse files
author
autoih
committed
sanity check and missing doctest modules
1 parent 65e6329 commit f08aba5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tensorflow_addons/metrics/cohens_kappa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class CohenKappa(Metric):
3636
while calculating the Cohen's Kappa score.
3737
3838
Usage:
39-
39+
4040
>>> actuals = np.array([4, 4, 3, 4, 2, 4, 1, 1], dtype=np.int32)
4141
>>> preds = np.array([4, 4, 3, 4, 4, 2, 1, 1], dtype=np.int32)
4242
>>> weights = np.array([1, 1, 2, 5, 10, 2, 3, 3], dtype=np.int32)

tensorflow_addons/metrics/multilabel_confusion_matrix.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ class MultiLabelConfusionMatrix(Metric):
4747
- true positives for class i in M(1,1)
4848
4949
Usage:
50-
51-
>>> y_true = tf.constant([[1, 0, 1], [0, 1, 0]], dtype=tf.int32)
50+
51+
>>> y_true = tf.constant([[1, 0, 1], [0, 1, 0]], dtype=tf.int32)
5252
>>> y_pred = tf.constant([[1, 0, 0],[0, 1, 1]], dtype=tf.int32)
53-
>>> output1 = tfa.metrics.MultiLabelConfusionMatrix(num_classes=3)
53+
>>> output1 = tfa.metrics.MultiLabelConfusionMatrix(num_classes=3)
5454
>>> output1.update_state(y_true, y_pred)
5555
>>> output1.result()
5656
<tf.Tensor: shape=(3, 2, 2), dtype=float32, numpy=
@@ -62,10 +62,10 @@ class MultiLabelConfusionMatrix(Metric):
6262
<BLANKLINE>
6363
[[0., 1.],
6464
[1., 0.]]], dtype=float32)>
65-
>>> y_true = tf.constant([[1, 0, 0], [0, 1, 0]], dtype=tf.int32)
66-
>>> y_pred = tf.constant([[1, 0, 0],[0, 0, 1]], dtype=tf.int32)
67-
>>> output2 = tfa.metrics.MultiLabelConfusionMatrix(num_classes=3)
68-
>>> output2.update_state(y_true, y_pred)
65+
>>> y_true = tf.constant([[1, 0, 0], [0, 1, 0]], dtype=tf.int32)
66+
>>> y_pred = tf.constant([[1, 0, 0],[0, 0, 1]], dtype=tf.int32)
67+
>>> output2 = tfa.metrics.MultiLabelConfusionMatrix(num_classes=3)
68+
>>> output2.update_state(y_true, y_pred)
6969
>>> output2.result()
7070
<tf.Tensor: shape=(3, 2, 2), dtype=float32, numpy=
7171
array([[[1., 0.],

0 commit comments

Comments
 (0)