AlgoPlus is a C++ library that includes ready-to-use complex data structures and algorithms for various topics, including Machine Learning and Image Processing.
See the full documentation here
Join our Discord
#include "machine_learning/clustering/DBSCAN/dbscan.h"
// AlgoPlus now has Machine Learning classes!
int main(){
std::vector<std::vector<double> > data;
...
// Eps = 4, MinPts = 3
DBSCAN a(data, 4, 3);
// returns the clusters and noise of the DBSCAN clustering
std::map<std::pair<double, double>, int64_t> clusters = a.get_clusters();
std::vector<std::pair<double, double> > noise = a.get_noise();
...
}
#include "machine_learning/image/edge_detection/sobel_operator.h"
// As well as image processing algorithms!
int main(){
...
std::vector<std::vector<int32_t> > img(data);
// Performs edge detection on image img
std::vector<std::vector<int32_t> > resulted = Sobel(img);
...
}
#define ENABLE_GRAPH_VISUALIZATION
#include "graph/graph.h"
// And of course, every data structure that you need!
int main(){
weighted_graph<int> g("undirected");
g.add_edge(1, 4, 2);
g.add_edge(4, 5, 6);
g.add_edge(5, 2, 9);
g.add_edge(2, 8, 10);
// returns the shortest path from 1 to 2.
std::cout << g.shortest_path(1, 2) << '\n';
g.visualize() // You can visualize almost any of our implemented data structures!
}
You can see more examples or follow the Tutorials.
Note
This repository is a set of implementations and not a complete library meant for production or research. So whenever you see a bug or something not working as it should, please report it to us and we will try our best to fix it.
Machine Learning(NEW!)
- Clustering Algorithms
- Encoders
- Regression Algorithms
- Classification Algorithms
- Shortest Path Algorithms
- Image Processing Algorithms
- Activation Functions
- Loss functions
Graphs
Trees
- Red-Black Tree
- AVL Tree
- Binary Search Tree
- Splay Tree
- Trie
- Segment Tree
- Fenwick Tree
- Interval Tree
- 234 Tree
- Min/Max Heap
Lists
Algorithms
Other
Tip
We are currently looking for contributions on machine learning classes and algorithms!
We have unit tests for every function of our implemented algorithms & data structures. It is very important to make sure that your code works before making any pull requests!
Linux/MacOS
mkdir build && cd build
cmake ..
make
cd tests
./runUnitTests
Windows
mkdir build
cmake -S . -B build -G Ninja
cmake --build build
cd build/tests
./runUnitTests
Note
The splay tree's unit tests are failing in some OS's. We are working on a solution
-
Povide new implementations on our already implemented data structures & algorithms.
-
Implement new classes / algorithms.
-
Contribute to unit testing by writting unit tests for our classes and algorithms.
-
Create and contribute to APIs for other languages(Check AlgoPy branch).
-
Promote the repository on your local workshop/seminar and get a shout-out.
Please have in mind that this work is open source and free to use under the Apache 2.0 licence. Please feel free to cite the repo or our contributors for this work. See more here.
For any information or questions, please contact Spiros at spirosmag@ieee.org