https://github.com/zeuscoderbe/artificial-neural-network-model-to-classify-iris-flowers
Building an artificial neural network to classify Iris flowers
https://github.com/zeuscoderbe/artificial-neural-network-model-to-classify-iris-flowers
artificial-neural-networks machine-learning
Last synced: about 2 months ago
JSON representation
Building an artificial neural network to classify Iris flowers
- Host: GitHub
- URL: https://github.com/zeuscoderbe/artificial-neural-network-model-to-classify-iris-flowers
- Owner: ZeusCoderBE
- Created: 2024-03-09T03:36:48.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-14T11:03:55.000Z (about 1 year ago)
- Last Synced: 2025-02-05T08:51:28.674Z (4 months ago)
- Topics: artificial-neural-networks, machine-learning
- Language: Jupyter Notebook
- Homepage:
- Size: 553 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Iris Species Classification Project
## Overview
This project aims to develop a machine learning model to classify iris flowers into different species based on their sepal and petal characteristics. The dataset used for this project is the famous Iris dataset.## Dataset
The dataset (`iris.data`) is loaded using Pandas, containing information about sepal length, sepal width, petal length, petal width, and the species of the iris flowers.### Exploratory Data Analysis (EDA)
- Displaying basic information about the dataset using `df_iris.info()` and `df_iris.describe()`.
- Visualizing the distribution of features and their relationship with the target variable using Seaborn and Matplotlib.## Data Preprocessing
- Splitting the dataset into training and testing sets using `train_test_split`.
- Encoding the target variable using Label Encoder and converting it to one-hot encoding.## Model Architecture
A neural network model is implemented using TensorFlow and Keras with the following layers:
1. Input layer with 128 neurons and ReLU activation.
2. Hidden layer with 64 neurons and ReLU activation.
3. Hidden layer with 32 neurons and ReLU activation.
4. Output layer with 3 neurons and softmax activation.## Model Training
The model is compiled using the Adam optimizer, categorical crossentropy loss, and accuracy as a metric. It is then trained on the training data for 100 epochs with a batch size of 105.```python
model.compile(optimizer=Adam(learning_rate=0.001), loss='categorical_crossentropy', metrics=['accuracy'])
model.fit(train_X, train_y_one_hot, epochs=100, batch_size=105)