9 Commits
Author SHA1 Message Date
cbazzaandClaude Sonnet 5 ec7290ece5 Wire the web-scraper as a third update fallback, add regression tests
AutoUpdateAndLearn.update_data() now falls back to LottoWebUpdater
(lotto.de scraping) when the API chain (Lottoland/GitHub/lottoAPI)
returns no new data, matching the pattern already in production on
the Eurojackpot sibling project. Required installing beautifulsoup4
into the venv - its absence would have crashed the entire update
script the moment the fallback import was added, not just the
fallback path itself, so this needed verifying before wiring it in.

Also adds tests/test_popularity_score.py (pytest): regression coverage
for the popularity/EV score against known overplayed combinations
(1-2-3-4-5-6, 5-10-15-20-25-30) and the Superzahl EV ordering. Verified
against the pre-fix code (commit 8c2089d) that these tests would
actually have caught the sum-extremity bug fixed in e05f1f1 - this
had previously only been caught by manual spot-checking.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 10:08:45 +02:00
cbazzaandClaude Sonnet 5 612334dc1a Add watchdog for missed launchd runs, fix backup path bug + retention
Watchdog (scripts/utils/watchdog.py, com.lotto.watchdog.plist, daily
21:30) checks whether the latest draw or the trained models are older
than the launchd schedule allows and sends a Telegram alert - this
would have caught the Aug 15 update run that silently never fired
(the Mac was presumably asleep; launchd does not retry missed
StartCalendarInterval jobs), instead of that only surfacing on the
next manual check.

Also fixes a real path bug in LottoAPIUpdater.create_backup(): since
self.data_file already points into data/, joining "data","backups"
wrote backups to data/data/backups/ instead of data/backups/ - 73
backups (6.3MB) had been piling up there undetected for months, with
data/data/ only ever gitignored rather than the root cause fixed.
Merges the misplaced backups into the correct location and adds
retention (keep last 30) so backups no longer grow unbounded; applied
the same retention to Eurojackpot's updater in a matching commit
there, which didn't have the path bug but had the same unbounded
growth (85 backups, 2.4MB).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 10:02:04 +02:00
cbazzaandClaude Sonnet 5 a45092b162 Wire the Lottoland fallback into the automated update workflow
AutoUpdateAndLearn.update_data() called LottoAPIUpdater with
api_name='github', which skipped the already-implemented Lottoland ->
GitHub -> lottoAPI fallback chain entirely. The GitHub archive alone
has repeatedly lagged 1-6 days behind actual draws (most recently the
Aug 5 draw, still missing as of Aug 7), causing tips to be generated
and models to be retrained on stale data. Switching to api_name='all'
tries Lottoland first, which has consistently had same-day results in
testing, with GitHub still covering full history/fallback.

Also includes the Aug 5 draw pulled in via this fix and the resulting
model retrain (data update was previously interrupted by a truncated
pipe during manual testing, this completes it).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-07 10:55:17 +02:00
cbazzaandClaude Sonnet 4.6 e3a022b000 Add popularity score for EV-optimized number selection
Adds _calculate_popularity_score() which favors number combinations
unlikely to be picked by other players (numbers > 31, no consecutive
sequences, avoiding common "lucky numbers"). This doesn't improve hit
probability (lottery draws are i.i.d. random) but increases expected
value by reducing the chance of sharing a jackpot.

- New 20% weight in quality score
- New Popularity_Score column in tip CSV export

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 13:34:43 +02:00
cbazzaandClaude Sonnet 4.5 fcafa8b8c0 Fix data paths in update automation
- Fixed default data-dir in auto_update_and_learn.py (was pointing to old iCloud path)
- Updated run_update_and_learn.sh to explicitly pass correct data-dir
- Now saves data to /Projekte/Lotto/data instead of iCloud

This ensures automatic updates save to the correct location.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 11:56:15 +01:00
cbazzaandClaude Sonnet 4.5 9d2e4dfbc9 Improve Telegram notifications and update automation
- Enhanced Telegram message format to show TOP 3 by Confidence AND Quality
- Added average statistics (Confidence & Quality) to notifications
- Generated new tips with updated data (3,090 draws, latest: Jan 10)
- Added run_update_and_learn.sh wrapper script
- Created com.lotto.update.plist for automated updates
- Updated AlleLottozahlen.csv with latest draws

Benefits:
- Better tip selection with dual metrics visibility
- Clearer understanding of tip performance
- More informed decision-making for users

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 10:47:27 +01:00
cbazzaandClaude Sonnet 4.5 42a00d3fc4 Update automation configuration and paths
- Update plist to use new project path structure
- Simplify plist by removing comments
- Add run_tip_generator.sh script for easier execution
- Update data directory path in weekly_tip_generator.py

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-08 18:33:41 +01:00
cbazzaandClaude Sonnet 4.5 428403557e Add Deep Learning (LSTM) + Quick Wins automation features
Major improvements:
- Deep Learning integration with PyTorch LSTM (Bidirectional, 128→64 units)
- Hybrid predictor: 40% RandomForest + 60% Deep Learning
- LaunchAgent for automatic weekly tip generation (Tue/Fri 21:00)
- Health-Check system with auto-recovery and Telegram alerts
- Model caching and intelligent retraining logic
- Updated CSV data and generated tips
- Performance reports for recent draws

Technical details:
- PyTorch used instead of TensorFlow (Python 3.14 compatibility)
- Apple Silicon MPS acceleration support
- Sequence learning with 20-draw history
- Early stopping and learning rate scheduling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 09:20:49 +01:00
cbazzaandClaude Sonnet 4.5 f6106b8333 Initial commit: Lotto number generator project
This project includes multiple AI/ML-based lottery number generators for
German Lotto 6aus49, including pattern analysis, weighted predictions,
and hybrid approaches. Features automated weekly tip generation,
performance tracking, and Telegram bot integration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-16 14:47:59 +01:00