{"id":31556230,"url":"https://github.com/subhayudutta/valuemymobile","last_synced_at":"2026-05-16T08:02:27.701Z","repository":{"id":250583492,"uuid":"821819246","full_name":"subhayudutta/ValueMyMobile","owner":"subhayudutta","description":"ValueMyMobile is an application for predicting the price of mobile phones based on various features using machine learning model.","archived":false,"fork":false,"pushed_at":"2024-07-16T15:01:22.000Z","size":93,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T01:02:39.379Z","etag":null,"topics":["cloud","flask","mlops","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subhayudutta.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}},"created_at":"2024-06-29T14:22:29.000Z","updated_at":"2024-07-28T14:30:23.000Z","dependencies_parsed_at":"2024-07-28T17:01:39.382Z","dependency_job_id":null,"html_url":"https://github.com/subhayudutta/ValueMyMobile","commit_stats":null,"previous_names":["subhayudutta/valuemymobile"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/subhayudutta/ValueMyMobile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subhayudutta%2FValueMyMobile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subhayudutta%2FValueMyMobile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subhayudutta%2FValueMyMobile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subhayudutta%2FValueMyMobile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subhayudutta","download_url":"https://codeload.github.com/subhayudutta/ValueMyMobile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subhayudutta%2FValueMyMobile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278386110,"owners_count":25978109,"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-10-04T02:00:05.491Z","response_time":63,"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":["cloud","flask","mlops","python"],"created_at":"2025-10-04T22:50:43.056Z","updated_at":"2025-10-04T22:50:44.228Z","avatar_url":"https://github.com/subhayudutta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ValueMyMobile App\n\nValueMyMobile is an application for predicting the price of mobile phones based on various features using machine learning models.\n\nThe main objective of this project is to develop a robust pipeline for mobile price detection that incorporates various MLOps practices such as version control, continuous integration/continuous deployment (CI/CD), and model deployment.\n\nIn this README, we will walk you through the folder structure, pipeline stages, the model used, how to run the code, CI/CD deployment using AWS EC2 and GitHub Actions, evaluation metrics, dependencies, conclusion, future work, and acknowledgements.\n\n![Screenshot](templates/screenshot.png) \n\n## Features\n\n- Predict mobile phone prices based on features like weight, resolution, CPU cores, etc.\n- User-friendly web interface for inputting mobile specifications.\n- Provides predicted prices with detailed explanations.\n\n## Folder Structure\n\n- **src/reviewAnalysis**: This directory contains the main source code for the project.\n  - **components**: This subdirectory holds reusable components used in the pipeline, such as data ingestion, validation, transformation, model trainer, and model evaluation.\n  - **utils**: Here, utility functions and helpers are stored, facilitating various tasks throughout the project.\n  - **logging**: Contains configurations and setup for logging functionalities.\n  - **config**: Holds project configuration files, including the main configuration file `configuration.py`.\n  - **pipeline**: This directory houses the pipeline definition and stages, including data ingestion, validation, transformation, model trainer, and model evaluation.\n  - **entity**: Contains entity classes used in the project, such as `config_entity.py`.\n  - **constants**: Holds constant values used across the project.\n\n- **config**: This directory contains project-wide configuration files, including `config.yaml` for general configurations and `params.yaml` for parameter configurations.\n\n- **app.py** and **main.py**: These files serve as entry points for running the application and executing the main functionality.\n\n- **Dockerfile**: This file specifies the instructions to build a Docker image for the project, ensuring consistency and portability of the environment.\n\n- **requirements.txt**: Lists all the Python dependencies required to run the project. Useful for setting up the environment.\n\n- **setup.py**: This file defines metadata about the project and its dependencies. Useful for packaging and distribution.\n\n- **research/trials.ipynb**: This directory contains Jupyter Notebook files used for research, experiments, and trials during the development phase.\n\n## Pipeline Stages\n\n### Data Ingestion\nData is acquired from Kaggle ([Link](https://www.kaggle.com/datasets/mohannapd/mobile-price-prediction)) and stored on Google Drive for easy access. To retrieve the data, we use the `gdown` library to download it from Google Drive and store it in the local environment. Subsequently, the downloaded data is saved in the artifacts folder within the data ingestion directory. We then use the `zipfile` module to unzip the downloaded file, ensuring that the data is readily available for further processing.\n\n### Data Validation\nIn this stage, we perform thorough validation checks on the acquired data to ensure its integrity and quality. All necessary files are examined for completeness, consistency, and adherence to predefined standards. The validation process involves verifying file formats, data types, and structural integrity. The results of the validation checks are recorded in a `status.txt` file within the artifacts folder of the data validation directory. This allows for easy tracking and monitoring of the data validation process.\n\n### Data Transformation\n\nData transformation is a crucial stage where raw text data undergoes preprocessing to make it suitable for model training.\n\n### Model Trainer\nThe model trainer pipeline applies Elastic Net linear regression, balancing between Lasso and Ridge regularization to enhance predictive accuracy while mitigating multicollinearity, ensuring robust model performance across this dataset.\n\n### Model Evaluation\nModel evaluation is performed to assess the performance of the trained model on unseen data.\n\n## How to Run the Code\n\nTo run the code, follow these steps:\n\n### Clone the repository:\n```bash\ngit clone https://github.com/subhayudutta/ValueMyMobile.git\n```\n\n### Setting up the Environment\n\nActivate the Conda environment named `pricePred` using the following command:\n   ```bash\n   conda activate pricePred\n   pip install -r requirements.txt\n   ```\n\n### Running the Pipeline\nTo execute all pipeline stages, you have two options:\n\n1. Run main.py using Python:\n    ```bash\n    python main.py\n    ```\nThis command will execute all pipeline stages sequentially.\n\n### Running the Flask App\nTo run the Flask web application, execute the following command:\n```bash\npython app.py\n```\nThis command will start the Flask server with the specified host (0.0.0.0) and port (8080). This allows the Flask app to be accessible from any network interface on the specified port.\n\n### Predicting Price\nOnce the Flask app is running, you can access the following endpoints:\n```\n/predict: Use this endpoint to predict price for a given inputs. You can either use cURL commands or visit the endpoint through your web browser.\n```\n\n### Training the Model\nTo train the model, use the following endpoint:\n```\n/train: Use this endpoint to trigger model training. You can either use cURL commands or visit the endpoint through your web browser.\n```\n## CI/CD Deployment using AWS EC2 and GitHub Actions\n\nTo deploy your application using AWS EC2 and GitHub Actions, follow these steps:\n\n### Setting up AWS\n\n1. Log in to the AWS console.\n\n2. Create an IAM user for deployment with specific access:\n   - Grant EC2 access for launching virtual machines.\n   - Grant access to ECR (Elastic Container Registry) to save your Docker images in AWS.\n\n### Description of Deployment\n\n1. Build the Docker image of your source code.\n\n2. Push your Docker image to ECR.\n\n3. Launch your EC2 instance.\n\n4. Pull your Docker image from ECR into the EC2 instance.\n\n5. Launch your Docker image in the EC2 instance.\n\n### Required IAM Policies\n\nEnsure the IAM user has the following policies attached:\n   - AmazonEC2ContainerRegistryFullAccess\n   - AmazonEC2FullAccess\n\n### Setup Steps\n\n1. Create an ECR repository to store/save the Docker image. \n\n2. Create an EC2 instance (Ubuntu).\n\n3. Install Docker in the EC2 instance (optional):\n   ```bash\n   sudo apt-get update -y\n   sudo apt-get upgrade\n   curl -fsSL https://get.docker.com -o get-docker.sh\n   sudo sh get-docker.sh\n   sudo usermod -aG docker ubuntu\n   newgrp docker\n    ```\n\n### Configuring EC2 as a Self-hosted Runner\n\n1. Navigate to your GitHub repository.\n2. Go to **Settings** \u003e **Actions** \u003e **Runners**.\n3. Click on **New self-hosted runner**.\n4. Choose the operating system for your EC2 instance.\n5. Follow the instructions provided to download and configure the runner on your EC2 instance.\n\n### Setting up GitHub Secrets\n\nTo securely store sensitive information required for deployment, such as AWS credentials and repository URIs, you can use GitHub Secrets. Follow these steps to set up the necessary secrets:\n\n1. Navigate to your GitHub repository.\n2. Go to **Settings** \u003e **Secrets** \u003e **Actions**.\n3. Click on **New repository secret**.\n4. Add the following secrets:\n   - `AWS_ACCESS_KEY_ID`: Your AWS access key ID.\n   - `AWS_SECRET_ACCESS_KEY`: Your AWS secret access key.\n   - `AWS_REGION`: The AWS region where your resources are located (e.g., `ap-south-1`).\n   - `AWS_ECR_LOGIN_URI`: The URI for logging into your ECR (e.g., `11111.dkr.ecr.ap-south-1.amazonaws.com`).\n   - `ECR_REPOSITORY_NAME`: The name of your ECR repository (e.g., `review-analysis`).\n\nThese steps enable automated deployment of your application to AWS EC2 using GitHub Actions.\n\n## License and Acknowledgements\n\nThis project is licensed under the [GNU License](LICENSE.md). Feel free to use, modify, and distribute the code for your own purposes.\n\nI would like to acknowledge the contributions of the open-source community, without which this project would not have been possible. Special thanks to the creators and maintainers of libraries, frameworks, and tools that have been instrumental in the development and deployment of this project.\n\n## Contact Me\n\nFor any inquiries, feedback, or collaboration opportunities, please feel free to reach out to me via email at duttasuvo90@gmail.com.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubhayudutta%2Fvaluemymobile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubhayudutta%2Fvaluemymobile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubhayudutta%2Fvaluemymobile/lists"}