A comprehensive End-to-End Machine Learning Pipeline for the classic Kaggle Titanic challenge.
This project provides a robust, reproducible machine learning pipeline to predict passenger survival on the Titanic. It goes beyond a simple script by incorporating software engineering best practices, rigorous experiment tracking with MLflow, and intelligent feature engineering.
- Advanced Feature Engineering: Extracted passenger titles, calculated family sizes, and engineered new features like
FarePerPerson. - Experiment Tracking: Integrated with MLflow to track hyperparameters, metrics (accuracy), and artifacts seamlessly.
- Hyperparameter Tuning: Explores multiple combinations of
max_depthandn_estimatorsfor a Random Forest model. - Automated Visualizations: Automatically generates and logs feature importance plots to MLflow.
- Scalable Structure: Organized cleanly into logical folders (
src/,notebooks/,models/,data/) for scale.
├── data/ # Raw and processed datasets (ignored by git)
├── models/ # Saved model `.pkl` files (ignored by git)
├── notebooks/ # Jupyter notebooks for exploratory data analysis
├── src/ # Source code for utility functions (if any)
├── train.py # Main training pipeline and MLflow integration
├── feature_importance.png # Generated chart of feature importance
├── requirements.txt # Detailed project dependencies
└── .gitignore # Files/folders to ignore in tracking
You need Python 3.8+ installed on your machine.
-
Clone the repository:
git clone https://github.com/your-username/titanic-survival-prediction.git cd titanic-survival-prediction -
Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
To run the pipeline, engineer features, and train the Random Forest models across the defined search space, simply run:
python train.pyThis will output accuracy scores for different hyperparameter runs and save the best models to the models/ directory.
This project uses a local SQLite backend for MLflow tracking. To view your runs, metrics, and logged feature importance charts, start the MLflow UI:
mlflow ui --backend-store-uri sqlite:///mlflow.dbThen open your browser and navigate to: http://127.0.0.1:5000
Our best Random Forest model achieved an impressive Accuracy of 0.843 on the validation set.
Below is the Feature Importance plot generated during the training process, highlighting which features contributed most to the model's predictions:
- Pandas - Data manipulation and analysis
- Scikit-Learn - Machine learning modeling
- MLflow - Experiment tracking and model management
- Matplotlib - Data visualization
Contributions, issues, and feature requests are welcome! Feel free to check issues page.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.


