Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feed-forward neural networks (Deep Learning Algorithm) #841

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions Feed-Forward Neural Networks (Deep Learning Algorithm)/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Feedforward Neural Network on Titanic Dataset

This project involves building and training a Feedforward Neural Network to predict the survival of passengers on the Titanic using the Titanic dataset. The aim is to apply a deep learning algorithm to perform binary classification.

## Table of Contents

- [Introduction](#introduction)
- [Installation](#installation)
- [Usage](#usage)
- [Dataset](#dataset)
- [Model](#model)
- [Training and Evaluation](#training-and-evaluation)
- [Results](#results)
- [Contributing](#contributing)
- [License](#license)
- [Acknowledgements](#acknowledgements)

## Introduction

This project applies a Feedforward Neural Network to classify passengers on the Titanic as survived or not survived based on various features such as age, sex, class, and more. The goal is to explore the effectiveness of deep learning on this classic dataset.

## Installation

1. Clone the repository:
```bash
git clone https://github.com/yourusername/titanic-feedforward.git
cd titanic-feedforward
```

2. Create a virtual environment and activate it:
```bash
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```

3. Install the required dependencies:
```bash
pip install -r requirements.txt
```

## Usage

### Preprocessing the Data

Ensure you have the Titanic dataset CSV files (`train.csv`, `test.csv`). Preprocess the data before training the model.

### Training the Model

Use the following script to train the model:
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from keras.models import Sequential
from keras.layers import Dense
import matplotlib.pyplot as plt
# Load the dataset
# Preprocess the data (handle missing values, encode categorical variables, etc.)
# Convert categorical columns to numerical
# Split the data into features and labels
# Split the data into training and testing sets
# Scale the data
# Create the model
# Train the model and capture the history
# Plot the accuracy

Loading