A classical ML pipeline for the Titanic survival dataset — EDA, preprocessing, feature engineering, model selection, evaluation, and hyperparameter tuning.
Project description
titanic-pipeline
A classical machine learning pipeline built on the Titanic survival dataset. Covers the full ML workflow — EDA, preprocessing, feature engineering, model selection, evaluation, and hyperparameter tuning. Supports binary classification, multiclass classification, and regression, for both single-file and separate train/test datasets.
Install
pip install titanic-pipeline
Usage
Single dataset (binary classification)
from titanic_pipeline import print_pipeline
print_pipeline() # print full pipeline
print_pipeline('preprocessing') # print a single section
Separate train / test datasets (binary classification)
from titanic_pipeline import print_pipeline_separate_dataset
print_pipeline_separate_dataset()
print_pipeline_separate_dataset('tuning')
Separate train / test datasets (multiclass classification)
from titanic_pipeline import print_pipeline_multi_class
print_pipeline_multi_class()
print_pipeline_multi_class('tuning')
Separate train / test datasets (regression)
from titanic_pipeline import print_pipeline_regression
print_pipeline_regression()
print_pipeline_regression('tuning')
Available Sections
Pass any of these as the section argument to any function:
| Key | Stage |
|---|---|
'imports' |
All library imports |
'eda' |
Data loading and exploration |
'preprocessing' |
Imputation, feature engineering, encoding, scaling |
'model_selection' |
Train and compare 5 models |
'evaluation' |
Metrics suited to the task type |
'tuning' |
GridSearchCV on all 5 models |
'final' |
Select best model, retrain on full data, save predictions to CSV |
Function Comparison
| Function | Task | Models | Key Metrics |
|---|---|---|---|
print_pipeline |
Binary classification | LR, DT, k-NN, RF, SVM | Accuracy, F1, ROC-AUC |
print_pipeline_separate_dataset |
Binary classification | LR, DT, k-NN, RF, SVM | Accuracy, F1, ROC-AUC |
print_pipeline_multi_class |
Multiclass classification | LR, DT, k-NN, RF, SVM | Weighted F1, ROC-AUC (OvR) |
print_pipeline_regression |
Regression | Ridge, DT, k-NN, RF, SVR | MAE, RMSE, R² |
Pipeline Stages
| # | Stage | What it covers |
|---|---|---|
| 1 | EDA | Shape, dtypes, missing values, target distribution |
| 2 | Preprocessing & Feature Engineering | Imputation, family size, age bins, fare-per-person, encoding, scaling |
| 3 | Model Selection & Training | Train and compare 5 models side-by-side |
| 4 | Evaluation | Metrics suited to task type |
| 5 | Hyperparameter Tuning | GridSearchCV on all 5 models |
| Final | Best Model & Predictions | Retrain on full data, predict on test set, save predictions.csv |
Requirements
- Python >= 3.8
- numpy, pandas, matplotlib, seaborn, scikit-learn
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file titanic_pipeline-0.1.13.tar.gz.
File metadata
- Download URL: titanic_pipeline-0.1.13.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51fa2a78aa079fc92d6bdb2ab7019456017cff51a760f487d0bd85497e741941
|
|
| MD5 |
e7d4000debfa20df442e02026bf016fa
|
|
| BLAKE2b-256 |
cb87ac4b26903f938e2ea8ab5fca8eb609e25625eff9575b1befb0c0487927d9
|
Provenance
The following attestation bundles were made for titanic_pipeline-0.1.13.tar.gz:
Publisher:
publish.yml on roshanemoraes/titanic-ml-pipeline
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
titanic_pipeline-0.1.13.tar.gz -
Subject digest:
51fa2a78aa079fc92d6bdb2ab7019456017cff51a760f487d0bd85497e741941 - Sigstore transparency entry: 1187999443
- Sigstore integration time:
-
Permalink:
roshanemoraes/titanic-ml-pipeline@d43005f4a44830fcf18ab183c2071800bf852636 -
Branch / Tag:
refs/tags/v0.1.13 - Owner: https://github.com/roshanemoraes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d43005f4a44830fcf18ab183c2071800bf852636 -
Trigger Event:
release
-
Statement type:
File details
Details for the file titanic_pipeline-0.1.13-py3-none-any.whl.
File metadata
- Download URL: titanic_pipeline-0.1.13-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8682589adc72c8697d4d1d89eb7797bacb53dcb27869b3e3c181f2f99c925031
|
|
| MD5 |
8a730f567ab96785ecf000b9dcadc427
|
|
| BLAKE2b-256 |
356a0fb7004b05ba679b3de72c27e39b1b4d2cce75082ced748578873c587e2f
|
Provenance
The following attestation bundles were made for titanic_pipeline-0.1.13-py3-none-any.whl:
Publisher:
publish.yml on roshanemoraes/titanic-ml-pipeline
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
titanic_pipeline-0.1.13-py3-none-any.whl -
Subject digest:
8682589adc72c8697d4d1d89eb7797bacb53dcb27869b3e3c181f2f99c925031 - Sigstore transparency entry: 1187999452
- Sigstore integration time:
-
Permalink:
roshanemoraes/titanic-ml-pipeline@d43005f4a44830fcf18ab183c2071800bf852636 -
Branch / Tag:
refs/tags/v0.1.13 - Owner: https://github.com/roshanemoraes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d43005f4a44830fcf18ab183c2071800bf852636 -
Trigger Event:
release
-
Statement type: