rinuboney / clatern

Machine Learning in Clojure
Eclipse Public License 1.0
67 stars 12 forks source link

Add `predict`, `predict-prob`, and `predict-log-prob` as core functions #38

Open rnowling opened 9 years ago

rnowling commented 9 years ago

Clatern's current interface has functions for training various types of models. The models are returned as records which implement the IFn protocol so they can be called as functions to predict the classes of input vectors (and/or matrices, in some cases).

In addition to predicting a class label, some models can predict the probabilities that an input sample belongs to each class. In fact, this functionality is needed by Random Forests to make class label predictions from Decision Trees. As such, I created a new protocol ClassProbabilityEstimator with predict-prob and predict-log-prob functions in PR #37.

After discussions on PR #37, Rinu and I decided to follow the example of core.matrix and provide top-level predict, predict-prob, and predict-log-prob functions that employ the protocols.

rnowling commented 9 years ago

We should also implement probability calculations for Logistic Regression, Naive Bayes, and any other classifiers that support it. These should probably be separate PRs so they can be completed modularly.