Add Deep Learning (LSTM) + Quick Wins automation features

Major improvements:
- Deep Learning integration with PyTorch LSTM (dual models: main 1-50 + euro 1-12)
- Hybrid predictor: 40% RandomForest + 60% Deep Learning
- LaunchAgent for automatic weekly tip generation (Mon/Thu 21:00)
- Health-Check system with auto-recovery and Telegram alerts
- Fixed health checks for Eurojackpot-specific paths and file names
- 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)
- Separate LSTM models for main numbers (1-50) and euro numbers (1-12)
- Apple Silicon MPS acceleration support
- Sequence learning with 20-draw history
- Health-check adapted for eurojackpot_ml_models/ and learning_log.json

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-07 09:22:36 +01:00
co-authored by Claude Sonnet 4.5
parent 70e0638dee
commit 9049a66c1a
36 changed files with 9308 additions and 61 deletions
+28 -4
View File
@@ -81,7 +81,9 @@ class AutoUpdateAndLearn:
df = pd.read_csv(self.data_file, sep=';')
df['datum'] = pd.to_datetime(df['datum'], format='%Y-%m-%d')
latest_draw = df.iloc[0] # Neueste Ziehung (sortiert absteigend)
# Sortiere nach Datum absteigend und nimm neueste Ziehung
df = df.sort_values('datum', ascending=False)
latest_draw = df.iloc[0] # Neueste Ziehung
latest_date = latest_draw['datum']
print(f" 📅 Neueste Ziehung in Daten: {latest_date.strftime('%Y-%m-%d')}")
@@ -148,7 +150,7 @@ class AutoUpdateAndLearn:
print("\n🎯 EVALUIERE LETZTE TIPPS")
print("=" * 70)
# Finde neueste Tipps-Datei
# Finde Tipps-Datei die VOR der Ziehung generiert wurde
if not os.path.exists(self.tips_dir):
print(" ⚠️ Keine Tipps zum Evaluieren")
return {}
@@ -162,8 +164,30 @@ class AutoUpdateAndLearn:
print(" ⚠️ Keine Tipps-Dateien gefunden")
return {}
latest_tips_file = os.path.join(self.tips_dir, tip_files[0])
print(f" 📁 Evaluiere: {tip_files[0]}")
# Finde Tip-Datei die vor der Ziehung erstellt wurde
draw_date = new_draw['date']
selected_tip_file = None
for tip_file in tip_files:
# Parse Timestamp aus Dateiname: weekly_tips_YYYYMMDD_HHMMSS.csv
try:
parts = tip_file.replace('.csv', '').split('_')
tip_date_str = parts[-2] # YYYYMMDD
tip_date = pd.to_datetime(tip_date_str, format='%Y%m%d')
# Nehme erste Datei die vor der Ziehung war
if tip_date < draw_date:
selected_tip_file = tip_file
break
except:
continue
if not selected_tip_file:
# Fallback: nehme älteste Datei
selected_tip_file = tip_files[-1]
latest_tips_file = os.path.join(self.tips_dir, selected_tip_file)
print(f" 📁 Evaluiere: {selected_tip_file}")
try:
tips_df = pd.read_csv(latest_tips_file)
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- Label - Eindeutige Identifier -->
<key>Label</key>
<string>com.eurojackpot.weekly</string>
<!-- Programm-Pfad -->
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>cd "/Users/sebastianfrohlich/Library/Mobile Documents/com~apple~CloudDocs/Jupyter Notebooks/Eurojackpot" &amp;&amp; source venv/bin/activate &amp;&amp; python scripts/automation/weekly_tip_generator.py 2>&1 | tee -a logs/launchagent.log</string>
</array>
<!-- Zeitplan: Montag und Donnerstag um 21:00 -->
<key>StartCalendarInterval</key>
<array>
<!-- Montag 21:00 (vor Dienstag-Ziehung) -->
<dict>
<key>Weekday</key>
<integer>1</integer>
<key>Hour</key>
<integer>21</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
<!-- Donnerstag 21:00 (vor Freitag-Ziehung) -->
<dict>
<key>Weekday</key>
<integer>4</integer>
<key>Hour</key>
<integer>21</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</array>
<!-- Arbeitsverzeichnis -->
<key>WorkingDirectory</key>
<string>/Users/sebastianfrohlich/Library/Mobile Documents/com~apple~CloudDocs/Jupyter Notebooks/Eurojackpot</string>
<!-- Standard Output/Error Logging -->
<key>StandardOutPath</key>
<string>/Users/sebastianfrohlich/Library/Mobile Documents/com~apple~CloudDocs/Jupyter Notebooks/Eurojackpot/logs/stdout.log</string>
<key>StandardErrorPath</key>
<string>/Users/sebastianfrohlich/Library/Mobile Documents/com~apple~CloudDocs/Jupyter Notebooks/Eurojackpot/logs/stderr.log</string>
<!-- Wichtig: RunAtLoad für sofortigen Test -->
<key>RunAtLoad</key>
<false/>
<!-- Environment Variables -->
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
<key>LANG</key>
<string>de_DE.UTF-8</string>
</dict>
<!-- Wichtig: Auch bei Sleep/Wake ausführen -->
<key>LaunchOnlyOnce</key>
<false/>
<!-- Process Nice Level (niedrigere Priorität) -->
<key>Nice</key>
<integer>10</integer>
</dict>
</plist>