# kunalj101/amexpert_ml_hackathon_2019_winners_soultions architecture

> Architecture diagram of the GitHub repository kunalj101/amexpert_ml_hackathon_2019_winners_soultions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions
- Repository: https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions

## Overview

This repository is a collection of AmExpert coupon-redemption prediction solutions, organized as several ranked, largely independent approaches rather than one shared application. Their common workflow is to derive customer, campaign, coupon, and transaction features, train binary classifiers, and—in some approaches—combine model predictions. The rank-2 Python modules show reusable feature and model components; other capabilities are evidenced mainly by notebook and file names. Those notebooks were not inspected, so their internal wiring is intentionally not inferred.

Main entry points: [`Rank_3_Sahil_Verma/modelling/modelling_adding_camp_cust_more_feats_group_k_camp_xgb_lgb.ipynb`](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/modelling/modelling_adding_camp_cust_more_feats_group_k_camp_xgb_lgb.ipynb) (Classifier Experiments), [`Rank_4_Pradeep_Pathak/model-lgb-xgb.ipynb`](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_4_Pradeep_Pathak/model-lgb-xgb.ipynb) (Classifier Experiments), [`Rank_5_Mudit_Tiwari/0-LGB-0 # Feat1_LGBM_Gruped_Cats_FE.ipynb`](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_5_Mudit_Tiwari/0-LGB-0%20%23%20Feat1_LGBM_Gruped_Cats_FE.ipynb) (Base Classifiers), [`Rank_2_Mohsin_Khan/amlib/generate_features_v3.py`](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/generate_features_v3.py) (Feature Generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_features["Feature Engineering"]
  node_rank1_vars["Feature Selection Config"]
  node_rank2_transaction["Transaction Preparation"]
  node_rank2_data["Train/Test Preparation"]
  node_rank2_features["Feature Generation"]
  node_rank2_transformers["Feature Transformers<br/>[transformers.py]"]
  node_rank2_artifacts[("Historical Artifacts<br/>[artifacts.py]")]
  node_rank2_artifact_prep["Artifact Preparation"]
  node_rank2_nn_data["Neural-Net Data Prep<br/>[prepare_nn_data.py]"]
  node_rank2_nmf["Coupon-Item NMF<br/>[nmf_item_coupon.py]"]
  node_rank3_feature["Customer/Coupon Features"]
  node_rank4_features["Variable Creation"]
  node_rank5_features["Feature Engineering"]
end

subgraph group_models["Model Training"]
  node_rank1_pipeline["Sourabh Pipeline<br/>[amexpert.py]"]
  node_rank2_model_data["Model Data Prep<br/>[prepare_data.py]"]
  node_rank2_definition["Model Definition"]
  node_rank2_runner["Model Runner<br/>[model_runner.py]"]
  node_rank3_model["Classifier Experiments"]
  node_rank4_models["Classifier Experiments"]
  node_rank5_models["Base Classifiers"]
end

subgraph group_ensembles["Ensembling"]
  node_rank3_ensemble["Prediction Ensembling<br/>[ensembling.ipynb]"]
  node_rank4_ensemble["Prediction Ensembling<br/>[ensembling.ipynb]"]
  node_rank5_ensemble["Stacking Models"]
  node_rank5_nn["Neural-Net Stacker"]
end

subgraph group_utilities["Model Utilities"]
  node_rank3_estimator["Cross-Validation Estimator"]
  node_rank3_encoding["Categorical Encoding<br/>[encoding.py]"]
  node_rank4_estimator["Cross-Validation Estimator"]
  node_rank4_encoding["Categorical Encoding<br/>[encoding.py]"]
  node_rank5_estimator["Cross-Validation Estimator"]
end

node_source_data[("Competition Data")]
node_submission["Submission Example"]

node_source_data -->|"provides data"| node_rank1_pipeline
node_rank1_vars -->|"filters variables"| node_rank1_pipeline
node_source_data -->|"provides data"| node_rank2_transaction
node_rank2_transaction -->|"prepares transactions"| node_rank2_data
node_rank2_features -->|"uses transforms"| node_rank2_transformers
node_rank2_features -->|"uses history"| node_rank2_artifacts
node_rank2_artifact_prep -->|"prepares artifacts"| node_rank2_artifacts
node_rank2_nn_data -.->|"prepares model data"| node_rank2_model_data
node_rank2_nmf -.->|"feature capability"| node_rank2_features
node_rank2_model_data -->|"provides data"| node_rank2_definition
node_rank2_definition -->|"defines model"| node_rank2_runner
node_source_data -->|"provides data"| node_rank3_feature
node_rank3_feature -->|"creates features"| node_rank3_model
node_rank3_model -->|"uses estimator"| node_rank3_estimator
node_rank3_model -->|"uses encoding"| node_rank3_encoding
node_rank3_model -->|"model predictions"| node_rank3_ensemble
node_source_data -->|"provides data"| node_rank4_features
node_rank4_features -->|"creates variables"| node_rank4_models
node_rank4_models -->|"uses estimator"| node_rank4_estimator
node_rank4_models -->|"uses encoding"| node_rank4_encoding
node_rank4_models -->|"model predictions"| node_rank4_ensemble
node_source_data -->|"provides data"| node_rank5_features
node_rank5_features -->|"creates features"| node_rank5_models
node_rank5_models -->|"uses fold strategy"| node_rank5_estimator
node_rank5_models -->|"base predictions"| node_rank5_ensemble
node_rank5_models -->|"base predictions"| node_rank5_nn
node_rank3_ensemble -.->|"produces predictions"| node_submission

click node_rank1_pipeline "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_1_Sourabh_Jha/Codes/amexpert.py"
click node_rank1_vars "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_1_Sourabh_Jha/Codes/remove_vars_best.json"
click node_rank2_transaction "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/prepare_transaction_data.py"
click node_rank2_data "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/prepare_train_test_data.py"
click node_rank2_features "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/generate_features_v3.py"
click node_rank2_transformers "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/mllib/transformers.py"
click node_rank2_artifacts "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/mllib/artifacts.py"
click node_rank2_model_data "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/mllib/prepare_data.py"
click node_rank2_definition "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/mllib/model_definition.py"
click node_rank2_runner "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/mllib/model_runner.py"
click node_rank2_artifact_prep "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/prepare_artifacts.py"
click node_rank2_nn_data "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/prepare_nn_data.py"
click node_rank2_nmf "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/nmf_item_coupon.py"
click node_rank3_feature "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/feature_creation_code/feats_user_coup_item.ipynb"
click node_rank3_model "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/modelling/modelling_adding_camp_cust_more_feats_group_k_camp_xgb_lgb.ipynb"
click node_rank3_ensemble "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/modelling/ensembling.ipynb"
click node_rank3_estimator "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/custom_estimator.py"
click node_rank3_encoding "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/encoding.py"
click node_rank4_features "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_4_Pradeep_Pathak/final_variable_creation.ipynb"
click node_rank4_models "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_4_Pradeep_Pathak/model-lgb-xgb.ipynb"
click node_rank4_ensemble "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_4_Pradeep_Pathak/ensembling.ipynb"
click node_rank4_estimator "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_4_Pradeep_Pathak/ml_modules/custom_estimator.py"
click node_rank4_encoding "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_4_Pradeep_Pathak/ml_modules/encoding.py"
click node_rank5_features "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_5_Mudit_Tiwari/Feature%20Engineering%205.ipynb"
click node_rank5_models "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_5_Mudit_Tiwari/0-LGB-0%20%23%20Feat1_LGBM_Gruped_Cats_FE.ipynb"
click node_rank5_ensemble "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_5_Mudit_Tiwari/1-LOG-0%20%23%20Stacker%20logit.ipynb"
click node_rank5_nn "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_5_Mudit_Tiwari/1-NN-0%20%23%20Stacker%20NN.ipynb"
click node_rank5_estimator "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_5_Mudit_Tiwari/custom_fold_generator.py"
click node_submission "https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/sample_submission_Byiv0dS.csv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_rank1_vars,node_rank2_transaction,node_rank2_data,node_rank2_features,node_rank2_transformers,node_rank2_artifacts,node_rank2_artifact_prep,node_rank2_nn_data,node_rank2_nmf,node_rank3_feature,node_rank4_features,node_rank5_features toneBlue
class node_rank1_pipeline,node_rank2_model_data,node_rank2_definition,node_rank2_runner,node_rank3_model,node_rank4_models,node_rank5_models,node_source_data toneAmber
class node_rank3_ensemble,node_rank4_ensemble,node_rank5_ensemble,node_rank5_nn toneMint
class node_rank3_estimator,node_rank3_encoding,node_rank4_estimator,node_rank4_encoding,node_rank5_estimator toneRose
class node_submission toneTeal
```

## Components

### Feature Engineering

- [Feature Selection Config](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_1_Sourabh_Jha/Codes/remove_vars_best.json): `Rank_1_Sourabh_Jha/Codes/remove_vars_best.json`
- [Transaction Preparation](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/prepare_transaction_data.py): `Rank_2_Mohsin_Khan/amlib/prepare_transaction_data.py`
- [Train/Test Preparation](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/prepare_train_test_data.py): `Rank_2_Mohsin_Khan/amlib/prepare_train_test_data.py`
- [Feature Generation](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/generate_features_v3.py): `Rank_2_Mohsin_Khan/amlib/generate_features_v3.py`
- [Feature Transformers](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/mllib/transformers.py): `Rank_2_Mohsin_Khan/mllib/transformers.py`
- [Historical Artifacts](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/mllib/artifacts.py): `Rank_2_Mohsin_Khan/mllib/artifacts.py`
- [Artifact Preparation](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/prepare_artifacts.py): `Rank_2_Mohsin_Khan/amlib/prepare_artifacts.py`
- [Neural-Net Data Prep](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/prepare_nn_data.py): `Rank_2_Mohsin_Khan/amlib/prepare_nn_data.py`
- [Coupon-Item NMF](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/amlib/nmf_item_coupon.py): `Rank_2_Mohsin_Khan/amlib/nmf_item_coupon.py`
- [Customer/Coupon Features](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/feature_creation_code/feats_user_coup_item.ipynb): `Rank_3_Sahil_Verma/feature_creation_code/feats_user_coup_item.ipynb`
- [Variable Creation](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_4_Pradeep_Pathak/final_variable_creation.ipynb): `Rank_4_Pradeep_Pathak/final_variable_creation.ipynb`
- [Feature Engineering](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_5_Mudit_Tiwari/Feature%20Engineering%205.ipynb): `Rank_5_Mudit_Tiwari/Feature Engineering 5.ipynb`

### Model Training

- [Sourabh Pipeline](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_1_Sourabh_Jha/Codes/amexpert.py): `Rank_1_Sourabh_Jha/Codes/amexpert.py`
- [Model Data Prep](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/mllib/prepare_data.py): `Rank_2_Mohsin_Khan/mllib/prepare_data.py`
- [Model Definition](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/mllib/model_definition.py): `Rank_2_Mohsin_Khan/mllib/model_definition.py`
- [Model Runner](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_2_Mohsin_Khan/mllib/model_runner.py): `Rank_2_Mohsin_Khan/mllib/model_runner.py`
- [Classifier Experiments](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/modelling/modelling_adding_camp_cust_more_feats_group_k_camp_xgb_lgb.ipynb): `Rank_3_Sahil_Verma/modelling/modelling_adding_camp_cust_more_feats_group_k_camp_xgb_lgb.ipynb`
- [Classifier Experiments](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_4_Pradeep_Pathak/model-lgb-xgb.ipynb): `Rank_4_Pradeep_Pathak/model-lgb-xgb.ipynb`
- [Base Classifiers](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_5_Mudit_Tiwari/0-LGB-0%20%23%20Feat1_LGBM_Gruped_Cats_FE.ipynb): `Rank_5_Mudit_Tiwari/0-LGB-0 # Feat1_LGBM_Gruped_Cats_FE.ipynb`

### Ensembling

- [Prediction Ensembling](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/modelling/ensembling.ipynb): `Rank_3_Sahil_Verma/modelling/ensembling.ipynb`
- [Prediction Ensembling](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_4_Pradeep_Pathak/ensembling.ipynb): `Rank_4_Pradeep_Pathak/ensembling.ipynb`
- [Stacking Models](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_5_Mudit_Tiwari/1-LOG-0%20%23%20Stacker%20logit.ipynb): `Rank_5_Mudit_Tiwari/1-LOG-0 # Stacker logit.ipynb`
- [Neural-Net Stacker](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_5_Mudit_Tiwari/1-NN-0%20%23%20Stacker%20NN.ipynb): `Rank_5_Mudit_Tiwari/1-NN-0 # Stacker NN.ipynb`

### Model Utilities

- [Cross-Validation Estimator](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/custom_estimator.py): `Rank_3_Sahil_Verma/custom_estimator.py`
- [Categorical Encoding](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/encoding.py): `Rank_3_Sahil_Verma/encoding.py`
- [Cross-Validation Estimator](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_4_Pradeep_Pathak/ml_modules/custom_estimator.py): `Rank_4_Pradeep_Pathak/ml_modules/custom_estimator.py`
- [Categorical Encoding](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_4_Pradeep_Pathak/ml_modules/encoding.py): `Rank_4_Pradeep_Pathak/ml_modules/encoding.py`
- [Cross-Validation Estimator](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_5_Mudit_Tiwari/custom_fold_generator.py): `Rank_5_Mudit_Tiwari/custom_fold_generator.py`

### Other components

- **Competition Data**
- [Submission Example](https://github.com/kunalj101/amexpert_ml_hackathon_2019_winners_soultions/blob/master/Rank_3_Sahil_Verma/sample_submission_Byiv0dS.csv): `Rank_3_Sahil_Verma/sample_submission_Byiv0dS.csv`

## Connections

- Competition Data → Sourabh Pipeline: provides data
- Feature Selection Config → Sourabh Pipeline: filters variables
- Competition Data → Transaction Preparation: provides data
- Transaction Preparation → Train/Test Preparation: prepares transactions
- Feature Generation → Feature Transformers: uses transforms
- Feature Generation → Historical Artifacts: uses history
- Artifact Preparation → Historical Artifacts: prepares artifacts
- Neural-Net Data Prep → Model Data Prep: prepares model data
- Coupon-Item NMF → Feature Generation: feature capability
- Model Data Prep → Model Definition: provides data
- Model Definition → Model Runner: defines model
- Competition Data → Customer/Coupon Features: provides data
- Customer/Coupon Features → Classifier Experiments: creates features
- Classifier Experiments → Cross-Validation Estimator: uses estimator
- Classifier Experiments → Categorical Encoding: uses encoding
- Classifier Experiments → Prediction Ensembling: model predictions
- Competition Data → Variable Creation: provides data
- Variable Creation → Classifier Experiments: creates variables
- Classifier Experiments → Cross-Validation Estimator: uses estimator
- Classifier Experiments → Categorical Encoding: uses encoding
- Classifier Experiments → Prediction Ensembling: model predictions
- Competition Data → Feature Engineering: provides data
- Feature Engineering → Base Classifiers: creates features
- Base Classifiers → Cross-Validation Estimator: uses fold strategy
- Base Classifiers → Stacking Models: base predictions
- Base Classifiers → Neural-Net Stacker: base predictions
- Prediction Ensembling → Submission Example: produces predictions
