Library which can be used for machine learning in C++.
To use this library locally
Prerequisites
Then following command will install the library
UNIX (Linux/Macos)
mkdir build
cd build
cmake ../
cmake --build .
sudo cmake --install .
WINDOWS
cmake -G "MinGW Makefiles" -S . -B build
cmake --build build
cmake --install build --prefix '<ADD PATH OF MINGW INCLUDE HERE (mingw64/include)>'
If permission is required to execute, run the following command
chmod 705 ./install
Following are the steps to start contributing to our beautiful library:
- Install an IDE, preferably CLion.
- Fork this repo.
- Clone the forked repo, using
git clone https://github.com/PEC-CSS/slowmokit.git
.
After this,
You can directly use the executable file by running ./create
in the root folder of library, to do the required configurations.
More details here
If it does not work then you need to configure everything by your own.
-
Make the model directory you want to implement in the
src/slowmokit/methods/<model type>/<your_model>
.<model type>
is basically the class of your model, for examplelinear_model
orcluster
.
-
Create two files:
<model>.hpp
: the header file for the model, create the class of model here and include all the stuff required for the model here.- Include
core.hpp
for all the basic functionalities already added. - Make sure to add doc comments above each function signature (refer other files for the format)
- Variable and function names should be in camel case and class names should be in pascal case in all files.
- Include
<model>.cpp
: implement the functions of the class here.
-
Add the header file
<model>.hpp
insrc/slowmokit.hpp
under the documentation block as shown here. More on documentation block. -
Test the working by building in IDE.
This step is mandatory
- Format the files according to the convention. For simplicity, run
./clang-format-all src/
in gitbash(if on windows) or in terminal(if on linux/macos)
For this you need to have clang-format
binaries installed in the machine.
To do that, run the following in the terminal
# with npm (windows)
npm install -g clang-format
# you have to restart terminal in case of windows
# with homebrew (macos)
brew install clang-format
# linux (Ubuntu)
sudo apt install clang-format
NOTE: Do NOT use
#include <bits/stdc++.h>
in any file, all the major header files are already included incore.hpp
.]
Once the algorithm is ready, run and test it. After testing, push it in the examples
directory, with proper comments and
instructions. With same directory structure as in src
.
Push the docs of the model in a <model>.md
file in same directory structure in docs
folder.
After code is ready, you can make PR to the main branch. PR will be accepted only if:
- Code pass the CI tests.
- Example is pushed.
- Code has proper comments and instructions.