Prolog mlpack Library
Getting started
The Library contains 30 of the Machine Learning Methods from MLpack.
For example Linear_SVM, KMeans, Perceptron, Random_Forest, Kernel_PCA ... and more
Useful Links
- mlpack c++ documentation
- mlpack python documentation
- SICStus C Interface documentation
- prolog-mlpack-library documentation
Quickstart
How to get the project running:
-
Clone the project onto your system
-
Have MLpacks system Version installed (at best 3.4.2)
-
Have SICStus prolog installed (at least 4.7.1)
-
Have Ensmallen C++ Libary installed
(Required by the Methods Linear_SVM, LMNN, Logistic_regression and NCA)
-
Change the SPLFR_PATH Variable in the root folder Makefile to your absolute path to the SICStus splfr tool
-
Run the root folder Makefile using the command: make (optional if you dont have to change the splfr path and mlpack is installed in the default location)
// to compile
make
// or to remove the compiled glue files
make clean
After that you can use each Method by loading their module with SICStus e.g.
:- use_module('path/to/.../src/methods/dbscan/dbscan.pl').
%% usage example
TrainData = [5.1,3.5,1.4, 4.9,3.0,1.4, 4.7,3.2,1.3, 4.6,3.1,1.5],
dbscan(1.0, 1, 0, ordered, kd, TrainData, 3, AssignList, CentroidsList, _).
How to edit the project:
To edit the Project the steps are almost the same as above except you should also install the Eclipse IDE SICStus integration Spider.
Since it makes writing and running the prolog Code easier.
To test all methods there is a test_all.pl file in the root directory that you can compile with SICStus and then call :
run_tests.
Just make sure the SICStus Toplevel is the prolog-mlpack-libary root directory. (If not it will cause the predicate open/3, for opening files, to not find the iris2.csv)
Status
The Projekt was developt and tested on Ubuntu 22.04 LTS, with mlpack Version 3.4.2 and SICStus 4.7.1
older Ubuntu Version could run into the Problem, that their mlpack system version is missing a few of the methods