How rizwan1602/machine-learning-with-ci-cd works
Main Components
• Data Input & Artifacts: Represent the raw data sources and artifacts. This includes CSV files (train.csv, test.csv, stud.csv in notebook/data and artifacts) and pre-generated artifacts such as model.pkl and preprocessor.pkl stored in the artifacts folder.
• Data Ingestion: Encapsulated in the src/components/data_ingestion.py module where raw data is loaded.
• Data Transformation: Represented by src/components/data_transformation.py, which preprocesses the incoming data.
• Model Training: Indicated by src/components/model_trainer.py and the pipelines in src/pipeline/train_pipeline.py. Also include the CatBoost logs and supplementary information (e.g., catboost_info directories).
• Prediction Pipeline: Captured by src/pipeline/predict_pipeline.py, which uses the trained model and preprocessor to produce predictions.
• Web Interface/Service: The existence of app.py, application.py, and HTML templates (in the templates folder) suggests a web component that likely serves as an interface for user interaction with the model (for example, collecting input and displaying predictions). This can be shown as a “Frontend” or “API/Web Service” component.
• Notebooks & Experimental Environment: The notebook directory containing Jupyter notebooks for Exploratory Data Analysis (EDA) and training indicates an experimental process separate from the main production code.
• Deployment & Configuration: Include elements like the Dockerfile, .ebextensions (for AWS Elastic Beanstalk), and GitHub workflows, which manage CI/CD and deployment.
Relationships and Interactions
• Data flows from raw CSV files (or other sources) are ingested by the Data Ingestion module.
• Ingested data is passed to the Data Transformation component for cleaning and preprocessing.
• The output from transformation is used by the Model Trainer to train the ML model using CatBoost (as evidenced by files in the catboost_info directory) and then stored as model artifacts.
• The Prediction Pipeline consumes incoming new data, applies the same preprocessing steps (using the preprocessor artifact), and utilizes the trained model for predictions.
• The Web Service (app.py/application.py) interfaces with the Prediction Pipeline to provide a user-friendly front-end or API endpoint.
• Notebooks can be depicted as a support layer that was used during development and experimentation; though not part of the production system, they provide context on EDA and model training processes.
• Deployment configurations (Dockerfile, .ebextensions, GitHub workflows) tie into how the entire system is containerized and deployed, ensuring a consistent production environment.
Highlighting Architectural Patterns & Design Principles
• Layered Architecture: You have separate layers for data ingestion, transformation, model training, and prediction, which follows a pipeline-based (or ‘separation of concerns’) approach.
• Modular Design: Each module (data_ingestion, data_transformation, model_trainer, predict_pipeline, train_pipeline) is self-contained, lending itself to independent testing and reuse.
• Deployment Agility: Inclusion of Docker and AWS EB configurations signals containerized deployments and possibly a microservice approach for the web service layer.
• Error Handling & Logging: The presence of src/exception.py and src/logger.py indicates the design incorporates dedicated error logging and management practices.