Machine Learning library for Common Lisp
Martin Kersner, [email protected]
cl-ml
currently supports following machine learning algorithms:
- k-Nearest Neighbors
- Linear Regression
- Logistic Regression
- Decision Trees (ID3)
- Support Vector Machines
- Multinomial Naive Bayes Classifier
- Artificial Neural Networks
cl-ml
requires asdf to be installed. cl-math
and cl-plot
are included as submodules to cl-ml
project.
git clone --recursive https://github.com/martinkersner/cl-ml.git
(load "init")
Currently, only Multinomial Naive Bayes Classifier is supported.
- Create instance of Naive Bayes Classifier
(defparameter *nbc*
(make-instance 'naive-bayes-classifier))
- Pass training data. Training data will be transformed to feature vectors within training procedure.
; X-train represent training data in list of lists format
; y-train represent training labels in cl-math matrix format
(fit *nbc* X-train y-train)
- Predict on new data
; X-test represent training data in list of lists format
(predict *nbc* X-test)
Currently, only fully connected layers with sigmoid activation function are supported. Optimization is performed using Stochastic Gradient Descent (SGD).
- Create network with 2 neurons in input layer, 3 neurons in hidden layer and 1 neuron the output layer.
(defparameter *nn*
(make-instance 'neural-network :nn-dims '(2 3 1)))
- Define training parameters for SGD.
(defparameter *params*
(generate-params '((num-epoch 50)
(lr 0.3)
(mini-batch-size 20))))
- Start training.
; X-train represent training data in cl-math matrix format
; y-train represent training labels in cl-math matrix format
(fit *nn* X-train y-train *params*)
- Predict on new data.
; X-test represent testing data in cl-math matrix format
(predict *nn* X-test)
- Add new algorithms
- k-Means
- Adaboost
- Autoencoders
- CNN
- Add new default data sets
- Methods for data manipulation
- Generating new data
- Methods enabling easier training
- Cross validation
- Grid search