/machine-learning-package

machine learning method implemention

Primary LanguageC++

machine-learning-package

Implement useful machine learning method based on C++. The matrix operation relies on the eigen library and some methods uses opencv only for visualization.The machine method mainly include classification model such as SVM,logistic,decision tree,mlp etc, cluster model such as kmeans,gmm,dbscan,lvq etc and regression model such as linear regression.

Installation

This software has only been tested on ubuntu 16.04(x64), eigen3, opencv3.4. To install this package your compiler need to support C++11. All the machine learning methods shared the same interface which is convenient to call or modify.

git clone https://github.com/TJCVRS/machine-learning-package.git

Required Dependencies

Eigen3, boost and opencv required. Install them with

sudo apt-get install libopencv-dev libeigen3-dev libboost-all-dev

Build

cd ROOT_FOLDER
mkdir build
cd build
cmake ..
make -j

This will compile a binary file. You can modified the main_test.cpp and the CMakeLists.txt file to compile different machine learning model binary file. And you can write your own derived trainer class to adaptive your own data format.

Usage

Gaussian Mixture Model for clustering

./bin_root/gmmCluster ../data/kmeans.txt ../data/kmeans.txt ../kmeans.txt

Origin data distribution is as follows

gmm_cluster_ori

Clustering visualization result is as follows

gmm_cluster_visualization

DBScan Model for clustering

./bin_root/dbscanCluster ../data/kmeans.txt ../data/kmeans.txt ../kmeans.txt

Origin data distribution is as follows

dbscan_cluster_ori

Clustering visualization result is as follows

dbscan_cluster_visualization