Skip to content

Commit 24b437c

Browse files
Merge pull request #123 from VikramsDataScience/churn-propensity-model
Written CI workflow to execute unit tests
2 parents 3130b1b + 4530ddd commit 24b437c

File tree

10 files changed

+11325
-3
lines changed

10 files changed

+11325
-3
lines changed

.github/workflows/CI_workflow.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
8+
# Trigger workflow when a PR is created to push to the 'dev' branch
9+
pull_request:
10+
branches:
11+
- dev
12+
13+
# Only trigger workflow when there are changes to the following folders
14+
paths:
15+
- ECommerce_Churn_Propensity_Model/**
16+
17+
jobs:
18+
churn_propensity_project:
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
os: [windows-latest]
23+
python: [3.11.5]
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v3 # Clone the repo (Info: https://github.com/actions/checkout)
27+
28+
- name: Set up Python path
29+
run: echo "PYTHONPATH=${{ github.workspace }}/ECommerce_Churn_Propensity_Model/src" >> $GITHUB_ENV
30+
31+
- name: Install Python
32+
uses: actions/setup-python@v4 # Info: https://github.com/actions/setup-python
33+
with:
34+
python-version: ${{ matrix.python }}
35+
36+
- name: Install python dependencies # Based on requirements.txt
37+
run: |
38+
pip install -r ECommerce_Churn_Propensity_Model/requirements.txt
39+
40+
- name: Run unit tests # python -m unittest discover -s ECommerce_Churn_Propensity_Model/tests -p "*.py"
41+
run: |
42+
python -m ECommerce_Churn_Propensity_Model.tests.tests
43+

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
__pycache__/
2+
Training_Logs/
3+
4+
# Flask stuff
5+
ECommerce_Churn_Propensity_Model/src/static
6+
ECommerce_Churn_Propensity_Model/src/templates
Binary file not shown.

ECommerce_Churn_Propensity_Model/data/ECommerce_Dataset_IMPUTED.csv

Lines changed: 5631 additions & 0 deletions
Large diffs are not rendered by default.

ECommerce_Churn_Propensity_Model/data/PreProcessed_ECommerce_Dataset.csv

Lines changed: 5631 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Flask==2.2.2
2+
matplotlib==3.7.2
3+
MissForest==2.5.5
4+
numpy==1.24.3
5+
pandas==2.0.3
6+
phik==0.12.4
7+
PyYAML==6.0.2
8+
scikit_learn==1.3.0
9+
scipy==1.11.3
10+
xgboost==2.1.1
11+
ydata_profiling==4.8.3
Binary file not shown.

ECommerce_Churn_Propensity_Model/src/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
class Config:
22
def __init__(self):
33
self.seed = 314
4-
self.content_file = 'C:/Sample Data/Ecommerce_Churn_Data/ECommerce_Dataset.xlsx'
5-
self.data_path = 'C:/Sample Data/Ecommerce_Churn_Data'
4+
self.content_file = 'ECommerce_Churn_Propensity_Model/data/ECommerce_Dataset.xlsx' # 'C:/Users/Vikram Pande/Side_Projects_(OUTSIDE_REPO)/ECommerce_Churn_Propensity_Model/data/ECommerce_Dataset.xlsx'
5+
self.data_path = 'ECommerce_Churn_Propensity_Model/data' # 'C:/Users/Vikram Pande/Side_Projects_(OUTSIDE_REPO)/ECommerce_Churn_Propensity_Model/data'
66
self.churn_app_models = 'C:/Sample Data/Ecommerce_Churn_Data/churn_app/models'
77
self.models_list = ['logistic_regression', 'RFClassifier', 'XGBoost']
88
self.float_cols = ['Tenure', 'WarehouseToHome', 'OrderAmountHikeFromlastYear', 'CouponUsed', 'OrderCount', 'DaySinceLastOrder']

ECommerce_Churn_Propensity_Model/tests/__init__.py

Whitespace-only changes.

ECommerce_Churn_Propensity_Model/tests.py renamed to ECommerce_Churn_Propensity_Model/tests/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22
from pathlib import Path
33
import pandas as pd
4-
from .src.config import Config
4+
from ..src.config import Config
55

66
config = Config()
77
data_path = config.data_path

0 commit comments

Comments
 (0)