Skip to content

Commit 2c8d597

Browse files
committed
most-informative-key implemented in terms of max-key
1 parent 8a3bffa commit 2c8d597

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/decision_tree/core.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@
5252
(map #(* (entropy %) (/ (count %) (count alist))) parts))))))
5353

5454
(defn most-informative-key [aseq]
55-
nil)
55+
"Given a sequence of pairs of (map, output), return the map key that provides the highest information gain about outout, when used to partition the sequence"
56+
(apply max-key #(gain % aseq) (all-keys (map first aseq))))

0 commit comments

Comments
 (0)