https://github.com/marta-barea/mlp-sonar-classifier
A simple project to train and evaluate two multilayer perceptron models on the Sonar data using TensorFlow, SciKeras, and Scikit-Learn — one without data standardization and another with standardized input data.
https://github.com/marta-barea/mlp-sonar-classifier
classification-algorithm deep-learning multilayer-perceptron python sonar-dataset
Last synced: 22 days ago
JSON representation
A simple project to train and evaluate two multilayer perceptron models on the Sonar data using TensorFlow, SciKeras, and Scikit-Learn — one without data standardization and another with standardized input data.
- Host: GitHub
- URL: https://github.com/marta-barea/mlp-sonar-classifier
- Owner: Marta-Barea
- License: gpl-3.0
- Created: 2025-06-09T13:18:13.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-06-09T13:23:12.000Z (4 months ago)
- Last Synced: 2025-06-09T14:29:11.684Z (4 months ago)
- Topics: classification-algorithm, deep-learning, multilayer-perceptron, python, sonar-dataset
- Language: Python
- Homepage:
- Size: 135 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MLP Sonar Classifier
A simple project to train and evaluate two multilayer perceptron models on the Sonar data using TensorFlow, SciKeras, and Scikit-Learn — one without data standardization and another with standardized input data.
---
# Installation
1. Clone the repo
```bash
git clone https://github.com/yourusername/mlp-iris-classifier.git
cd mlp-sonar
```2. Create a Conda enviornment
It is included an `environment.yml` for Conda users:
```bash
conda env create -f environment.yml
conda activate mlp-sonar
```# Usage
1. Verify the dataset
The [Sonar Dataset](https://archive.ics.uci.edu/dataset/151/connectionist+bench+sonar+mines+vs+rocks) from the UCI Machine Learning Repository is already included under data/sonar.csv.
2. Adjust settings
Open `config.yaml`and tweak any values you like (seed, test_size, units, etc.)
3. Run the full pipeline
```bash
python run_all.py
```This will:
- Train de MLP without data standardization and with standardized input data
- Save the two mlp models to `models` folder
- Evaluate and print train/test accuracy and sample predictions# Project Structure
```
mlp-iris-classifier/
│
├── config.yaml # Experiment settings
├── environment.yml # Conda environment spec
│
├── data/
│ └── sonar.csv # Sonar Dataset
│
├── models/ # (Auto-created) Trained model & params
│
├── src/
│ ├── config.py # Loads config.yaml
│ ├── data_loader.py # Reads & splits data
│ ├── model_builder.py # Defines the Keras MLP
│ ├── train.py # Hyperparameter search & model saving
│ └── evaluate.py # Loads model & prints metrics
│
└── run_all.py # Runs train.py then evaluate.py
```# Dependencies
- Python 3.7+
- numpy, scikt-learn, tensorflow, scikeras, joblib, PyYAMLWith Conda:
```bash
conda env create -f environment.yml
conda activate mlp-sonar
```