Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

titanic_pipeline-0.1.13.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

titanic_pipeline-0.1.13-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

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

Hashes for titanic_pipeline-0.1.13.tar.gz
Algorithm Hash digest
SHA256 51fa2a78aa079fc92d6bdb2ab7019456017cff51a760f487d0bd85497e741941
MD5 e7d4000debfa20df442e02026bf016fa
BLAKE2b-256 cb87ac4b26903f938e2ea8ab5fca8eb609e25625eff9575b1befb0c0487927d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for titanic_pipeline-0.1.13.tar.gz:

Publisher: publish.yml on roshanemoraes/titanic-ml-pipeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file titanic_pipeline-0.1.13-py3-none-any.whl.

File metadata

File hashes

Hashes for titanic_pipeline-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 8682589adc72c8697d4d1d89eb7797bacb53dcb27869b3e3c181f2f99c925031
MD5 8a730f567ab96785ecf000b9dcadc427
BLAKE2b-256 356a0fb7004b05ba679b3de72c27e39b1b4d2cce75082ced748578873c587e2f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page