{"id":29194630,"url":"https://github.com/45harry/mlops_end_to_end_customer_satisfaction_project","last_synced_at":"2025-08-08T15:56:58.469Z","repository":{"id":300683126,"uuid":"1006810908","full_name":"45Harry/MLOps_End_to_End_Customer_satisfaction_project","owner":"45Harry","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-29T07:48:19.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-02T04:05:59.150Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/45Harry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-23T03:04:05.000Z","updated_at":"2025-06-29T07:48:24.000Z","dependencies_parsed_at":"2025-06-23T04:21:18.447Z","dependency_job_id":"2b3160fd-f086-4067-9ea9-7bc835d786e9","html_url":"https://github.com/45Harry/MLOps_End_to_End_Customer_satisfaction_project","commit_stats":null,"previous_names":["45harry/mlops_end_to_end_customer_satisfaction_project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/45Harry/MLOps_End_to_End_Customer_satisfaction_project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FMLOps_End_to_End_Customer_satisfaction_project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FMLOps_End_to_End_Customer_satisfaction_project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FMLOps_End_to_End_Customer_satisfaction_project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FMLOps_End_to_End_Customer_satisfaction_project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/45Harry","download_url":"https://codeload.github.com/45Harry/MLOps_End_to_End_Customer_satisfaction_project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FMLOps_End_to_End_Customer_satisfaction_project/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269447936,"owners_count":24418756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-02T04:05:57.547Z","updated_at":"2025-08-08T15:56:58.395Z","avatar_url":"https://github.com/45Harry.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MLops: Customer Satisfaction Prediction Pipeline\n\nThis repository implements a full MLOps workflow for predicting customer satisfaction using the Olist e-commerce dataset. It demonstrates best practices in data ingestion, cleaning, model development, evaluation, deployment, experiment tracking, and web-based inference, leveraging ZenML, MLflow, and Streamlit.\n\n---\n\n## Project Description\n\nThe goal of this project is to build a robust, modular, and production-ready machine learning pipeline for predicting customer satisfaction scores. The pipeline covers the entire ML lifecycle, from data ingestion and preprocessing to model training, evaluation, deployment, and serving predictions via a web interface. The project uses ZenML for pipeline orchestration, MLflow for experiment tracking, and Streamlit for interactive model inference.\n\n---\n\n## Requirements\n\n- Python 3.8+\n- Recommended: virtual environment (venv, conda, etc.)\n- Install dependencies:\n  ```bash\n  pip install -r data/mlops-projects-course-main/customer-satisfaction-mlops-main/requirements.txt\n  ```\n\n---\n\n## How to Use\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/45Harry/MLOps_End_to_End_Customer_satisfaction_project\n   cd MLops\n   ```\n\n2. **Install dependencies:**\n   ```bash\n   pip install -r data/mlops-projects-course-main/customer-satisfaction-mlops-main/requirements.txt\n   ```\n\n3. **Run the training pipeline:**\n   ```bash\n   python run_pipeline.py\n   ```\n\n4. **Run the deployment pipeline:**\n   ```bash\n   python run_deployment.py\n   ```\n\n5. **Launch the Streamlit app:**\n   ```bash\n   streamlit run streamlit_app.py\n   ```\n\n6. **View MLflow UI:**\n   ```bash\n   mlflow ui --backend-store-uri \"file:///tmp/mlflow\"\n   ```\n\n---\n\n## Repository Structure\n\n### Root Directory\n\n- **`run_pipeline.py`**  \n  Entry point to run the training pipeline. Loads data, runs the training pipeline, and prints the MLflow tracking URI.\n\n- **`run_deployment.py`**  \n  Entry point to run the deployment pipeline. Supports deployment, prediction, or both, and manages the MLflow model server.\n\n- **`streamlit_app.py`**  \n  Streamlit web app for interactive model inference. Users can input product/order features and get satisfaction predictions.\n\n- **`__init__.py`**  \n  Marks the directory as a Python package.\n\n- **`saved_model/`**  \n  (Currently empty) Intended for storing serialized models.\n\n- **`mlruns/`**  \n  MLflow experiment tracking and model registry. Contains experiment metadata and run artifacts.\n\n- **`pipelines/`**  \n  Contains pipeline definitions and utilities:\n  - `training_pipeline.py`: Defines the training pipeline (ingest, clean, train, evaluate).\n  - `deployment_pipeline.py`: Defines the deployment and inference pipelines, including model serving logic.\n  - `utils.py`: Utility functions for pipelines, e.g., test data preparation.\n\n- **`steps/`**  \n  Modular pipeline step scripts:\n  - `ingest_data.py`: Loads data from a CSV file.\n  - `clean_data.py`: Cleans and splits data into train/test sets.\n  - `model_train.py`: Trains a model (currently supports Linear Regression).\n  - `evaluation.py`: Evaluates the model (R2, RMSE, MSE).\n  - `config.py`: Configuration class for model selection.\n\n- **`src/`**  \n  Source code for core logic:\n  - `data_cleaning.py`: Data cleaning and preprocessing strategies.\n  - `mode_dev.py`: Model abstraction and Linear Regression implementation.\n  - `evaluation.py`: Evaluation metric classes (MSE, RMSE, R2).\n\n- **`data/`**  \n  Contains datasets and subprojects:\n  - `archive/`: Full Olist dataset as CSV files.\n  - `olist_customers_dataset.csv`: Standalone customer dataset.\n  - `mlops-projects-course-main/`: Contains the main MLOps subproject (see below).\n\n---\n\n### Key Subdirectories\n\n#### data/archive/\n\n- Contains the full Olist dataset as CSV files:\n  - `olist_customers_dataset.csv`\n  - `olist_geolocation_dataset.csv`\n  - `olist_order_items_dataset.csv`\n  - `olist_order_payments_dataset.csv`\n  - `olist_order_reviews_dataset.csv`\n  - `olist_orders_dataset.csv`\n  - `olist_products_dataset.csv`\n  - `olist_sellers_dataset.csv`\n  - `product_category_name_translation.csv`\n\n#### data/mlops-projects-course-main/customer-satisfaction-mlops-main/\n\nA self-contained MLOps project with its own pipeline, model, and app code:\n- **`_assets/`**: Project diagrams and images.\n- **`config.yaml`**: Pipeline configuration.\n- **`data/`**: Project-specific data.\n- **`materializer/`**: Custom ZenML materializer for data serialization.\n- **`model/`**: Model development and evaluation scripts.\n- **`pipelines/`**: Pipeline definitions.\n- **`saved_model/`**: Serialized models.\n- **`steps/`**: Modular pipeline steps.\n- **`tests/`**: Unit tests.\n- **`streamlit_app.py`**: Streamlit web app for model inference.\n- **`run_pipeline.py`**: Script to run the training pipeline.\n- **`run_deployment.py`**: Script to run the deployment pipeline.\n- **`requirements.txt`**: Python dependencies.\n- **`README.md`**: Subproject documentation.\n\n---\n\n## File and Folder Details\n\n### Pipelines\n\n- **`pipelines/training_pipeline.py`**  \n  Defines the training pipeline: data ingestion, cleaning, model training, and evaluation.\n\n- **`pipelines/deployment_pipeline.py`**  \n  Defines the deployment and inference pipelines, including model serving, deployment triggers, and prediction logic.\n\n- **`pipelines/utils.py`**  \n  Utility functions for pipelines, such as preparing test data.\n\n### Steps\n\n- **`steps/ingest_data.py`**  \n  Loads data from a specified CSV file path.\n\n- **`steps/clean_data.py`**  \n  Cleans the data and splits it into training and test sets using strategies from `src/data_cleaning.py`.\n\n- **`steps/model_train.py`**  \n  Trains a model (currently supports Linear Regression) and logs experiments to MLflow.\n\n- **`steps/evaluation.py`**  \n  Evaluates the trained model using R2, RMSE, and MSE metrics, and logs results to MLflow.\n\n- **`steps/config.py`**  \n  Contains the `ModelNameConfig` class for specifying the model type.\n\n### Source Code\n\n- **`src/data_cleaning.py`**  \n  Implements data cleaning and preprocessing strategies, including handling missing values and splitting data.\n\n- **`src/mode_dev.py`**  \n  Abstract model class and Linear Regression implementation.\n\n- **`src/evaluation.py`**  \n  Abstract evaluation class and implementations for MSE, RMSE, and R2 metrics.\n\n### MLflow\n\n- **`mlruns/`**  \n  MLflow experiment tracking directory. Contains experiment metadata and run artifacts.\n\n---\n\n## License\n\nThis project is licensed under the MIT License.\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F45harry%2Fmlops_end_to_end_customer_satisfaction_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F45harry%2Fmlops_end_to_end_customer_satisfaction_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F45harry%2Fmlops_end_to_end_customer_satisfaction_project/lists"}