This repository contains a feedforward neural network implemented using PyTorch for binary classification tasks. It is designed to take numerical feature inputs, pass them through a hidden layer with ReLU activation, and output a binary prediction using a sigmoid function.
Input Layer (input_size)
β
Linear Layer (input_size β hidden_size)
β
ReLU Activation
β
Linear Layer (hidden_size β output_size)
β
Sigmoid Activation
β
Output (Binary Prediction)
Ensure you have the following Python packages installed:
pip install torch numpyAfter training, the model is evaluated on both the training and test datasets using a threshold of 0.5 to round sigmoid outputs to binary predictions.
predicted = outputs.round()
correct = (predicted == y_true.view(-1, 1)).float().sum()
accuracy = correct / y_true.size(0)Accuracy on training data: 97.80%
Accuracy on test data: 94.74%
This project is open-source and available under the MIT License.