{"id":50297067,"url":"https://github.com/poti1/cereal-ml","last_synced_at":"2026-05-28T09:34:15.597Z","repository":{"id":356303238,"uuid":"1231915812","full_name":"poti1/cereal-ml","owner":"poti1","description":"Cereal Calorie Predictor.  A PyTorch neural network that predicts cereal calorie content from nutritional ingredients.  Built as a hands-on ML exercise covering the full pipeline: data preprocessing, model training, evaluation, and prediction.","archived":false,"fork":false,"pushed_at":"2026-05-07T12:44:09.000Z","size":479,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-07T14:33:04.698Z","etag":null,"topics":["deeplearning","deeplearning-ai","neural-network","python","python3","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","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/poti1.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-07T12:10:20.000Z","updated_at":"2026-05-07T12:44:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/poti1/cereal-ml","commit_stats":null,"previous_names":["poti1/cereal-ml"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/poti1/cereal-ml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poti1%2Fcereal-ml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poti1%2Fcereal-ml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poti1%2Fcereal-ml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poti1%2Fcereal-ml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poti1","download_url":"https://codeload.github.com/poti1/cereal-ml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poti1%2Fcereal-ml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33603474,"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-05-28T02:00:06.440Z","response_time":99,"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":["deeplearning","deeplearning-ai","neural-network","python","python3","pytorch"],"created_at":"2026-05-28T09:34:14.242Z","updated_at":"2026-05-28T09:34:15.582Z","avatar_url":"https://github.com/poti1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cereal-ml\n\nSimple PyTorch-based calorie prediction using cereal nutrition data.\n\nPredict cereal calories from nutritional features using:\n- CLI commands\n- Python API calls\n- Trained PyTorch models\n\n---\n\n## Features\n\n- Train calorie prediction model from cereal nutrition data\n- Save/load PyTorch models\n- CLI predictions\n- Python API predictions\n- Loss plotting\n- MAE evaluation\n- Simple custom feature parser\n\n---\n\n## Installation\n\nClone the repo:\n\n```bash\ngit clone https://github.com/poti1/cereal-ml.git\ncd cereal-ml\n```\n\nInstall dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\n---\n\n## Training\n\nTrain the model:\n\n```bash\n./cereal.py --train\n```\n\nExample output:\n\n![Training](demo/train.jpg)\n\nExample training metrics:\n\n```text\nEpoch 1/10  loss: 104.8351  val_loss: 111.3147\n...\nEpoch 10/10 loss: 25.8951  val_loss: 27.3140\n\nmae: 28.50\n```\n\n---\n\n## CLI Prediction\n\nRun predictions directly from the command line:\n\n```bash\n./cereal.py --data 'sugars=3, protein=5'\n```\n\nExample:\n\n![CLI Prediction](demo/query.png)\n\n---\n\n## Python API Usage\n\nUse the predictor directly in Python:\n\n```python\nimport cereal\n\ncereal.predict('fat=10, sodium=20, carbo=15')\n```\n\nExample:\n\n![Python API](demo/query2.png)\n\n---\n\n## Example Predictions\n\n| Input | Predicted Calories |\n|---|---|\n| sugars=3, protein=5 | 71 |\n| fat=10, sodium=20, carbo=15 | 268 |\n\n---\n\n## Plotting Loss\n\nGenerate a training loss plot:\n\n```bash\n./cereal.py --plot\n```\n\nThis creates:\n\n```text\nloss.png\n```\n\n![Python API](loss.png)\n\n---\n\n## Model Output\n\nThe trained model is saved as:\n\n```text\ncereal.pt\n```\n\n---\n\n## Tech Stack\n\n- Python\n- PyTorch\n- pandas\n- matplotlib\n- scikit-learn\n\n---\n\n## Goals\n\nThis project was built to practice:\n- ML training pipelines\n- Regression models\n- Feature parsing\n- Model serialization\n- CLI + Python interfaces\n- End-to-end ML workflows\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoti1%2Fcereal-ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoti1%2Fcereal-ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoti1%2Fcereal-ml/lists"}