https://github.com/kplanisphere/gender-classification-perceptron
Artificial Inteligence Tecniques
https://github.com/kplanisphere/gender-classification-perceptron
artificial-intelligence artificial-intelligence-algorithms artificial-neural-networks classification classifier-model perceptron perceptron-learning-algorithm perceptrons sex-classifier
Last synced: 3 months ago
JSON representation
Artificial Inteligence Tecniques
- Host: GitHub
- URL: https://github.com/kplanisphere/gender-classification-perceptron
- Owner: KPlanisphere
- Created: 2025-01-20T04:12:06.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-20T04:16:57.000Z (5 months ago)
- Last Synced: 2025-01-20T05:22:54.592Z (5 months ago)
- Topics: artificial-intelligence, artificial-intelligence-algorithms, artificial-neural-networks, classification, classifier-model, perceptron, perceptron-learning-algorithm, perceptrons, sex-classifier
- Language: Python
- Homepage: https://linktr.ee/planisphere.kgz
- Size: 329 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gender Classification Perceptron
This repository contains a simple perceptron-based model that classifies a person's gender based on height, weight, testosterone levels, and estrogen levels. The model is trained using a dataset stored in `sex.txt`.
![]()
## 📌 Overview
The perceptron algorithm is used to classify individuals into two categories:
- **0 → Male**
- **1 → Female**The model takes the following features as input:
- Height (cm)
- Weight (kg)
- Testosterone levels (ng/dL)
- Estrogen levels (pg/mL)## 🚀 Requirements
To run this project, you need:
- Python 3.x
- Required libraries:
```bash
pip install matplotlib
```## 🔧 Usage
### 1️⃣ Prepare the Dataset
Ensure the file `sex.txt` is in the same directory. The dataset should follow this format:
```arduino
height,weight,sex,testosterone,estrogen;
```Example:
```170,56,1,52.27,259.17;
172,63,0,909.52,18.17;
```- **1** → Female
- **0** → Male### 2️⃣ Train the Model
Run the script:
```bash
python perceptron.py
```The program will train a perceptron with 10,000 iterations using the dataset.
### 3️⃣ Make Predictions
After training, the program prompts the user for:
- Height (cm)
- Weight (kg)
- Testosterone levels (ng/dL)
- Estrogen levels (pg/mL)Then, the perceptron predicts and outputs:
```diff
-> FEMALE
```or
```diff
-> MALE
```### 4️⃣ Error Plot
At the end of execution, the program generates a plot displaying training errors over time.
![]()