Skip to content

Commit

Permalink
Merge pull request #123 from VikramsDataScience/churn-propensity-model
Browse files Browse the repository at this point in the history
Written CI workflow to execute unit tests
  • Loading branch information
VikramsDataScience authored Sep 4, 2024
2 parents 3130b1b + 4530ddd commit 24b437c
Show file tree
Hide file tree
Showing 10 changed files with 11,325 additions and 3 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/CI_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI Workflow

on:
push:
branches:
- dev

# Trigger workflow when a PR is created to push to the 'dev' branch
pull_request:
branches:
- dev

# Only trigger workflow when there are changes to the following folders
paths:
- ECommerce_Churn_Propensity_Model/**

jobs:
churn_propensity_project:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python: [3.11.5]
steps:
- name: Checkout
uses: actions/checkout@v3 # Clone the repo (Info: https://github.com/actions/checkout)

- name: Set up Python path
run: echo "PYTHONPATH=${{ github.workspace }}/ECommerce_Churn_Propensity_Model/src" >> $GITHUB_ENV

- name: Install Python
uses: actions/setup-python@v4 # Info: https://github.com/actions/setup-python
with:
python-version: ${{ matrix.python }}

- name: Install python dependencies # Based on requirements.txt
run: |
pip install -r ECommerce_Churn_Propensity_Model/requirements.txt
- name: Run unit tests # python -m unittest discover -s ECommerce_Churn_Propensity_Model/tests -p "*.py"
run: |
python -m ECommerce_Churn_Propensity_Model.tests.tests
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__pycache__/
Training_Logs/

# Flask stuff
ECommerce_Churn_Propensity_Model/src/static
ECommerce_Churn_Propensity_Model/src/templates
Binary file not shown.
5,631 changes: 5,631 additions & 0 deletions ECommerce_Churn_Propensity_Model/data/ECommerce_Dataset_IMPUTED.csv

Large diffs are not rendered by default.

5,631 changes: 5,631 additions & 0 deletions ECommerce_Churn_Propensity_Model/data/PreProcessed_ECommerce_Dataset.csv

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions ECommerce_Churn_Propensity_Model/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Flask==2.2.2
matplotlib==3.7.2
MissForest==2.5.5
numpy==1.24.3
pandas==2.0.3
phik==0.12.4
PyYAML==6.0.2
scikit_learn==1.3.0
scipy==1.11.3
xgboost==2.1.1
ydata_profiling==4.8.3
Binary file not shown.
4 changes: 2 additions & 2 deletions ECommerce_Churn_Propensity_Model/src/config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Config:
def __init__(self):
self.seed = 314
self.content_file = 'C:/Sample Data/Ecommerce_Churn_Data/ECommerce_Dataset.xlsx'
self.data_path = 'C:/Sample Data/Ecommerce_Churn_Data'
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'
self.data_path = 'ECommerce_Churn_Propensity_Model/data' # 'C:/Users/Vikram Pande/Side_Projects_(OUTSIDE_REPO)/ECommerce_Churn_Propensity_Model/data'
self.churn_app_models = 'C:/Sample Data/Ecommerce_Churn_Data/churn_app/models'
self.models_list = ['logistic_regression', 'RFClassifier', 'XGBoost']
self.float_cols = ['Tenure', 'WarehouseToHome', 'OrderAmountHikeFromlastYear', 'CouponUsed', 'OrderCount', 'DaySinceLastOrder']
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
from pathlib import Path
import pandas as pd
from .src.config import Config
from ..src.config import Config

config = Config()
data_path = config.data_path
Expand Down

0 comments on commit 24b437c

Please sign in to comment.