breaks ties randomly
This commit is contained in:
parent
49d1287335
commit
2b234a988b
@ -4,11 +4,10 @@
|
|||||||
(defn argmax
|
(defn argmax
|
||||||
"returns the index of the maximum value in a list"
|
"returns the index of the maximum value in a list"
|
||||||
[coll]
|
[coll]
|
||||||
;(prn {:func :argmax :coll coll})
|
|
||||||
(->> coll
|
(->> coll
|
||||||
(map-indexed vector)
|
(map-indexed vector)
|
||||||
(apply max-key second)
|
(apply max-key second)
|
||||||
first))
|
rand-nth))
|
||||||
|
|
||||||
(defn mean
|
(defn mean
|
||||||
"Returns the mean of a collection."
|
"Returns the mean of a collection."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user