{"id":51531088,"url":"https://github.com/zients/tw-lottery-recommendation","last_synced_at":"2026-07-09T02:30:50.680Z","repository":{"id":349804466,"uuid":"1203989736","full_name":"zients/tw-lottery-recommendation","owner":"zients","description":"Taiwan lottery draw analyzer \u0026 number recommender with Transformer ML model. Supports 539, 649, 638, 3D, and 4D lotteries.","archived":false,"fork":false,"pushed_at":"2026-06-28T16:18:37.000Z","size":252,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-28T18:11:30.403Z","etag":null,"topics":["cli","data-analysis","lottery","machine-learning","python","pytorch","taiwan","transformer"],"latest_commit_sha":null,"homepage":"https://zients.github.io/tw-lottery-recommendation/","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/zients.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-07T15:27:41.000Z","updated_at":"2026-06-13T03:30:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zients/tw-lottery-recommendation","commit_stats":null,"previous_names":["zients/lottery-539","zients/tw-lottery-recommandation","zients/tw-lottery-recommendation"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/zients/tw-lottery-recommendation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zients%2Ftw-lottery-recommendation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zients%2Ftw-lottery-recommendation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zients%2Ftw-lottery-recommendation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zients%2Ftw-lottery-recommendation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zients","download_url":"https://codeload.github.com/zients/tw-lottery-recommendation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zients%2Ftw-lottery-recommendation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35284875,"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-07-09T02:00:07.329Z","response_time":57,"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":["cli","data-analysis","lottery","machine-learning","python","pytorch","taiwan","transformer"],"created_at":"2026-07-09T02:30:49.642Z","updated_at":"2026-07-09T02:30:50.648Z","avatar_url":"https://github.com/zients.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TW Lottery Recommendation\n\n[![CI](https://github.com/zients/tw-lottery-recommendation/actions/workflows/test.yml/badge.svg)](https://github.com/zients/tw-lottery-recommendation/actions/workflows/test.yml)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Python](https://img.shields.io/badge/python-3.12+-blue.svg)](pyproject.toml)\n\nTaiwan lottery draw analyzer \u0026 number recommender with a Transformer ML model. Supports multiple lottery types.\n\nData source: [Taiwan Lottery official API](https://api.taiwanlottery.com)\n\n## ⚠️ Disclaimer\n\nThis project is for **educational, research, and entertainment purposes only**. Lottery draws are inherently random; the machine-learning model **cannot and does not predict winning numbers**, and no result is guaranteed. Please gamble responsibly and within your means.\n\nThis project is **not affiliated with, endorsed by, or connected to the Taiwan Lottery Co., Ltd.** in any way. Data is retrieved from its publicly available API. The authors accept no liability for any loss arising from use of this software.\n\n## Daily Prediction Website\n\n**https://zients.github.io/tw-lottery-recommendation/**\n\nA GitHub Pages static site updated daily at 23:00 TST via GitHub Actions. Each day the workflow:\n\n1. Fetches the latest draw results for all lottery types\n2. Retrains the Transformer model (50 epochs)\n3. Generates an HTML report with predictions for each lottery type\n4. Deploys to GitHub Pages\n\n## Supported Lotteries\n\n| `--type` | Name | Format |\n|----------|------|--------|\n| `539` | Daily 539 | Pick 5, range 1–39 |\n| `649` | Lotto 649 | Pick 6, range 1–49 |\n| `638` | Super Lotto 638 | Pick 6 (1–38) + bonus ball (1–8) |\n| `3d` | 3D Lottery | 3 digits, 0–9 |\n| `4d` | 4D Lottery | 4 digits, 0–9 |\n\n## Installation\n\n```bash\nuv sync\n```\n\n## Usage\n\n### Update draw data\n\n```bash\nuv run lottery update --type 539                          # continues from latest DB record, or fetches from the beginning\nuv run lottery update --type 649 --from-month 2024-01    # specify a start month\n```\n\n### Statistics\n\n```bash\nuv run lottery stats --type 539\n```\n\nOutput:\n- Top 10 most frequent numbers (all-time)\n- Hot / cold numbers (last 30 draws)\n- Bonus ball frequency Top 5 (638 only)\n\n### Number recommendation\n\n```bash\nuv run lottery recommend --type 638\n```\n\nGenerates 3 recommended combinations based on:\n- Historical frequency (top 20 candidates)\n- Odd/even ratio and sum range filters (539 / 649 / 638)\n- Bonus ball recommendation (638 only)\n- Transformer ML model when a trained checkpoint is available\n\n### Train ML model\n\n```bash\nuv run lottery train --type 539 --epochs 100\n```\n\nTrains a Transformer model and saves the best checkpoint to `ml/checkpoints/`. Once trained, `recommend` will automatically use ML predictions.\n\n### Generate HTML report locally\n\n```bash\n# 1. Update data and train models first\nuv run lottery update --type 539   # repeat for each type\nuv run lottery train --type 539    # repeat for each type\n\n# 2. Generate the report\nuv run python scripts/generate_report.py\n```\n\nOutput is written to `dist/index.html` and `dist/YYYY-MM-DD.html`.\n\n### Run tests\n\n```bash\nuv run pytest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzients%2Ftw-lottery-recommendation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzients%2Ftw-lottery-recommendation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzients%2Ftw-lottery-recommendation/lists"}