Giter Site home page Giter Site logo

cl-mlep's People

Contributors

fzalkow avatar kevinxwang613 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cl-mlep's Issues

Update cl-num-utils

Hello Frank,

I'm glad to have found this library; I've been looking for some machine learning code in Common Lisp that doesn't have a restrictive license, and found this because I'm the new maintainer of LLA, and when updating it in Quicklisp discovered some breakage.

cl-num-utils has been updated and renamed num-utils, and that's what now LLA uses. Here, when used together, there is a package name clash because LLA and cl-num-utils aren't in sync.

The fix is to change cl-num-utils -> num-utils in the mlep-add ASDF file.

Version 2.0?

Would you be interested in working together on an updated version of cl-mlep based on Lisp-Stat? Data frames, plotting and statistics are all built-in and I think cl-mlep would make a great introduction/tutorial for Lisp-Stat.

Run Bayes Crash

The following code is crashing run byes

(setf labels '(2 1 1 1 1 1 1 1))

(setf test-set '((99 0 21 98 97 0 0 0 0 96 95 18 94 84 93 14 13 53 92 10 9 8 91 90 89 88 87)))

(setf data '((86 0 21 85 0 0 0 0 0 67 19 18 67 84 83 14 13 63 62 10 9 82 81 80 79 78 3)
(77 0 21 76 0 0 0 0 0 75 19 18 74 65 73 14 13 63 52 10 9 72 71 70 59 69 3)
(68 0 21 56 0 0 0 0 0 67 19 18 66 65 64 14 13 63 62 10 9 8 61 60 59 58 3)
(57 0 21 56 0 0 0 0 0 55 19 18 55 43 54 14 13 53 52 10 9 8 51 50 49 48 3)
(47 0 21 46 0 0 0 0 0 45 19 18 44 43 42 14 13 12 11 10 9 8 41 40 39 38 3)
(37 0 21 20 0 0 0 0 0 36 19 18 35 27 15 14 13 12 34 10 9 8 33 32 31 30 3)
(29 0 21 20 0 0 0 0 0 28 19 18 28 27 15 14 13 12 11 10 9 8 26 25 24 23 3)
(22 0 21 20 0 0 0 0 0 17 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3)))

(setf my-bayes (make-instance 'mlep:naive-bayes
:data-set data
:set-labels labels
:test-set test-set))

If I hack the code like this it removes the error but I dont know if the default value of eish should be 0.

(defmethod run ((instance naive-bayes) &key)
(declare (optimize (debug 3)))
(with-slots (data-set set-labels test-set all-labels prior-probabilities likelihoods) instance
(when (/= (length data-set) (length set-labels))
(error "Each item in data-set' has to have a label inset-labels'. (At the moment they are of unequal length.)"))
(let ((result))
(dolist (item test-set (nreverse result))
(let ((probabilities))
(dolist (label all-labels)
(let ((tmp-prob (rest (find label prior-probabilities :key #'first))))
(dotimes (i (length item))
(let ((eish (cddar (member-if #'(lambda (lik)
(and (eql (first lik)
label)
(equal (second lik)
(cons i (nth i item)))))
likelihoods))))
(setf tmp-prob (* tmp-prob (if eish eish 0)))))
(push tmp-prob probabilities)))
(push (nth (max-arg (nreverse probabilities)) all-labels) result))))))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.