https://github.com/jackkimmins/simplenn
Feedforward Neural Network Classifier in C++ • Data Handling, Training, Prediction, and Evaluation
https://github.com/jackkimmins/simplenn
classification cpp feedforward-neural-network neural-network training
Last synced: 9 months ago
JSON representation
Feedforward Neural Network Classifier in C++ • Data Handling, Training, Prediction, and Evaluation
- Host: GitHub
- URL: https://github.com/jackkimmins/simplenn
- Owner: jackkimmins
- Created: 2024-03-31T09:33:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-08T08:19:15.000Z (about 2 years ago)
- Last Synced: 2025-03-27T00:54:04.955Z (over 1 year ago)
- Topics: classification, cpp, feedforward-neural-network, neural-network, training
- Language: C++
- Homepage:
- Size: 3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Feedforward Neural Network Classifier in C++
This project implements a feedforward neural network classifier from scratch in C++20, without relying on external libraries (other than the standard libray). It provides functionalities for data handling, training, prediction, and evaluation.
This project aims to demonstrate the core principles of neural networks and serves as an educational tool. It is not designed for production deployment.
Usage Example:
```cpp
#include
#include
#include
#include "dataset.hpp"
#include "neural_network.hpp"
#include "evaluator.hpp"
int main() {
const std::string filename = "datasets/titanic_dataset.csv";
NeuralNetwork nn(6, 20, 2, 0.001);
Dataset dataset(filename, true);
dataset.splitDataset(0.7);
// Train the neural network
if (!nn.train(1000, dataset)) return 1;
// Evaluate the neural network
double accuracy = Evaluator::evaluate(nn, dataset.data_test, dataset.labels_test);
std::cout << "Accuracy on test set: " << accuracy * 100 << "%" << std::endl;
// Predict a new data point
std::vector dataPoint = {3, 1, 61, 0, 0, 30};
int predictedLabel = nn.predict(dataPoint);
std::cout << "Predicted label: " << predictedLabel << std::endl;
return 0;
}
```
Classification Performance on [Titanic Dataset](https://www.kaggle.com/datasets/vinicius150987/titanic3) on Test Set Split (30%): `68.2836%`