{"id":25877499,"url":"https://github.com/rauhanahmed/store-sales-forecasting","last_synced_at":"2026-06-08T11:32:24.818Z","repository":{"id":212171087,"uuid":"708194575","full_name":"RauhanAhmed/store-sales-forecasting","owner":"RauhanAhmed","description":"End-to-End Python based ML project focusing on forecasting multiple multivariate time series with production grade deployment techniques.","archived":false,"fork":false,"pushed_at":"2024-01-03T12:04:21.000Z","size":40552,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T11:33:24.729Z","etag":null,"topics":["darts","docker","dockerhub","dvc","fastapi","git","github","github-actions","machine-learning","mlops-workflow","multiple-time-series","multivariate-timeseries","python","python3","time-series","webhook"],"latest_commit_sha":null,"homepage":"https://store-sales-api.onrender.com","language":"Jupyter Notebook","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/RauhanAhmed.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":"2023-10-21T20:04:40.000Z","updated_at":"2024-08-20T09:18:01.000Z","dependencies_parsed_at":"2025-03-02T11:37:45.969Z","dependency_job_id":null,"html_url":"https://github.com/RauhanAhmed/store-sales-forecasting","commit_stats":null,"previous_names":["rauhanahmed/store-sales-forecasting"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RauhanAhmed/store-sales-forecasting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RauhanAhmed%2Fstore-sales-forecasting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RauhanAhmed%2Fstore-sales-forecasting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RauhanAhmed%2Fstore-sales-forecasting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RauhanAhmed%2Fstore-sales-forecasting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RauhanAhmed","download_url":"https://codeload.github.com/RauhanAhmed/store-sales-forecasting/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RauhanAhmed%2Fstore-sales-forecasting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34061122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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":["darts","docker","dockerhub","dvc","fastapi","git","github","github-actions","machine-learning","mlops-workflow","multiple-time-series","multivariate-timeseries","python","python3","time-series","webhook"],"created_at":"2025-03-02T11:27:20.553Z","updated_at":"2026-06-08T11:32:24.796Z","avatar_url":"https://github.com/RauhanAhmed.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Dynamic Sales Forecasting with Multiple-Multivariate Time Series\n\nThis Python, [ML-based API](https://store-sales-api.onrender.com) with an impressive Normalised Mean Squared Error of 0.039 and Normalised Mean Absolute Error of 0.10 for forecasts of this multiple, multivariate timeseries data on a 15-day window. This POC aims to empowers retailers with data-driven sales forecasting to optimize inventory management and improve profitability. \nThis comprehensive solution predicts short-term sales (up to 30 days) with outstanding accuracy and performance metrics. By integrating seamlessly with existing workflows, it enables retailers to:\n\n- Make informed inventory decisions.\n- Reduce stockouts and overstocking.\n- Improve operational efficiency.\n- Boost customer satisfaction.\n\n## Screenshots and Demo\n\n![Prediction Accuracy](https://i.ibb.co/VYv9wcv/Untitled.png)\n![FastAPI Swagger UI](https://i.ibb.co/ZM7xm7c/Mozilla-Firefox-2023-12-19-23-06-29.gif)\n\n\n## Model Performance Metrics (15-day forecast)\n| MSE\u003cbr\u003e(on normalised data) | MAE\u003cbr\u003e(on normalised data) |\n|------------------|------------------|\n| 0.03967  | 0.10960  |\n\n## The Approach\n\n- Fetching of the data from the MongoDB database using Python's PyMongo library.\n- Performing in-depth analysis of data in a Jupyter Environment.\n- Performing Feature Engineering to prepare the data for modelling.\n- Forecasting oil prices using a LightGBM Model for preparing the covariates for the actual model.\n- Fitting another LightGBM Model to forecast sales with the target values and covariates.\n- Converting the Jupyter code to modular format for building code pipelines efficiently.\n- Setting up the github repository, dockerhub repository using git and docker dekstop.\n- Running DVC and Git on the built artifacts during the training process for file versioning and tracking.\n- Creating the REST API using Python's FastAPI.\n- Creating a Dockerfile for building the docker image for containerization of the api.\n- Signing up and logging in on [Render Cloud](\"https://render.com/\") and creating a web service with the configuration of dockerized deployments.\n- Setting up Github Actions and creating a workflow with the jobs of building the docker image, pushing the image to Dockerhub, and finally use Render Cloud's webhook to trigger deployment of the api once a push is made to dockerhub.\n\n\n## Tech Stack\n\nBuilt on a robust open-source ecosystem, it leverages:\n\n- **Darts :** For efficient time series operations and forecasting.\n- **MongoDB :** For storage and retrieval of data.\n- **LightGBM :** To accurately predict covariate and target features.\n- **Scikit-learn :** For creating data pipelines.\n- **DVC, Git, and Github :** For seamless data and code versioning.\n- **Evidently AI:** To check for data drift/target drift.\n- **FastAPI :** For building a user-friendly API for model accessibility.\n- **Docker and Dockerhub :** For secure and streamlined deployment to the Render Cloud Platform.\n- **Github Actions :** For automating the CI/CD pipeline.\n- **Render Cloud :** A PaaS for deployment of web apps, api's, etc.\n\n\n## Run Locally\n\nClone the project\n\n```bash\n  git clone https://github.com/rauhanahmed/store-sales-forecasting\n```\n\nGo to the project directory\n\n```bash\n  cd store-sales-forecasting\n```\n\nInstall dependencies\n\n```bash\n  pip install -r requirements.txt\n```\n\nStart the server\n\n```bash\n  uvicorn app:app --reload\n```\n\n## Run the Train Pipeline\n\nFor running the train pipeline, follow the below steps:\n\n- Create a [MongoDB Atlas](\"https://www.mongodb.com/cloud/atlas/register\") account, or sign in if already exists.\n- Create an environment file, named *secrets.env* in the project's main directory with the keys of environment variables as *MONGODB_USERNAME* and *MONGODB_PASSWORD* and fill their respective values in [URL encoded format](\"https://www.mongodb.com/docs/atlas/troubleshoot-connection/#special-characters-in-connection-string-password\")\n- Install the project's requirements by using the command:\n```bash\npip install -r requirements.txt\n```\n- run the train_pipeline by using the command:\n```bash\n!python /src/pipelines/train_pipeline.py\n```\n\n\n\n## Deployment\n\nFor deployment of the application via dockers, follow the below steps:\n\n- Create a docker image of the application using the below command, replacing \u003cIMAGE_NAME\u003e and \u003cTAG\u003e after installing docker desktop and signing up on [DockerHub](https://dockerhub.com).\n ```bash\n docker build -t \u003cIMAGE_NAME\u003e:\u003cTAG\u003e .\n ```\n - Test the container locally\n ```bash\n docker run -p 8000:8000 \u003cIMAGE_NAME\u003e:\u003cTAG\u003e\n ```\n - Push to DockerHub replacing \u003cDOCKERHUB_USERNAME\u003e, \u003cIMAGE_NAME\u003e and the \u003cTAG\u003e with the dockerhub username, image name and the image tag respectively \n ```bash\n docker push \u003cDOCKERHUB_USERNAME\u003e/\u003cIMAGE_NAME\u003e:\u003cTAG\u003e\n ```\n - Sign up on [Render Cloud](https://render.com)\n - Create a Web Service on Render and choose to deploy via dockers\n - Specify the url of the dockerhub repository and start build\n- Use the URL provided by render after successful deployment of application after few minutes :)\n## Connect with me\n\n[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://www.linkedin.com/)\n\n[![portfolio](https://img.shields.io/badge/GitHub-100000?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/rauhanahmed/)\n\n[![Instagram](https://img.shields.io/badge/Instagram-E4405F?style=for-the-badge\u0026logo=instagram\u0026logoColor=white)](https://instagram.com/ahmed.rauhan)\n\n\n## Support\n\nFor support, email rauhaan.siddiqui@gmail.com. I would be happy to help!\n\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frauhanahmed%2Fstore-sales-forecasting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frauhanahmed%2Fstore-sales-forecasting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frauhanahmed%2Fstore-sales-forecasting/lists"}