{"id":28583729,"url":"https://github.com/suredream/ag-seed-prod","last_synced_at":"2025-06-11T05:38:57.628Z","repository":{"id":298181860,"uuid":"997192589","full_name":"suredream/ag-seed-prod","owner":"suredream","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-09T20:54:07.000Z","size":429,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-09T21:18:46.422Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suredream.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06T05:39:20.000Z","updated_at":"2025-06-09T20:54:14.000Z","dependencies_parsed_at":"2025-06-09T21:18:48.315Z","dependency_job_id":"9eb090cb-da6c-46e5-8dbe-847c8ad5941e","html_url":"https://github.com/suredream/ag-seed-prod","commit_stats":null,"previous_names":["suredream/ag-seed-prod"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suredream%2Fag-seed-prod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suredream%2Fag-seed-prod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suredream%2Fag-seed-prod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suredream%2Fag-seed-prod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suredream","download_url":"https://codeload.github.com/suredream/ag-seed-prod/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suredream%2Fag-seed-prod/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259210016,"owners_count":22822287,"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","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-06-11T05:38:55.698Z","updated_at":"2025-06-11T05:38:57.607Z","avatar_url":"https://github.com/suredream.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"- Author: Jun Xiong \u003cjunxiong360@gmail.com\u003e  \n- Date: 2023-06-09\n\n# ag-seed-prod\n\n## Overview\n\nThis project is for Corteva Agriscience Case Study, which aims to predict predicting product units using machine learning models and showcase the intergration of genAI. It includes modules for data processing, model training, and a dashboard for visualization and interaction. The project proposal a XGBoost tree approach + residual correction layer as a PoC.\n\nThe codebase is built for PoC purpose only. It is not intended for production use. Check the `Todo` section for more details.\n\n## File Structure\n\nThe project is organized as follows:\n\n-   [`README.md`](README.md): This file, providing an overview of the project.\n-   `config/`: Contains configuration files (TOML format) for different models and pipelines.\n    -   [`residual.toml`](config/residual.toml): Configuration for the residual model.\n    -   [`xgb.toml`](config/xgb.toml): Configuration for the XGBoost model.\n-   `src/`: Contains the source code for the project.\n    -   [`__init__.py`](src/__init__.py): Initializes the `src` directory as a Python package.\n    -   `utils.py`: Includes utility functions for model loading, evaluation, and confidence interval calculation.\n    -   `dashboard/`: Contains code for the Streamlit dashboard.\n        -   [`app.py`](src/dashboard/app.py): Main application file for the dashboard.\n    -   `pipelines/`: Contains code for the data processing and model training pipelines.\n        -   [`xgb.py`](src/pipelines/xgb.py): XGBoost pipeline.\n        -   [`residue.py`](src/pipelines/residue.py): Residual pipeline.\n\n## Model Performance\n```\nxgboost[after grid search]\nMetric     Train           Test           \nMSE        16.2983         37.7282        \nMAE        2.2088          3.4257         \nR2         0.8131          0.6748  \n\nresidual[dummy model]\nMetric     Train           Test           \nMSE        16.8397         35.8759\nMAE        2.3359          3.3777\nR2         0.8069          0.6908\n```\n\n## Installation\n\nenable you have `uv` with `python 3.10` in your environment.\n\n    ```bash\n    uv init\n    uv sync\n    ```\n\n## Usage\n\n1.  Run the model training pipeline:\n    ```bash\n    uv run model_update.py --model residual\n    ```\n\n2.  Run the main.py to start the api server:\n\n    ```bash\n    PYTHONPATH=src uv run uvicorn main:app --reload --port 8000\n    ```\n\n3.  Run the Streamlit dashboard:\n\n    ```bash\n    uv run streamlit run src/dashboard/app.py\n    ```\n    \n\n4.  Access the FastAPI documentation: [http://localhost:8000/docs](http://localhost:8000/docs)\n5.  Access the Streamlit Dashboard: [http://localhost:8501](http://localhost:8501)\n\n## Running Unit Tests\n\nTo run the unit tests, use the following command:\n\n```bash\nuv run pytest\n\n\n## TODO\n\n-   Apply Log (Units+1) conversation to make the prediction more robust\n-   Scenarios analysis\n-   Fix the predict API\n-   Clean up the code; docstrings\n-   Add more detailed documentation\n-   Unit test\n-   Dockerization for deployment","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuredream%2Fag-seed-prod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuredream%2Fag-seed-prod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuredream%2Fag-seed-prod/lists"}