Welcome to the Machine Learning End-to-End Project with MLOps! In this project, you'll find a comprehensive guide on how to set up, run, and deploy your machine learning model.
- Update
config.yaml
- Create one stage and go update the config.yaml file.
- Repeat this step for each stage.
- These stages represent the full end-to-end project.
-
- Data Ingestion
- Data Validation
- Data Transformation
- Model Training
- Model Evaluation
-
Update
schema.yaml
- Guidelines for schema updates.
-
Update
params.yaml
- Since this project is integrated with MLOps (Dagshub), keep changing the parameters stored in the params.yaml file to track metrics in your MLOps.
-
Update Files in
src/mlproject/entity
- Create Data Ingestion.
-
- Go to
.config_entity.py
and create the data class for the same.
- Go to
- Repeat this for all the stages.
-
Update the Configuration Manager in
src/config
- Create methods for each stage.
- Before that, ensure you configure all the data classes in the Configuration class.
-
Update the
components/__init__.py
File insrc/mlproject
- Add paths for the YAML files.
-
Update the Pipeline in
src/mlproject
- Create pipelines for the respective stages in different files under the
pipeline
directory.
- Create pipelines for the respective stages in different files under the
-
Update
main.py
- Store all the pipelines in the
main.py
file, which is the main file of the project.
- Store all the pipelines in the
-
Update
app.py
- Add functions to access user input via HTML pages and route them to functions in
app.py
.
- Add functions to access user input via HTML pages and route them to functions in
Follow these steps to get started with the project:
-
Clone the Repository:
git clone https://github.com/codedestructed007/Ml_end_to_end_project
-
Create a Virtual Environment:
python -m venv <environment_name>
-
Activate the Environment:
<path_to_environment>/Scripts/activate
- Make sure you are in the root directory of your project.
-
Install Requirements:
pip install -r requirements.txt
-
Run
app.py
in Your Terminal:python app.py
-
Open in Your Browser: Open your browser and navigate to
http://localhost:<port>
.
To access MLflow UI, run:
mlflow ui
### Mlflow 📊
To access MLflow UI, run:
- mlflow ui
## Dagshub 🚀
Explore your project on Dagshub:
MLFLOW_TRACKING_URI=https://dagshub.com/codedestructed007/Ml_end_to_end_project.mlflow \
MLFLOW_TRACKING_USERNAME=codedestructed007 \
MLFLOW_TRACKING_PASSWORD=5780be4d27268796fc9f39b1b123b32d86ba1bac \
python script.py
Run this export as an environment variable:
export MLFLOW_TRACKING_URI=https://dagshub.com/codedestructed007/Ml_end_to_end_project.mlflow
export MLFLOW_TRACKING_USERNAME=codedestructed007
export MLFLOW_TRACKING_PASSWORD=5780be4d27268796fc9f39b1b123b32d86ba1bac
[Documentation](https://mlflow.org/docs/latest/tracking.html)
## AWS - CI/CD Deployment with GitHub Actions ☁️
### Deployment to AWS
1. Log in to AWS Console
2. Create IAM User for Deployment
### Steps
Steps:
Grant EC2 Access: Create a virtual machine (EC2).
Set Up ECR: Use Elastic Container Registry to save your Docker image in AWS
## About the Deployment Process
1. Build Docker Image from the Source Code.
2. Push Your Docker Image to ECR.
3. Launch an EC2 Instance.
4. Pull Your Image from ECR to EC2.
5. Run Your Docker Image in EC
#### Required Policies
1. AmazonEC2ContainerRegistryFullAccess.
2. AmazonEC2FullAccess.