Rewrite README to match the actual active system
The old README documented almost exclusively the legacy scripts removed in the previous commit and never mentioned the real automation (auto_update_and_learn.py, weekly_tip_generator.py, launchd) at all. Rewritten to describe what's actually running: the 4-strategy generator, the EV-optimized quality score, the launchd schedule (not crontab - setup_cron.sh is stale), and the real data update chain. Links to the new ARCHITECTURE.md for details. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,120 +1,156 @@
|
|||||||
# Eurojackpot Analyse & Generator
|
# Eurojackpot Analyse & Generator
|
||||||
|
|
||||||
Sammlung von Python-Skripten zur Analyse von Eurojackpot-Daten und Generierung von Tipps basierend auf historischen Daten.
|
Automatisiertes System zur Analyse von Eurojackpot-Daten und Generierung von KI-gestützten Tipps mit Telegram-Benachrichtigungen. Schwesterprojekt von [Lotto 6aus49](../Lotto) — gleiche Architektur, angepasst an das Eurojackpot-Format (5 Hauptzahlen aus 50 + 2 Eurozahlen aus 12).
|
||||||
|
|
||||||
## Verzeichnisstruktur
|
Eine detaillierte Architektur- und Datenfluss-Beschreibung steht in [documentation/ARCHITECTURE.md](documentation/ARCHITECTURE.md).
|
||||||
|
|
||||||
```
|
## 🎲 Features
|
||||||
.
|
|
||||||
├── README.md # Diese Datei
|
- **🧠 AI/ML-basierte Tipp-Generierung**: Random Forest + LSTM (PyTorch) Hybrid-Predictor
|
||||||
├── data/ # Alle CSV-Dateien und Rohdaten
|
- **🎨 Pattern-Analyse**: Historische Verteilungsmuster
|
||||||
|
- **⚡ 4-Strategien-System**: HYBRID-OPT, BALANCED-SPREAD, HIGH-EV, SOFT-CONTRARIAN mit adaptiver Gewichtung
|
||||||
|
- **💰 EV-Optimierung**: Quality-Score gewichtet gezielt auf unpopuläre (aber gleich wahrscheinliche) Zahlenkombinationen, um den Gewinnanteil im Trefferfall zu erhöhen
|
||||||
|
- **📚 Real-Time Learning**: Kontinuierliches Retraining bei neuen Ziehungen
|
||||||
|
- **🤖 Automatisierung**: Tipp-Generierung & Datenupdate via launchd
|
||||||
|
- **📲 Telegram-Benachrichtigungen**: Automatische Tipps direkt aufs Smartphone
|
||||||
|
- **🔄 Data-Updates**: API-Kette (lottoAPI → Lottoland → Sazka.cz) mit Web-Scraper-Fallback
|
||||||
|
|
||||||
|
## 📁 Verzeichnisstruktur
|
||||||
|
|
||||||
|
```text
|
||||||
|
Eurojackpot/
|
||||||
|
├── README.md
|
||||||
|
├── config/
|
||||||
|
│ └── notifications.json # Telegram/Email Config
|
||||||
|
├── data/
|
||||||
|
│ ├── AlleEurojackpotzahlen.csv # Ziehungshistorie
|
||||||
|
│ ├── eurojackpot_ml_models/ # Trainierte Modelle (RF + LSTM)
|
||||||
|
│ └── generated_tips/ # Generierte Tipps
|
||||||
├── scripts/
|
├── scripts/
|
||||||
│ ├── analysis/ # Analyse-Skripte
|
│ ├── generators/
|
||||||
│ │ ├── bereichskombinationen_analyse.py
|
│ │ └── ultimate_ai_ml_eurojackpot_generator.py # aktiver Generator
|
||||||
│ │ ├── eurojackpot_bereichsanalyse.py
|
│ ├── automation/
|
||||||
│ │ ├── positionsanalyse.py
|
│ │ ├── auto_update_and_learn.py # Update + Retraining
|
||||||
│ │ ├── simple_bereichsanalyse.py
|
│ │ ├── weekly_tip_generator.py # Tipp-Generierung
|
||||||
│ │ └── treffer_analyse_umschluesselt.py
|
│ │ ├── com.eurojackpot.update.plist
|
||||||
│ ├── generators/ # Tipp-Generatoren
|
│ │ └── com.eurojackpot.weekly.plist
|
||||||
│ │ ├── eurojackpot_generator.py
|
│ └── utils/
|
||||||
│ │ ├── optimized_eurojackpot_generator.py
|
│ ├── notifier.py # Telegram/Email
|
||||||
│ │ ├── tipp_generator_nmmhh.py
|
│ ├── update_from_api.py # API-Updater (aktiv)
|
||||||
│ │ ├── tipp_generator_nmmhh_v2.py
|
│ ├── update_from_eurojackpot_zahlen_eu.py # Web-Scraper-Fallback
|
||||||
│ │ └── ultimate_ai_ml_eurojackpot_generator.py
|
│ ├── deep_learning_engine_pytorch.py # LSTM Engine
|
||||||
│ └── utils/ # Hilfsskripte
|
│ ├── simple_update.py # Manuelle Eingabe
|
||||||
│ ├── create_example_files.py
|
│ ├── validate_csv.py # manuelles Utility
|
||||||
│ ├── eurojackpot_processor.py
|
│ ├── verify_draws.py # manuelles Utility
|
||||||
│ ├── eurojackpot_processor_fixed.py
|
│ └── health_check.py # manuelles Utility
|
||||||
│ ├── eurojackpot_simple.py
|
├── documentation/
|
||||||
│ └── zahlen_umschluesseln.py
|
│ └── ARCHITECTURE.md
|
||||||
├── results/ # Ausgabedateien und Grafiken
|
├── run_tip_generator.sh
|
||||||
└── documentation/ # Alte Dokumentation
|
├── run_update_and_learn.sh
|
||||||
|
└── logs/
|
||||||
```
|
```
|
||||||
|
|
||||||
## Voraussetzungen
|
## 🚀 Quick Start
|
||||||
|
|
||||||
|
### 1. Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install pandas numpy matplotlib scikit-learn
|
python3 -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
pip install pandas numpy scikit-learn requests torch
|
||||||
```
|
```
|
||||||
|
|
||||||
## Verwendung
|
### 2. Telegram-Bot einrichten
|
||||||
|
|
||||||
### Analyse ausführen
|
1. Erstelle einen Bot mit [@BotFather](https://t.me/botfather)
|
||||||
```bash
|
2. Kopiere den Bot-Token, hole deine Chat-ID (z.B. mit [@userinfobot](https://t.me/userinfobot))
|
||||||
cd scripts/analysis
|
3. Konfiguriere `config/notifications.json`:
|
||||||
python eurojackpot_bereichsanalyse.py
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"telegram": {
|
||||||
|
"enabled": true,
|
||||||
|
"bot_token": "YOUR_BOT_TOKEN",
|
||||||
|
"chat_id": "YOUR_CHAT_ID"
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tipps generieren
|
Test-Benachrichtigung senden:
|
||||||
```bash
|
|
||||||
cd scripts/generators
|
|
||||||
python ultimate_ai_ml_eurojackpot_generator.py
|
|
||||||
```
|
|
||||||
|
|
||||||
### Daten verarbeiten
|
|
||||||
```bash
|
|
||||||
cd scripts/utils
|
|
||||||
python eurojackpot_processor.py
|
|
||||||
```
|
|
||||||
|
|
||||||
## Hauptkomponenten
|
|
||||||
|
|
||||||
### Analyse-Skripte
|
|
||||||
- **bereichskombinationen_analyse.py**: Analysiert Zahlenbereiche in Kombinationen
|
|
||||||
- **eurojackpot_bereichsanalyse.py**: Detaillierte Bereichsanalyse mit Visualisierung
|
|
||||||
- **positionsanalyse.py**: Analysiert Zahlen nach Position
|
|
||||||
- **treffer_analyse_umschluesselt.py**: Trefferanalyse mit Umschlüsselung
|
|
||||||
|
|
||||||
### Generatoren
|
|
||||||
|
|
||||||
- **ultimate_ai_ml_eurojackpot_generator.py**: ML-basierter Generator mit intelligentem Retraining
|
|
||||||
- **optimized_eurojackpot_generator.py**: Optimierter Generator mit mehreren Strategien
|
|
||||||
- **tipp_generator_nmmhh.py**: Generator basierend auf NMMHH-Prinzip
|
|
||||||
|
|
||||||
### 🤖 Automatisches ML-Retraining
|
|
||||||
|
|
||||||
Das System verwendet **intelligentes Retraining**:
|
|
||||||
|
|
||||||
- ✅ **Automatische Erkennung**: Prüft ob CSV neuer als ML-Cache
|
|
||||||
- ✅ **Smart Caching**: Nutzt Cache wenn Daten unverändert
|
|
||||||
- ✅ **Auto-Retrain**: Trainiert neu wenn neue Daten verfügbar
|
|
||||||
|
|
||||||
**So funktioniert es:**
|
|
||||||
|
|
||||||
1. Nach `update_from_eurojackpot_zahlen_eu.py` wird CSV aktualisiert
|
|
||||||
2. Beim nächsten Generator-Start: CSV-Timestamp > Cache-Timestamp
|
|
||||||
3. ✅ Automatisches Retraining mit neuen Daten
|
|
||||||
4. Neue ML-Modelle berücksichtigen aktuelle Ziehungen
|
|
||||||
|
|
||||||
**Manuelles Cache-Löschen (falls nötig):**
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd Eurojackpot
|
python scripts/utils/notifier.py --test
|
||||||
rm -rf cache/
|
|
||||||
python scripts/generators/ultimate_ai_ml_eurojackpot_generator.py
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Utilities
|
### 3. Tipps manuell generieren
|
||||||
- **eurojackpot_processor.py**: Verarbeitet und markiert Kombinationen
|
|
||||||
- **zahlen_umschluesseln.py**: Konvertiert Zahlenkombinationen
|
|
||||||
- **create_example_files.py**: Erstellt Testdaten
|
|
||||||
|
|
||||||
## Datenformat
|
```bash
|
||||||
|
python scripts/automation/weekly_tip_generator.py --force --num-tips 10
|
||||||
|
|
||||||
|
# Nur Historie anzeigen
|
||||||
|
python scripts/automation/weekly_tip_generator.py --history
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Daten manuell aktualisieren + Modelle neu trainieren
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./run_update_and_learn.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🧠 Generator-Strategien
|
||||||
|
|
||||||
|
Der Ultimate AI/ML Hybrid Generator (`scripts/generators/ultimate_ai_ml_eurojackpot_generator.py`) verteilt pro Lauf 10 Tipps über 4 Strategien, deren Gewichtung sich anhand der bisherigen Trefferleistung selbst anpasst (Startwerte in Klammern):
|
||||||
|
|
||||||
|
1. **HYBRID-OPT** (40%): AI-Score + historisches Pattern-Gewicht kombiniert
|
||||||
|
2. **BALANCED-SPREAD** (30%): erzwingt Verteilung über Zonen, kontrollierter Summenbereich
|
||||||
|
3. **HIGH-EV** (20%): 2 Hauptzahlen >31, meidet empirisch belegte populäre Einzelzahlen — auf EV statt Trefferwahrscheinlichkeit optimiert
|
||||||
|
4. **SOFT-CONTRARIAN** (10%): bevorzugt in den letzten 30 Ziehungen unterrepräsentierte Zahlen
|
||||||
|
|
||||||
|
### Warum EV statt Trefferwahrscheinlichkeit?
|
||||||
|
|
||||||
|
Eurojackpot-Ziehungen sind unabhängige Zufallsereignisse — kein Modell kann
|
||||||
|
die Trefferwahrscheinlichkeit über den statistischen Erwartungswert heben.
|
||||||
|
Der Quality-Score optimiert deshalb bewusst auf **Expected Value**: unpopuläre
|
||||||
|
Zahlenkombinationen haben bei einem Treffer weniger Mitgewinner und damit eine
|
||||||
|
höhere Auszahlung. Details und Quellen dazu in
|
||||||
|
[documentation/ARCHITECTURE.md](documentation/ARCHITECTURE.md#3-design-entscheidung-quality-score--ev-optimierung).
|
||||||
|
|
||||||
|
## 🤖 Automatisierung
|
||||||
|
|
||||||
|
Läuft über **launchd** (`~/Library/LaunchAgents/`), nicht crontab:
|
||||||
|
|
||||||
|
| Job | Plist | Zeitplan |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Tipp-Generierung | `com.eurojackpot.weekly.plist` | Mo + Do, 21:00 Uhr (Abend vor Di/Fr-Ziehung) |
|
||||||
|
| Update & Learning | `com.eurojackpot.update.plist` | Mi + Sa, 08:00 Uhr (Morgen nach Di/Fr-Ziehung) |
|
||||||
|
|
||||||
|
Beide Plists liegen unter `scripts/automation/` und müssen für die Aktivierung
|
||||||
|
nach `~/Library/LaunchAgents/` verlinkt/kopiert und mit `launchctl load`
|
||||||
|
geladen werden.
|
||||||
|
|
||||||
|
## 📲 Telegram-Benachrichtigungen
|
||||||
|
|
||||||
|
Bei erfolgreicher Tipp-Generierung bzw. nach jeder ausgewerteten Ziehung
|
||||||
|
verschickt `EurojackpotNotifier` automatisch eine Zusammenfassung (bester
|
||||||
|
Tipp, Ø Confidence/Quality, Trefferauswertung).
|
||||||
|
|
||||||
|
## 📈 Performance Tracking
|
||||||
|
|
||||||
|
Alle Generierungen werden in `data/generated_tips/generation_history.json`
|
||||||
|
protokolliert, alle Ziehungsauswertungen in `data/learning_log.json`.
|
||||||
|
|
||||||
|
## 🗂️ Datenformat
|
||||||
|
|
||||||
|
`data/AlleEurojackpotzahlen.csv` (Semikolon-getrennt):
|
||||||
|
|
||||||
Die CSV-Dateien im [data](data/)-Ordner folgen dem Format:
|
|
||||||
```csv
|
```csv
|
||||||
Zahl1,Zahl2,Zahl3,Zahl4,Zahl5,bereits_gezogen
|
datum;Z1;Z2;Z3;Z4;Z5;SZ1;SZ2
|
||||||
1,2,3,4,5,0
|
2012-03-23;5;8;21;37;46;6;8
|
||||||
5,12,23,34,45,1
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Hinweise
|
## Hinweise
|
||||||
|
|
||||||
- Eurojackpot: 5 aus 50 Zahlen + 2 aus 12 Eurozahlen
|
- Eurojackpot: 5 aus 50 Hauptzahlen + 2 aus 12 Eurozahlen
|
||||||
- Alle Kombinationen: ~139 Millionen Möglichkeiten
|
- `setup_cron.sh` beschreibt einen älteren, crontab-basierten Zeitplan, der
|
||||||
- Die Skripte benötigen ausreichend RAM für große Datenmengen
|
nicht mehr dem tatsächlich aktiven launchd-Setup entspricht — nicht als
|
||||||
|
aktuelle Referenz verwenden.
|
||||||
## Weitere Dokumentation
|
|
||||||
|
|
||||||
Siehe [documentation/README.md](documentation/README.md) für die ursprüngliche Dokumentation.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user