tech.ml icon indicating copy to clipboard operation
tech.ml copied to clipboard

docs - metrics namespace

Open hjrnunes opened this issue 4 years ago • 1 comments

many docstrings in the tech.v3.ml.metrics namespace seem wrong/outdated.

The ones in question generally state or imply returns to be arrays of 0.0 and 1.0 values. In reality, booleans are returned because tech.v3.datatype.functional/eq or tech.v3.datatype.functional/not-eq are used underneath.

Examples:

(require '[tech.v3.ml.metrics :as m])

(doc m/wrongs)
-------------------------
tech.v3.ml.metrics/wrongs
([y y_hat])
  Given `y` array of ground truth labels and `y_hat` classifier predictions,
  returns array with 1.0 values where `y` does not equal `y_hat`.

(m/wrongs [:a :a :b] [:a :a :a])
=> [false false true]


(doc m/true-negatives)
-------------------------
tech.v3.ml.metrics/true-negatives
([y y_hat])
  Returns array with 1. values assigned to true negatives.

(m/true-negatives [1.0 1.0 0.0] [1.0 1.0 1.0])
=> [false false false]

hjrnunes avatar Apr 11 '21 15:04 hjrnunes

Good point. Booleans will convert to 1,0 when read as a number but the docs are wrong.

cnuernber avatar Apr 11 '21 16:04 cnuernber