mirror of
https://github.com/Relintai/MLPP.git
synced 2024-11-12 10:15:01 +01:00
Merge branch 'main' of https://github.com/novak-99/MLPP into main
This commit is contained in:
commit
8a57f5af25
29
README.md
29
README.md
@ -1,12 +1,30 @@
|
||||
# ML++
|
||||
|
||||
Machine learning is a vast and exiciting discipline, garnering attention from specialists of many fields. Unfortunately, for C++ programmers and enthusiasts, there appears to be a lack of support for this magnificient language in the field of machine learning. As a consequence, this library was created in order to fill that void and give C++ a true foothold in the ML sphere to act as a crossroad between low level developers and machine learning engineers.
|
||||
Machine learning is a vast and exiciting discipline, garnering attention from specialists of many fields. Unfortunately, for C++ programmers and enthusiasts, there appears to be a lack of support for this magnificient language in the field of machine learning. To fill that void and give C++ a true foothold in the ML sphere, this library was written. My intent with this library is for it to act as a crossroad between low-level developers and machine learning engineers.
|
||||
|
||||
<p align="center">
|
||||
<img src="https://user-images.githubusercontent.com/78002988/119920911-f3338d00-bf21-11eb-89b3-c84bf7c9f4ac.gif"
|
||||
width = 600 height = 400>
|
||||
</p>
|
||||
|
||||
## Installation
|
||||
Begin by downloading the header files for the ML++ library. You can do this by cloning the repository into a local directory and extracting the MLPP directory within it, as well as the "MLPP.so" file.
|
||||
```
|
||||
git clone https://github.com/novak-99/MLPP
|
||||
```
|
||||
After doing so, maintain the ML++ source files in a local directory and include them in this fashion:
|
||||
```cpp
|
||||
#include "MLPP/Stat/Stat.hpp" // Including the ML++ statistics module.
|
||||
|
||||
int main(){
|
||||
...
|
||||
}
|
||||
```
|
||||
Finally, after you have concluded writing your file, compile it using g++. Be sure to have the MLPP.so file in a local directory.
|
||||
```
|
||||
g++ main.cpp MLPP.so --std=c++17
|
||||
```
|
||||
|
||||
## Usage
|
||||
Please note that ML++ uses the ```std::vector<double>``` data type for emulating vectors, and the ```std::vector<std::vector<double>>``` data type for emulating matricies.
|
||||
|
||||
@ -18,7 +36,7 @@ Next, instantiate an object of the class. Don't forget to pass the input set and
|
||||
```cpp
|
||||
LinReg model(inputSet, outputSet);
|
||||
```
|
||||
Now call the optimizer that you would like to use. For iterative optimizers such as gradient descent, include the learning rate, epoch number, and whether or not to utilize the UI pannel.
|
||||
Afterwards, call the optimizer that you would like to use. For iterative optimizers such as gradient descent, include the learning rate, epoch number, and whether or not to utilize the UI pannel.
|
||||
```cpp
|
||||
model.gradientDescent(0.001, 1000, 0);
|
||||
```
|
||||
@ -27,6 +45,7 @@ Great, you are now ready to test! To test a singular testing instance, utilize t
|
||||
model.modelTest(testSetInstance);
|
||||
```
|
||||
This will return the model's singular prediction for that example.
|
||||
|
||||
To test an entire dataset of instances, use the following function:
|
||||
```cpp
|
||||
model.modelSetTest(testSet);
|
||||
@ -119,3 +138,9 @@ The result will be the model's predictions for the entire dataset.
|
||||
3. Mean Normalization
|
||||
4. One Hot Representation
|
||||
5. Reverse One Hot Representation
|
||||
14. ***Utilities***
|
||||
1. TP, FP, TN, FN function
|
||||
2. Precision
|
||||
3. Recall
|
||||
4. Accuracy
|
||||
5. F1 score
|
||||
|
Loading…
Reference in New Issue
Block a user