How javithnaseem-j/tele-com-customer-churn-prediction works
Main Components
• Data Pipeline Stages:
• Data Ingestion: Components for reading in the Tele_Comm.csv dataset (artifacts/data_ingestion, src/mlproject/components/data_ingestion.py, pipeline stage1).
• Data Validation: Validates the dataset using schema.yaml (artifacts/data_validation, src/mlproject/components/data_validation.py, pipeline stage2).
• Data Transformation: Handles preprocessing such as scaling for numerical data and label encoding for categorical features (artifacts/data_transformation, src/mlproject/components/data_transformation.py, pipeline stage3).
• Model Training: Uses a RandomForestClassifier for training (artifacts/model_trainer, src/mlproject/components/data_modeltraining.py, pipeline stage4).
• Model Evaluation: Assesses prediction metrics (artifacts/model_evaluation, src/mlproject/components/data_modelevaluation.py, pipeline stage5).
• Configuration and Control:
• Config Files: config/config.yaml, params.yaml, and the configuration module in src/mlproject/config indicate central configuration management.
• Constants and Entities: Represent key domain objects and static values which are used throughout the ML components.
• Web Interface:
• Flask App: The app.py file along with templates (index.html, results.html) represents the frontend that enables users to submit customer details and view prediction results.
• Automation & Deployment:
• Docker: Dockerfile allows containerization to support deployment.
• CI/CD: GitHub Actions configuration (.github/workflows/cicd.yaml) orchestrates automated builds/deployments, and the README gives steps to deploy to AWS using ECR and an EC2 instance.
• Research & Experimentation:
• Notebooks: The research folder houses Jupyter notebooks that likely served as the basis for experimentation and prototyping during development.
Relationships and Data Flow
• Data flows from the raw CSV (Tele_Comm.csv under artifacts/data_ingestion) through:
• Ingestion → Validation → Transformation → Training → Evaluation.
• The trained model (model.joblib stored in artifacts/model_trainer) is then used by the Flask application to make predictions.
• Configuration files (config.yaml, params.yaml, schema.yaml) are referenced across the pipeline to maintain consistency.
• The CI/CD components (GitHub Actions workflow, Dockerfile) ensure that updates to any part of the system trigger rebuilds, tests, and deployments.
Architectural Patterns & Design Principles
• Modular Pipeline: The ML pipeline is broken into stages (each with its own module and artifact output), simplifying debugging and maintenance.
• Separation of Concerns: Frontend (Flask UI), backend (ML pipeline), and configuration (~config files) are logically separated.
• Containerization & CI/CD: Using Docker and GitHub Actions reflects a modern approach to deployment and continuous integration.
• Code Reuse: The “src/mlproject” directory encapsulates components, configuration, constants, entities, and utility functions needed by different stages.
Specify Relevant Technologies & Frameworks
• Flask: For building the web interface.
• Scikit-learn (implied from RandomForestClassifier): For ML model training.
• Docker: For containerizing the application.
• GitHub Actions: For CI/CD automation.
• AWS (ECR, EC2): For deployment.
• YAML: Used in configuration files (e.g., config.yaml, schema.yaml).
• Jupyter Notebooks: For research and exploratory analyses.