An open API service indexing awesome lists of open source software.

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

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.