Machine Learning in C++

Shark, MLpack, Dlib, OpenCV Libraries

SHARK

Used in: Regression tasks

sudo apt-get install cmake cmake-curses-gui libatlas-base-dev libboost-all-dev# Download package
mkdir build
cd build
cmake ..
make -j
#include <shark/ObjectiveFunctions/Loss/SquaredLoss.h>
#include <shark/Algorithms/Trainers/LinearRegression.h>
-std=c++11 -lboost_serialization -lshark -lcblas

MLPACK

Used in: Clustering tasks

apt-get install libboost-math-dev libboost-program-options-dev libboost-test-dev libboost-serialization-dev libarmadillo-dev binutils-devsudo apt-get install libmlpack-dev
(or)
sudo apt-get install mlpack-bin
#include <mlpack/methods/kmeans/kmeans.hpp>
#include <armadillo>
std=c++11 -larmadillo -lmlpack -lboost_serialization

DLIB

Used in: Clustering and lot more algorithms

mkdir build
cd build
cmake ..
cmake -build . --config Release
#include <dlib/clustering.h>
#include <dlib/rand.h>
g++ -I /home/admin/Programs/dlib-19.7/ /home/admin/Programs/dlib-19.7/dlib/all/source.cpp -lpthread -lX11

OPENCV

Used in: Image processing

sudo apt-get install build-essentialsudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-devsudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libc1394-22-devgit clone https://github.com/opencv/opencv.git
cd ~/opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j8
sudo make install
#include "opencv2/objdetect.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
pkg-config --libs --cflags opencv
(or)
compile using cmake

Consultant