This Python script implements a machine learning model to predict survival on the Titanic using the Titanic dataset. It employs Random Forest classifiers to generate predictions.
Find the Dataset here: https://www.kaggle.com/competitions/titanic
- Random Forest model for prediction
- Processes the Titanic dataset
- Outputs predictions to a CSV file
- Python 3.6+
- pandas
- scikit-learn
- numpy
Install the required packages with:
pip install pandas scikit-learn numpy
Place train.csv and test.csv in the same directory as the script.
Run the script with:
python3 main.py
Predictions will be saved to prediction.csv.
The generated prediction.csv includes:
PassengerId: ID of the passenger
Survived: Predicted survival (0 = not survived, 1 = survived)