diff --git a/.gitignore b/.gitignore index 4fa77e0..b084b3e 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,10 @@ logs/*.log # Performance reports (optional) # ai_performance_report_*.json + +# Backups und generierte Outputs +data/backups/ +data/*.backup* +data/generated_tips/weekly_lotto_tips_*.csv +data/performance_reports/ +data/data/ diff --git a/data/AlleLottozahlen.csv b/data/AlleLottozahlen.csv index 28d0178..dc218ad 100644 --- a/data/AlleLottozahlen.csv +++ b/data/AlleLottozahlen.csv @@ -3095,3 +3095,33 @@ datum;Z1;Z2;Z3;Z4;Z5;Z6;SZ 2026-01-24;1;7;28;32;47;49;1 2026-01-28;9;11;25;35;37;44;3 2026-01-31;8;19;30;37;38;49;3 +2026-02-04;9;11;16;22;27;37;0 +2026-02-07;7;11;20;25;28;49;7 +2026-02-11;8;9;18;20;37;40;3 +2026-02-14;3;9;19;20;40;43;7 +2026-02-18;10;15;19;20;29;48;8 +2026-02-21;2;8;9;29;39;44;6 +2026-02-25;9;13;25;30;37;46;8 +2026-02-28;1;6;19;33;44;45;8 +2026-03-04;1;15;17;24;37;40;3 +2026-03-07;5;16;20;38;39;41;4 +2026-03-11;17;21;26;32;35;37;0 +2026-03-14;19;20;28;32;44;45;0 +2026-03-18;10;13;20;35;43;49;0 +2026-03-21;2;7;19;24;29;43;2 +2026-03-25;7;12;29;30;46;49;5 +2026-03-28;5;20;24;33;34;42;1 +2026-04-01;8;10;11;14;22;48;1 +2026-04-04;6;15;18;23;28;48;2 +2026-04-08;2;5;14;16;23;36;8 +2026-04-11;17;23;32;33;34;46;0 +2026-04-15;3;17;25;28;40;42;0 +2026-04-18;18;28;34;37;44;48;4 +2026-04-22;15;26;27;35;42;47;5 +2026-04-25;6;12;15;20;35;49;9 +2026-04-29;1;15;25;37;43;47;4 +2026-05-02;1;5;9;20;21;32;5 +2026-05-06;10;13;19;38;40;48;2 +2026-05-09;2;3;12;36;39;43;8 +2026-05-13;13;15;20;26;31;43;7 +2026-05-16;7;11;20;23;27;30;9 diff --git a/data/generated_tips/generation_history.json b/data/generated_tips/generation_history.json index a87627b..1055edf 100644 --- a/data/generated_tips/generation_history.json +++ b/data/generated_tips/generation_history.json @@ -174,6 +174,216 @@ "file": "weekly_lotto_tips_20260203_210148.csv", "avg_confidence": 0.43053407858302783, "avg_quality": 0.6127569878171568 + }, + { + "timestamp": "2026-02-06T21:24:33.178900", + "num_tips": 10, + "file": "weekly_lotto_tips_20260206_212433.csv", + "avg_confidence": 0.39179800156619443, + "avg_quality": 0.5831545873566034 + }, + { + "timestamp": "2026-02-10T21:00:22.150517", + "num_tips": 10, + "file": "weekly_lotto_tips_20260210_210022.csv", + "avg_confidence": 0.43625158283574716, + "avg_quality": 0.6169535402692883 + }, + { + "timestamp": "2026-02-13T21:00:21.382316", + "num_tips": 10, + "file": "weekly_lotto_tips_20260213_210021.csv", + "avg_confidence": 0.43088261472508316, + "avg_quality": 0.6109923873184334 + }, + { + "timestamp": "2026-02-17T21:00:26.043929", + "num_tips": 10, + "file": "weekly_lotto_tips_20260217_210026.csv", + "avg_confidence": 0.42905107467438075, + "avg_quality": 0.6160959707954421 + }, + { + "timestamp": "2026-02-20T21:00:26.545065", + "num_tips": 10, + "file": "weekly_lotto_tips_20260220_210026.csv", + "avg_confidence": 0.43055460012609004, + "avg_quality": 0.6159742993010366 + }, + { + "timestamp": "2026-02-24T21:00:15.456660", + "num_tips": 10, + "file": "weekly_lotto_tips_20260224_210015.csv", + "avg_confidence": 0.4389957217440533, + "avg_quality": 0.6166952308149034 + }, + { + "timestamp": "2026-02-27T21:00:26.214280", + "num_tips": 10, + "file": "weekly_lotto_tips_20260227_210026.csv", + "avg_confidence": 0.41380590175304316, + "avg_quality": 0.6007363719044858 + }, + { + "timestamp": "2026-03-03T21:00:30.382128", + "num_tips": 10, + "file": "weekly_lotto_tips_20260303_210030.csv", + "avg_confidence": 0.6131651661650304, + "avg_quality": 0.7146464746308903 + }, + { + "timestamp": "2026-03-06T21:00:24.428265", + "num_tips": 10, + "file": "weekly_lotto_tips_20260306_210024.csv", + "avg_confidence": 0.39974949595009224, + "avg_quality": 0.5881493624603976 + }, + { + "timestamp": "2026-03-10T21:05:18.962145", + "num_tips": 10, + "file": "weekly_lotto_tips_20260310_210518.csv", + "avg_confidence": 0.43571892829509284, + "avg_quality": 0.619982489791712 + }, + { + "timestamp": "2026-03-13T21:01:53.225581", + "num_tips": 10, + "file": "weekly_lotto_tips_20260313_210153.csv", + "avg_confidence": 0.4111754357415879, + "avg_quality": 0.6009998715375982 + }, + { + "timestamp": "2026-03-17T21:00:32.536342", + "num_tips": 10, + "file": "weekly_lotto_tips_20260317_210032.csv", + "avg_confidence": 0.4207776853663847, + "avg_quality": 0.6117993361098875 + }, + { + "timestamp": "2026-03-20T21:16:55.124861", + "num_tips": 10, + "file": "weekly_lotto_tips_20260320_211655.csv", + "avg_confidence": 0.4029942661902326, + "avg_quality": 0.5898327020762006 + }, + { + "timestamp": "2026-03-24T21:01:28.095284", + "num_tips": 10, + "file": "weekly_lotto_tips_20260324_210128.csv", + "avg_confidence": 0.4245373981596304, + "avg_quality": 0.6094510518762004 + }, + { + "timestamp": "2026-03-27T21:00:28.070123", + "num_tips": 10, + "file": "weekly_lotto_tips_20260327_210028.csv", + "avg_confidence": 0.42596489621339506, + "avg_quality": 0.614192879963136 + }, + { + "timestamp": "2026-03-31T21:00:20.282697", + "num_tips": 10, + "file": "weekly_lotto_tips_20260331_210020.csv", + "avg_confidence": 0.4311573904241078, + "avg_quality": 0.6143222769705906 + }, + { + "timestamp": "2026-04-03T21:46:54.466732", + "num_tips": 10, + "file": "weekly_lotto_tips_20260403_214654.csv", + "avg_confidence": 0.40367778119537806, + "avg_quality": 0.5978802314336015 + }, + { + "timestamp": "2026-04-07T21:00:23.043609", + "num_tips": 10, + "file": "weekly_lotto_tips_20260407_210023.csv", + "avg_confidence": 0.42841389944709796, + "avg_quality": 0.613680679288901 + }, + { + "timestamp": "2026-04-10T21:00:21.478887", + "num_tips": 10, + "file": "weekly_lotto_tips_20260410_210021.csv", + "avg_confidence": 0.4201527267401346, + "avg_quality": 0.6037242036565935 + }, + { + "timestamp": "2026-04-14T21:00:20.493117", + "num_tips": 10, + "file": "weekly_lotto_tips_20260414_210020.csv", + "avg_confidence": 0.4201339358438558, + "avg_quality": 0.6070767820478455 + }, + { + "timestamp": "2026-04-17T21:00:21.627397", + "num_tips": 10, + "file": "weekly_lotto_tips_20260417_210021.csv", + "avg_confidence": 0.40653731661730175, + "avg_quality": 0.5959122317720231 + }, + { + "timestamp": "2026-04-21T21:00:21.291830", + "num_tips": 10, + "file": "weekly_lotto_tips_20260421_210021.csv", + "avg_confidence": 0.4281003982558874, + "avg_quality": 0.6180774622190407 + }, + { + "timestamp": "2026-04-24T21:00:21.813713", + "num_tips": 10, + "file": "weekly_lotto_tips_20260424_210021.csv", + "avg_confidence": 0.40368288784557055, + "avg_quality": 0.590237489018969 + }, + { + "timestamp": "2026-04-28T21:16:39.462043", + "num_tips": 10, + "file": "weekly_lotto_tips_20260428_211639.csv", + "avg_confidence": 0.38479137617697334, + "avg_quality": 0.5730525563530181 + }, + { + "timestamp": "2026-05-01T21:13:28.620453", + "num_tips": 10, + "file": "weekly_lotto_tips_20260501_211328.csv", + "avg_confidence": 0.41358937770573123, + "avg_quality": 0.5981172891531314 + }, + { + "timestamp": "2026-05-05T21:00:21.883272", + "num_tips": 10, + "file": "weekly_lotto_tips_20260505_210021.csv", + "avg_confidence": 0.39151792949512265, + "avg_quality": 0.5835184310224573 + }, + { + "timestamp": "2026-05-08T21:00:27.261943", + "num_tips": 10, + "file": "weekly_lotto_tips_20260508_210027.csv", + "avg_confidence": 0.39430951299665706, + "avg_quality": 0.5770382849355139 + }, + { + "timestamp": "2026-05-12T21:00:21.984425", + "num_tips": 10, + "file": "weekly_lotto_tips_20260512_210021.csv", + "avg_confidence": 0.4339787527079359, + "avg_quality": 0.6033231576498798 + }, + { + "timestamp": "2026-05-15T21:00:21.046302", + "num_tips": 10, + "file": "weekly_lotto_tips_20260515_210021.csv", + "avg_confidence": 0.41244722617171564, + "avg_quality": 0.5996401924263831 + }, + { + "timestamp": "2026-05-19T13:32:39.647439", + "num_tips": 10, + "file": "weekly_lotto_tips_20260519_133239.csv", + "avg_confidence": 0.4215215125819441, + "avg_quality": 0.5999271737766253 } ] } \ No newline at end of file diff --git a/data/learning_log.json b/data/learning_log.json index 6205cee..0436d53 100644 --- a/data/learning_log.json +++ b/data/learning_log.json @@ -186,6 +186,408 @@ "main": 0.9, "sz_rate": 0.1 } + }, + { + "timestamp": "2026-02-07T20:00:50.951491", + "draw_date": "2026-02-04", + "evaluation": { + "main": 2, + "sz": false, + "tip": 3 + }, + "avg_matches": { + "main": 0.7, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-02-11T20:01:02.668200", + "draw_date": "2026-02-07", + "evaluation": { + "main": 2, + "sz": true, + "tip": 7 + }, + "avg_matches": { + "main": 0.6, + "sz_rate": 0.1 + } + }, + { + "timestamp": "2026-02-14T20:00:51.404740", + "draw_date": "2026-02-11", + "evaluation": { + "main": 1, + "sz": true, + "tip": 5 + }, + "avg_matches": { + "main": 0.9, + "sz_rate": 0.2 + } + }, + { + "timestamp": "2026-02-18T20:00:47.697855", + "draw_date": "2026-02-14", + "evaluation": { + "main": 1, + "sz": true, + "tip": 4 + }, + "avg_matches": { + "main": 0.8, + "sz_rate": 0.2 + } + }, + { + "timestamp": "2026-02-21T20:00:51.713450", + "draw_date": "2026-02-18", + "evaluation": { + "main": 1, + "sz": false, + "tip": 2 + }, + "avg_matches": { + "main": 0.5, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-02-25T20:00:24.757445", + "draw_date": "2026-02-21", + "evaluation": { + "main": 3, + "sz": true, + "tip": 1 + }, + "avg_matches": { + "main": 1.1, + "sz_rate": 0.5 + } + }, + { + "timestamp": "2026-02-28T20:00:54.216537", + "draw_date": "2026-02-25", + "evaluation": { + "main": 2, + "sz": true, + "tip": 10 + }, + "avg_matches": { + "main": 1.0, + "sz_rate": 0.4 + } + }, + { + "timestamp": "2026-03-04T20:00:54.207569", + "draw_date": "2026-02-28", + "evaluation": { + "main": 2, + "sz": false, + "tip": 7 + }, + "avg_matches": { + "main": 0.5, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-03-07T20:00:54.255644", + "draw_date": "2026-03-04", + "evaluation": { + "main": 1, + "sz": true, + "tip": 9 + }, + "avg_matches": { + "main": 0.4, + "sz_rate": 0.1 + } + }, + { + "timestamp": "2026-03-11T20:04:25.014685", + "draw_date": "2026-03-07", + "evaluation": { + "main": 3, + "sz": false, + "tip": 7 + }, + "avg_matches": { + "main": 0.9, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-03-14T20:00:53.783538", + "draw_date": "2026-03-11", + "evaluation": { + "main": 3, + "sz": false, + "tip": 6 + }, + "avg_matches": { + "main": 1.5, + "sz_rate": 0.1 + } + }, + { + "timestamp": "2026-03-18T20:00:49.938872", + "draw_date": "2026-03-14", + "evaluation": { + "main": 2, + "sz": false, + "tip": 2 + }, + "avg_matches": { + "main": 0.7, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-03-21T20:00:47.286207", + "draw_date": "2026-03-18", + "evaluation": { + "main": 3, + "sz": false, + "tip": 7 + }, + "avg_matches": { + "main": 1.3, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-03-26T09:10:14.208620", + "draw_date": "2026-03-21", + "evaluation": { + "main": 2, + "sz": false, + "tip": 10 + }, + "avg_matches": { + "main": 0.2, + "sz_rate": 0.1 + } + }, + { + "timestamp": "2026-03-28T20:00:55.831816", + "draw_date": "2026-03-25", + "evaluation": { + "main": 3, + "sz": false, + "tip": 2 + }, + "avg_matches": { + "main": 1.9, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-04-01T20:00:53.000438", + "draw_date": "2026-03-28", + "evaluation": { + "main": 1, + "sz": false, + "tip": 1 + }, + "avg_matches": { + "main": 0.6, + "sz_rate": 0.1 + } + }, + { + "timestamp": "2026-04-04T20:54:46.885784", + "draw_date": "2026-04-01", + "evaluation": { + "main": 2, + "sz": false, + "tip": 3 + }, + "avg_matches": { + "main": 1.0, + "sz_rate": 0.1 + } + }, + { + "timestamp": "2026-04-08T20:00:54.635015", + "draw_date": "2026-04-04", + "evaluation": { + "main": 1, + "sz": false, + "tip": 1 + }, + "avg_matches": { + "main": 0.5, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-04-11T20:00:52.934246", + "draw_date": "2026-04-08", + "evaluation": { + "main": 1, + "sz": true, + "tip": 1 + }, + "avg_matches": { + "main": 0.9, + "sz_rate": 0.4 + } + }, + { + "timestamp": "2026-04-15T20:07:32.209888", + "draw_date": "2026-04-11", + "evaluation": { + "main": 2, + "sz": false, + "tip": 2 + }, + "avg_matches": { + "main": 1.2, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-04-18T20:05:26.251241", + "draw_date": "2026-04-15", + "evaluation": { + "main": 1, + "sz": false, + "tip": 7 + }, + "avg_matches": { + "main": 0.1, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-04-22T20:11:15.133475", + "draw_date": "2026-04-18", + "evaluation": { + "main": 0, + "sz": false, + "tip": null + }, + "avg_matches": { + "main": 0.0, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-04-25T20:12:51.557882", + "draw_date": "2026-04-22", + "evaluation": { + "main": 2, + "sz": false, + "tip": 4 + }, + "avg_matches": { + "main": 1.0, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-04-29T20:00:54.738036", + "draw_date": "2026-04-25", + "evaluation": { + "main": 3, + "sz": false, + "tip": 5 + }, + "avg_matches": { + "main": 1.5, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-05-02T20:05:10.517397", + "draw_date": "2026-04-29", + "evaluation": { + "main": 1, + "sz": false, + "tip": 3 + }, + "avg_matches": { + "main": 0.2, + "sz_rate": 0.1 + } + }, + { + "timestamp": "2026-05-06T20:00:51.391264", + "draw_date": "2026-05-02", + "evaluation": { + "main": 3, + "sz": false, + "tip": 7 + }, + "avg_matches": { + "main": 1.2, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-05-09T21:16:17.020494", + "draw_date": "2026-05-06", + "evaluation": { + "main": 1, + "sz": false, + "tip": 2 + }, + "avg_matches": { + "main": 0.1, + "sz_rate": 0.1 + } + }, + { + "timestamp": "2026-05-13T20:00:57.516757", + "draw_date": "2026-05-09", + "evaluation": { + "main": 1, + "sz": false, + "tip": 6 + }, + "avg_matches": { + "main": 0.3, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-05-16T20:00:49.739335", + "draw_date": "2026-05-13", + "evaluation": { + "main": 1, + "sz": false, + "tip": 2 + }, + "avg_matches": { + "main": 0.2, + "sz_rate": 0.1 + } + }, + { + "timestamp": "2026-05-19T10:53:15.548204", + "draw_date": "2026-05-16", + "evaluation": { + "main": 2, + "sz": false, + "tip": 7 + }, + "avg_matches": { + "main": 0.9, + "sz_rate": 0.0 + } + }, + { + "timestamp": "2026-05-19T12:56:08.782697", + "draw_date": "2026-01-07", + "evaluation": { + "main": 0, + "sz": false + }, + "avg_matches": { + "main": 0.0 + }, + "note": "retroactive_learning" } ] } \ No newline at end of file diff --git a/data/ultimate_ml_models/deep_learning/lstm_config_49.json b/data/ultimate_ml_models/deep_learning/lstm_config_49.json index 3d3f76d..6d9e8a2 100644 --- a/data/ultimate_ml_models/deep_learning/lstm_config_49.json +++ b/data/ultimate_ml_models/deep_learning/lstm_config_49.json @@ -1,9 +1,9 @@ { - "trained_at": "2026-02-04T09:51:16.756987", - "num_samples": 3076, + "trained_at": "2026-05-19T12:56:08.778673", + "num_samples": 3106, "num_features": 20, - "final_loss": 0.3723479768672547, - "final_val_loss": 0.3735503777861595, - "best_val_loss": 0.3733456790447235, + "final_loss": 0.3726997012511278, + "final_val_loss": 0.37363722175359726, + "best_val_loss": 0.373420712351799, "epochs_trained": 30 } \ No newline at end of file diff --git a/data/ultimate_ml_models/deep_learning/lstm_model_49.pth b/data/ultimate_ml_models/deep_learning/lstm_model_49.pth index 388d28b..7be9924 100644 Binary files a/data/ultimate_ml_models/deep_learning/lstm_model_49.pth and b/data/ultimate_ml_models/deep_learning/lstm_model_49.pth differ diff --git a/data/ultimate_ml_models/learning_state.json b/data/ultimate_ml_models/learning_state.json index 5e87dcb..34da5ee 100644 --- a/data/ultimate_ml_models/learning_state.json +++ b/data/ultimate_ml_models/learning_state.json @@ -1,61 +1,61 @@ { "adjustments": { - "1": -0.019239457546212986, - "2": -0.04864542018655696, - "3": -0.0341626104844147, - "4": -0.019313709421212986, - "5": -0.03386929706155697, - "6": -0.04864542018655696, - "7": 0.009509281782781966, - "8": -0.01982426680905131, - "9": -0.019164832546212984, - "10": -0.019458901407925413, - "11": -0.0192376104844147, - "12": -0.005193716018053124, - "13": -0.034089832546212985, - "14": -0.04864542018655696, - "15": -0.03386929706155697, - "16": -0.0341626104844147, - "17": -0.04864542018655696, - "18": -0.03401668888972884, - "19": -0.04864542018655696, - "20": -0.04864542018655696, - "21": -0.019314446380353845, - "22": -0.03394317767718197, - "23": -0.019750036932742264, - "24": -0.03386929706155697, - "25": -0.004753345214365449, - "26": -0.03401668888972884, - "27": -0.019458901407925413, - "28": -0.019384649532925416, - "29": -0.034089832546212985, - "30": -0.04864542018655696, - "31": -0.04864542018655696, - "32": -0.005190049554206994, - "33": -0.034378768229570394, - "34": -0.04864542018655696, - "35": -0.03372042018655696, - "36": -0.04864542018655696, - "37": -0.004679834001818573, - "38": -0.03423502453292542, - "39": -0.03430707651119357, - "40": -0.034378768229570394, - "41": -0.04864542018655696, - "42": -0.034378768229570394, - "43": -0.04864542018655696, - "44": -0.03372042018655696, - "45": -0.04864542018655696, - "46": -0.005049972321408152, - "47": -0.03379504518655696, - "48": -0.03401668888972884, - "49": -0.019092802677181973 + "1": -0.0994862945437695, + "2": -0.1248629636841759, + "3": -0.12616662253783967, + "4": -0.15553493931812296, + "5": -0.11189041747698655, + "6": -0.1388683136503966, + "7": -0.09014676347906732, + "8": -0.11572166445504231, + "9": -0.07520215115747134, + "10": -0.10010115549147716, + "11": -0.11560963436741567, + "12": -0.10028342051734862, + "13": -0.11168978861557464, + "14": -0.1526636856874924, + "15": -0.05417950645156993, + "16": -0.12777928265967228, + "17": -0.12530654686312348, + "18": -0.11183229142514102, + "19": -0.09902207172091577, + "20": -0.029776650961084578, + "21": -0.12733768488517044, + "22": -0.14123268787172502, + "23": -0.1135369674174259, + "24": -0.1269362504093053, + "25": -0.08791477391266757, + "26": -0.1253552225691296, + "27": -0.128343701675931, + "28": -0.08632929916101496, + "29": -0.09930392741748621, + "30": -0.15362771006530596, + "31": -0.1659211045824391, + "32": -0.07242761451468395, + "33": -0.12702118870091922, + "34": -0.1383242826775991, + "35": -0.11176200966803025, + "36": -0.13694601435372344, + "37": -0.047805930390573126, + "38": -0.14016944903534453, + "39": -0.12692425715858557, + "40": -0.09995688206616946, + "41": -0.16727016816434043, + "42": -0.1259060956242059, + "43": -0.09600747206120991, + "44": -0.11335461843807568, + "45": -0.15376749982199803, + "46": -0.10192355718548886, + "47": -0.12410346839445828, + "48": -0.09794025493170301, + "49": -0.1003416088372136 }, "stats": { - "incorrect": 430, - "correct": 60, - "cycles": 10, - "last_update": "2026-01-31T20:12:26.724555" + "incorrect": 1720, + "correct": 240, + "cycles": 40, + "last_update": "2026-05-19T12:56:08.782124" }, "learning_rate": 0.1, - "last_saved": "2026-01-31T20:12:26.724608" + "last_saved": "2026-05-19T12:56:08.782183" } \ No newline at end of file diff --git a/data/ultimate_ml_models/trained_models.pkl b/data/ultimate_ml_models/trained_models.pkl index bfceff7..8b0ab42 100644 Binary files a/data/ultimate_ml_models/trained_models.pkl and b/data/ultimate_ml_models/trained_models.pkl differ diff --git a/scripts/generators/ultimate_ai_ml_hybrid_generator.py b/scripts/generators/ultimate_ai_ml_hybrid_generator.py index ccf73be..234b42e 100644 --- a/scripts/generators/ultimate_ai_ml_hybrid_generator.py +++ b/scripts/generators/ultimate_ai_ml_hybrid_generator.py @@ -146,6 +146,9 @@ class UltimateAIMLHybridGenerator: # 6. Initialize Real-Time Learning print("📚 Activating Real-Time Learning...", end=" ", flush=True) self.real_time_learner.initialize(self.features_df) + _counts = self.df[['Z1','Z2','Z3','Z4','Z5','Z6']].stack().value_counts() + freq = {n: int(_counts.get(n, 0)) for n in range(1, 50)} + self.real_time_learner.set_frequency_prior(freq) print("✅") self.is_trained = self.ai_ml_engine.is_trained @@ -230,6 +233,19 @@ class UltimateAIMLHybridGenerator: tip_counter += len(tips) print(f"✅ ({count} tips)") + # Strukturfilter: Summe + Parität korrigieren + fixed_count = 0 + for tip in all_tips: + if not self._passes_structural_constraints(tip['numbers']): + tip['numbers'] = self._apply_structural_fix(tip['numbers'], ai_predictions) + tip['ai_score'] = np.mean([ai_predictions.get(n, 0.1) for n in tip['numbers']]) + tip['pattern_weight'] = self.pattern_engine.calculate_pattern_weight(tip['numbers']) + tip['confidence'] = (tip['ai_score'] + tip['pattern_weight']) / 2 + tip['quality'] = self._calculate_quality_score(tip['numbers'], ai_predictions, tip['pattern_weight']) + fixed_count += 1 + if fixed_count: + print(f" 🔧 {fixed_count} Tip(s) via Strukturfilter korrigiert (Summe/Parität)") + # Output all tips print(f"\n📋 RESULTS:") print("=" * 95) @@ -406,29 +422,21 @@ class UltimateAIMLHybridGenerator: selected = [] for position in range(6): - best_candidate = None - best_score = -1 - - for candidate in all_candidates: - if candidate not in selected: - ai_s = ai_predictions.get(candidate, 0.1) - pattern_s = self.pattern_engine.get_number_pattern_score(candidate) - diversity_s = self._calculate_diversity_score(candidate, selected) if selected else 0.5 - - ensemble_score = (ai_s * 0.4 + pattern_s * 0.3 + diversity_s * 0.3) - - if ensemble_score > best_score: - best_score = ensemble_score - best_candidate = candidate - - if best_candidate: - selected.append(best_candidate) - else: - available = [n for n in range(1, 50) if n not in selected] - if available: - selected.append(random.choice(available)) - - selected = sorted(selected[:6]) + candidates = [c for c in all_candidates if c not in selected] + if not candidates: + candidates = [n for n in range(1, 50) if n not in selected] + + scores = [] + for c in candidates: + ai_s = ai_predictions.get(c, 0.1) + pattern_s = self.pattern_engine.get_number_pattern_score(c) + diversity_s = self._calculate_diversity_score(c, selected) if selected else 0.5 + scores.append(max(0.001, ai_s * 0.4 + pattern_s * 0.3 + diversity_s * 0.3)) + + choice = random.choices(candidates, weights=scores)[0] + selected.append(choice) + + selected = sorted(selected) superzahl = self._get_smart_superzahl(tip_number) ai_score = np.mean([ai_predictions.get(n, 0.1) for n in selected]) @@ -447,6 +455,55 @@ class UltimateAIMLHybridGenerator: 'quality': quality } + def _passes_structural_constraints(self, numbers): + """Prüft Summenbereich (122-176) und Parität (mind. 1G + 1U).""" + s = sum(numbers) + if s < 100 or s > 200: + return False + even = sum(1 for n in numbers if n % 2 == 0) + if even == 0 or even == 6: + return False + return True + + def _apply_structural_fix(self, numbers, ai_preds): + """Korrigiert Summe/Parität durch minimalen Tausch.""" + nums = list(numbers) + even = [n for n in nums if n % 2 == 0] + odd = [n for n in nums if n % 2 != 0] + if len(even) == 0: + worst = min(odd, key=lambda n: ai_preds.get(n, 0)) + cands = sorted([n for n in range(2, 50, 2) if n not in nums], + key=lambda n: -ai_preds.get(n, 0)) + if cands: + nums.remove(worst) + nums.append(cands[0]) + elif len(odd) == 0: + worst = min(even, key=lambda n: ai_preds.get(n, 0)) + cands = sorted([n for n in range(1, 50, 2) if n not in nums], + key=lambda n: -ai_preds.get(n, 0)) + if cands: + nums.remove(worst) + nums.append(cands[0]) + for _ in range(10): + s = sum(nums) + if 100 <= s <= 200: + break + if s > 200: + highest = max(nums) + cands = sorted([n for n in range(1, highest) if n not in nums], + key=lambda n: -ai_preds.get(n, 0)) + if cands: + nums.remove(highest) + nums.append(cands[0]) + else: + lowest = min(nums) + cands = sorted([n for n in range(lowest + 1, 50) if n not in nums], + key=lambda n: -ai_preds.get(n, 0)) + if cands: + nums.remove(lowest) + nums.append(cands[0]) + return sorted(nums) + def _calculate_diversity_score(self, candidate, selected): """Berechnet Diversitäts-Score.""" if not selected: @@ -1295,6 +1352,8 @@ class RealTimeLearner: self.stats = defaultdict(int) self.cache_path = cache_path self.learning_state_file = os.path.join(cache_path, 'learning_state.json') if cache_path else None + self.freq_prior = {} + self.freq_alpha = 0.2 # Lade gespeicherten State if self.learning_state_file and os.path.exists(self.learning_state_file): @@ -1304,14 +1363,24 @@ class RealTimeLearner: """Initialisiert Learning.""" self.features_df = features_df - def adjust_predictions(self, predictions): - """Passt Predictions an.""" - adjusted = {} + def set_frequency_prior(self, freq): + """Setzt Langzeit-Frequenz als Dämpfer (normalisiert auf [0,1]).""" + max_val = max(freq.values(), default=0) + norm = max_val if max_val > 0 else 1 + self.freq_prior = {n: v / norm for n, v in freq.items()} + def adjust_predictions(self, predictions): + """Passt Predictions an, gedämpft durch Langzeit-Frequenz.""" + adjusted = {} for number, pred in predictions.items(): adjustment = self.adjustments.get(number, 0) - adjusted[number] = np.clip(pred + adjustment * self.learning_rate, 0, 1) - + learner_val = np.clip(pred + adjustment * self.learning_rate, 0, 1) + if self.freq_prior: + alpha = max(0.0, min(1.0, self.freq_alpha)) + freq_val = self.freq_prior.get(number, 0.5) + adjusted[number] = np.clip((1 - alpha) * learner_val + alpha * freq_val, 0, 1) + else: + adjusted[number] = learner_val return adjusted def learn_from_result(self, drawing):