Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,15 +0,0 @@
|
|||
(defun shannon-entropy (input)
|
||||
(let ((freq-table (make-hash-table))
|
||||
(entropy 0)
|
||||
(length (+ (length input) 0.0)))
|
||||
(mapcar (lambda (x)
|
||||
(puthash x
|
||||
(+ 1 (gethash x freq-table 0))
|
||||
freq-table))
|
||||
input)
|
||||
(maphash (lambda (k v)
|
||||
(set 'entropy (+ entropy
|
||||
(* (/ v length)
|
||||
(log (/ v length) 2)))))
|
||||
freq-table)
|
||||
(- entropy)))
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
(shannon-entropy "1223334444")
|
||||
1.8464393446710154
|
||||
Loading…
Add table
Add a link
Reference in a new issue