This project implements a multi-layer perceptron (MLP) to perform binary classification on the Adult dataset from the UCI Machine Learning Repository. The dataset is commonly used to predict whether an individual's income exceeds $50K per year based on census data.
- Preprocessing: Data cleaning, feature selection, one-hot encoding, and standardization.
- Neural Network Architecture:
- 3 layers: Input → 64 → 32 → Output
- Activation functions: ReLU for hidden layers, sigmoid for the output layer
- Binary Cross-Entropy Loss (BCELoss) and Adam optimizer
- Training: Runs for 5000 epochs with progress tracking every 200 epochs.
- Performance Evaluation: Tracks loss and accuracy over epochs, with visualizations using Matplotlib.
- Inference: Provides a function to make predictions on test samples.
The model's improvement slows down after 2000 epochs, and I'm currently investigating why. Suggestions and insights are welcome!
Ensure you have Python and the requirements installed:
pip install -r requirements.txtClone the repository and execute the script:
python adult.pyThe script includes a function to test the model on a sample instance:
predict_example(model, t_X_test, t_y_test, index=5)The model's accuracy and loss trends are plotted during training. Example visualization:
