Coba prediksi menggunakan paito warna dan setelah ...

创建于:2026年6月7日

使用 GPT-5.5 Thinking 回答 Chat01

问题

PRIZE.txt

Coba prediksi menggunakan paito warna dan setelah prediksi buaktan scriptnya untuk di jalankan di google colab

Python

python
from pathlib import Path path=Path('/mnt/data/PRIZE.txt') print(path.exists(), path.stat().st_size if path.exists() else None) print(path.read_text(encoding='utf-8', errors='replace')[:1000])

Python

python
import re, pandas as pd, numpy as np, textwrap, json, math, statistics as stats text=path.read_text(encoding='utf-8', errors='replace') months = { "Januari":1,"Februari":2,"Maret":3,"April":4,"Mei":5,"Juni":6, "Juli":7,"Agustus":8,"September":9,"Oktober":10,"November":11,"Desember":12 } records=[] cur_date=None cur_time=None line_no=0 date_re=re.compile(r"Tanggal:\s*(\d{1,2})\s+(\w+)\s+(\d{4})\s*\|\s*Waktu:\s*(\d{2}:\d{2})") num_re=re.compile(r"^\s*(\d{4})\s+([0-9,\s]+)\s*$") for line in text.splitlines(): line_no += 1 m=date_re.search(line) if m: day, month_name, year, t=m.groups() cur_date = pd.Timestamp(int(year), months[month_name], int(day)) cur_time = t continue m=num_re.match(line) if m and cur_date is not None: num, digstr=m.groups() missing = tuple(int(x) for x in re.findall(r"\d", digstr)) present = tuple(sorted(set(int(c) for c in num))) # validate if set(missing) != set(range(10))-set(present): print("bad", line_no, cur_date, cur_time, num, missing, present) records.append(dict(date=cur_date, time=cur_time, number=num, missing=missing, present=present, line=line_no)) len(records), records[:3], records[-3:] (2079, [{'date': Timestamp('2026-02-10 00:00:00'), 'time': '21:30', 'number': '6112', 'missing': (0, 3, 4, 5, 7, 8, 9), 'present': (1, 2, 6), 'line': 4}, {'date': Timestamp('2026-02-10 00:00:00'), 'time': '21:30', 'number': '0236', 'missing': (1, 4, 5, 7, 8, 9), 'present': (0, 2, 3, 6), 'line': 5}, {'date': Timestamp('2026-02-10 00:00:00'), 'time': '21:30', 'number': '7341', 'missing': (0, 2, 5, 6, 8, 9), 'present': (1, 3, 4, 7), 'line': 6}], [{'date': Timestamp('2026-06-07 00:00:00'), 'time': '06:30', 'number': '4278', 'missing': (0, 1, 3, 5, 6, 9), 'present': (2, 4, 7, 8), 'line': 3464}, {'date': Timestamp('2026-06-07 00:00:00'), 'time': '06:30', 'number': '4829', 'missing': (0, 1, 3, 5, 6, 7), 'present': (2, 4, 8, 9), 'line': 3465}, {'date': Timestamp('2026-06-07 00:00:00'), 'time': '06:30', 'number': '5370', 'missing': (1, 2, 4, 6, 8, 9), 'present': (0, 3, 5, 7), 'line': 3466}])

Python

python
lines=text.splitlines() for lno in [2805,2871]: for i in range(lno-3,lno+3): print(i, lines[i-1]) print()

Python

python
print("\n".join(text.splitlines()[-80:]))

Python

python
df=pd.DataFrame(records) df['date_str']=df['date'].dt.strftime('%Y-%m-%d') df['dt']=pd.to_datetime(df['date'].dt.strftime('%Y-%m-%d')+' '+df['time']) # keep file order df['seq']=range(len(df)) for pos in range(4): df[f'd{pos}']=df['number'].str[pos].astype(int) # draw index: group date+time and order within group df['prize_idx']=df.groupby(['date','time']).cumcount()+1 df.tail(12) date time number missing ... d1 d2 d3 prize_idx 2067 2026-06-06 17:30 5663 (0, 1, 2, 4, 7, 8, 9) ... 6 6 3 1 2068 2026-06-06 17:30 8650 (1, 2, 3, 4, 7, 9) ... 6 5 0 2 2069 2026-06-06 17:30 9724 (0, 1, 3, 5, 6, 8) ... 7 2 4 3 2070 2026-06-06 21:30 5113 (0, 2, 4, 6, 7, 8, 9) ... 1 1 3 1 2071 2026-06-06 21:30 1359 (0, 2, 4, 6, 7, 8) ... 3 5 9 2 2072 2026-06-06 21:30 8641 (0, 2, 3, 5, 7, 9) ... 6 4 1 3 2073 2026-06-07 03:30 8304 (1, 2, 5, 6, 7, 9) ... 3 0 4 1 2074 2026-06-07 03:30 4068 (1, 2, 3, 5, 7, 9) ... 0 6 8 2 2075 2026-06-07 03:30 9668 (0, 1, 2, 3, 4, 5, 7) ... 6 6 8 3 2076 2026-06-07 06:30 4278 (0, 1, 3, 5, 6, 9) ... 2 7 8 1 2077 2026-06-07 06:30 4829 (0, 1, 3, 5, 6, 7) ... 8 2 9 2 2078 2026-06-07 06:30 5370 (1, 2, 4, 6, 8, 9) ... 3 7 0 3 [12 rows x 14 columns]

Python

python
from collections import Counter, defaultdict digits=list(range(10)) latest_seq=df['seq'].max() target_time='11:30' prev_time='06:30' last_block=df[(df['date']==df['date'].max()) & (df['time']==prev_time)].copy() last_block date time number missing ... d1 d2 d3 prize_idx 2076 2026-06-07 06:30 4278 (0, 1, 3, 5, 6, 9) ... 2 7 8 1 2077 2026-06-07 06:30 4829 (0, 1, 3, 5, 6, 7) ... 8 2 9 2 2078 2026-06-07 06:30 5370 (1, 2, 4, 6, 8, 9) ... 3 7 0 3 [3 rows x 14 columns]

Python

python
# recompute present / missing from number df['present_set'] = df['number'].apply(lambda s: set(map(int,s))) df['missing_set'] = df['present_set'].apply(lambda s: set(digits)-s) def normalize(arr, smoothing=1e-9): arr=np.array(arr, dtype=float)+smoothing s=arr.sum() return arr/s if s>0 else np.ones_like(arr)/len(arr) def exp_weighted_pos_freq(sub, pos, half_life=300, by_seq=True): if len(sub)==0: return np.ones(10)/10 if by_seq: weights=np.exp(-(latest_seq - sub['seq'].values)/half_life) else: weights=np.ones(len(sub)) counts=np.zeros(10) vals=sub[f'd{pos}'].values for v,w in zip(vals,weights): counts[int(v)]+=w # smooth with small prior return normalize(counts + 0.5) def unweighted_pos_freq(sub, pos): counts=np.zeros(10) for v in sub[f'd{pos}'].values: counts[int(v)]+=1 return normalize(counts+0.5) # target time position frequencies target_sub=df[df['time']==target_time] lastN=df.tail(300) lastN_time=df[df['time']==target_time].tail(180) # 60 draws x 3 maybe print(len(df), len(target_sub), len(lastN_time), df['date'].min(), df['date'].max()) # absence streak for each digit across individual records backward absence_streak={} for d in digits: streak=0 for s in reversed(df['number'].tolist()): if str(d) not in s: streak+=1 else: break absence_streak[d]=streak # recent missing rate across last 90 records recent90=df.tail(90) missing_rate={d: sum(d in ms for ms in recent90['missing_set'])/len(recent90) for d in digits} present_rate={d: 1-missing_rate[d] for d in digits} absence_streak, missing_rate ({0: 0, 1: 6, 2: 1, 3: 0, 4: 1, 5: 0, 6: 3, 7: 0, 8: 1, 9: 1}, {0: 0.5777777777777777, 1: 0.7, 2: 0.5666666666666667, 3: 0.5666666666666667, 4: 0.6333333333333333, 5: 0.6555555555555556, 6: 0.7, 7: 0.7, 8: 0.5777777777777777, 9: 0.6333333333333333})

Python

python
# prepare block pivot # get rows for prev_time and target_time per date/prize_idx prev_rows=df[df['time']==prev_time][['date','prize_idx','number']+[f'd{p}' for p in range(4)]].rename(columns={f'd{p}':f'prev_d{p}' for p in range(4)}) target_rows=df[df['time']==target_time][['date','prize_idx','number']+[f'd{p}' for p in range(4)]].rename(columns={'number':'target_number', **{f'd{p}':f'target_d{p}' for p in range(4)}}) pairs=pd.merge(prev_rows, target_rows, on=['date','prize_idx'], how='inner') pairs.tail(), len(pairs) ( date prize_idx number ... target_d1 target_d2 target_d3 343 2026-06-05 2 6593 ... 2 8 9 344 2026-06-05 3 1287 ... 0 9 4 345 2026-06-06 1 1709 ... 3 3 9 346 2026-06-06 2 4932 ... 9 2 5 347 2026-06-06 3 8660 ... 0 9 7 [5 rows x 12 columns], 348)

Python

python
# Current previous digits by prize_idx current_prev = last_block.set_index('prize_idx')[[f'd{p}' for p in range(4)]].to_dict('index') current_prev {1: {'d0': 4, 'd1': 2, 'd2': 7, 'd3': 8}, 2: {'d0': 4, 'd1': 8, 'd2': 2, 'd3': 9}, 3: {'d0': 5, 'd1': 3, 'd2': 7, 'd3': 0}}

Python

python
def transition_freq(pos, prize_idx, prev_digit): sub=pairs[(pairs['prize_idx']==prize_idx) & (pairs[f'prev_d{pos}']==prev_digit)] # back off if low if len(sub)<8: sub=pairs[(pairs[f'prev_d{pos}']==prev_digit)] if len(sub)<8: sub=pairs[pairs['prize_idx']==prize_idx] counts=np.zeros(10) for v in sub[f'target_d{pos}'].values: counts[int(v)]+=1 return normalize(counts+0.5), len(sub) # overdue vector streak_arr=np.array([absence_streak[d] for d in digits], dtype=float) miss_arr=np.array([missing_rate[d] for d in digits], dtype=float) # normalize around high streak and high missing rate overdue_raw = (streak_arr+1)**0.6 * (miss_arr+0.05) overdue = normalize(overdue_raw) overdue array([0.05817431, 0.22338055, 0.08661513, 0.05714467, 0.09597892, 0.06538174, 0.15966971, 0.06950028, 0.08817576, 0.09597892])

Python

python
weights = dict(recent=0.30, target=0.30, trans=0.25, overdue=0.15) scores_by_prize={} details={} for prize_idx in [1,2,3]: pos_scores=[] pos_components=[] for pos in range(4): recent=exp_weighted_pos_freq(lastN, pos, half_life=150) target=exp_weighted_pos_freq(lastN_time, pos, half_life=500) prev_digit=current_prev[prize_idx][f'd{pos}'] trans, ntrans=transition_freq(pos, prize_idx, prev_digit) score=weights['recent']*recent + weights['target']*target + weights['trans']*trans + weights['overdue']*overdue score=normalize(score) pos_scores.append(score) pos_components.append({'recent':recent, 'target':target, 'trans':trans, 'ntrans':ntrans, 'prev_digit':prev_digit}) scores_by_prize[prize_idx]=pos_scores details[prize_idx]=pos_components for prize_idx,pos_scores in scores_by_prize.items(): print("Prize",prize_idx) for pos,score in enumerate(pos_scores): top=sorted([(d,score[d]) for d in digits], key=lambda x:-x[1])[:5] print(pos, top, "prev", details[prize_idx][pos]['prev_digit'], "ntrans", details[prize_idx][pos]['ntrans']) print()

Python

python
from itertools import product def top_combos(pos_scores, top_per_pos=6, n=10): top_digits=[sorted(digits, key=lambda d:-pos_scores[pos][d])[:top_per_pos] for pos in range(4)] combos=[] for combo in product(*top_digits): # Score product and slight digit diversity penalty/bonus? Let's use sum log. s=sum(math.log(pos_scores[pos][d]+1e-12) for pos,d in enumerate(combo)) # bonus if contains overdue digits 1 or 6? # not too strong s += 0.05*sum(1 for d in set(combo) if d in [1,6]) combos.append(("".join(map(str,combo)), s)) combos=sorted(combos, key=lambda x:-x[1])[:n] return combos, top_digits for prize_idx,pos_scores in scores_by_prize.items(): combos, topd=top_combos(pos_scores, top_per_pos=5, n=10) print("Prize", prize_idx, "topdigits", topd) print(combos) # Combined score average across prize indices combined_scores=[normalize(sum(scores_by_prize[i][pos] for i in [1,2,3])/3) for pos in range(4)] combos_combined, topd_combined=top_combos(combined_scores, top_per_pos=6, n=20) print("Combined", topd_combined, combos_combined[:20]) # Global BBFS digit: sum across combined pos digit_strength=np.zeros(10) for pos in range(4): digit_strength += combined_scores[pos] bbfs=sorted([(d,digit_strength[d]) for d in digits], key=lambda x:-x[1]) bbfs [(1, np.float64(0.4548494184633617)), (0, np.float64(0.41984195067547597)), (9, np.float64(0.4171527004726751)), (7, np.float64(0.410105051995842)), (6, np.float64(0.40100255305687915)), (5, np.float64(0.40056328950994635)), (4, np.float64(0.39296459871314504)), (8, np.float64(0.3827515169151987)), (3, np.float64(0.3619699607855462)), (2, np.float64(0.35879895941193))]

Python

python
def pct(x): return round(100*x,1) for N in [30,60,90]: sub=df.tail(N) mr={d:sum(d in ms for ms in sub['missing_set'])/len(sub) for d in digits} print("N",N, sorted([(d,pct(v)) for d,v in mr.items()], key=lambda x:-x[1])) latest_block=df.tail(3) latest_present=set().union(*latest_block['present_set']) latest_absent=set(digits)-latest_present latest_present, latest_absent ({0, 2, 3, 4, 5, 7, 8, 9}, {1, 6})

Python

python
# top 2D suffix candidates from combined scores pos2,pos3 pair_scores=[] for a,b in product(digits,digits): s=combined_scores[2][a]*combined_scores[3][b] pair_scores.append((f"{a}{b}",s)) pair_scores=sorted(pair_scores,key=lambda x:-x[1])[:20] pair_scores[:20] [('91', np.float64(0.01649363814126143)), ('01', np.float64(0.015729796066966412)), ('81', np.float64(0.015585655720488884)), ('51', np.float64(0.015526485822565383)), ('21', np.float64(0.01518311016426034)), ('61', np.float64(0.014502386474604232)), ('41', np.float64(0.014420934624327005)), ('71', np.float64(0.013070512646366326)), ('11', np.float64(0.012516207719431115)), ('97', np.float64(0.01191738091772378)), ('31', np.float64(0.01181511915671681)), ('94', np.float64(0.011616779441530037)), ('07', np.float64(0.011365471334016749)), ('90', np.float64(0.011360693683028614)), ('98', np.float64(0.011304126773654496)), ('87', np.float64(0.011261323577174182)), ('57', np.float64(0.011218570716563452)), ('04', np.float64(0.011078791107528222)), ('84', np.float64(0.010977270351506162)), ('27', np.float64(0.010970466660754307))]

思考

Crafting the script and heatmap

I’m going to create a robust self-contained Colab script in Python. It will read the uploaded file, parse it, and compute results using default libraries like pandas, numpy, and matplotlib. The script might generate a heatmap, but without specifying complex colors, and use matplotlib’s default colormap. The chart will be optional, as it’s for the user to run.

Thought for 2m 45s

Python

python
from pathlib import Path import json, textwrap script = r'''# ============================================================ # Prediksi Paito Warna 4D dari file PRIZE.txt # Untuk Google Colab # Catatan: hasil ini hanya analisis statistik/pola historis, bukan jaminan. # ============================================================ import re import math import numpy as np import pandas as pd from itertools import product from collections import defaultdict # --- 1) Upload file PRIZE.txt --- try: from google.colab import files uploaded = files.upload() if not uploaded: raise RuntimeError("Tidak ada file yang diupload.") filename = next(iter(uploaded)) text = uploaded[filename].decode("utf-8", errors="replace") except Exception: # Alternatif jika dijalankan bukan di Colab: filename = "PRIZE.txt" with open(filename, "r", encoding="utf-8", errors="replace") as f: text = f.read() # --- 2) Parser data --- MONTHS = { "Januari": 1, "Februari": 2, "Maret": 3, "April": 4, "Mei": 5, "Juni": 6, "Juli": 7, "Agustus": 8, "September": 9, "Oktober": 10, "November": 11, "Desember": 12 } date_re = re.compile(r"Tanggal:\s*(\d{1,2})\s+(\w+)\s+(\d{4})\s*\|\s*Waktu:\s*(\d{2}:\d{2})") num_re = re.compile(r"^\s*(\d{4})\s+([0-9,\s]+)\s*$") records = [] bad_missing_lines = [] cur_date, cur_time = None, None for line_no, line in enumerate(text.splitlines(), start=1): m = date_re.search(line) if m: day, month_name, year, jam = m.groups() if month_name not in MONTHS: continue cur_date = pd.Timestamp(int(year), MONTHS[month_name], int(day)) cur_time = jam continue m = num_re.match(line) if m and cur_date is not None: number, missing_txt = m.groups() extracted_missing = set(int(x) for x in re.findall(r"\d", missing_txt)) present = set(int(ch) for ch in number) recomputed_missing = set(range(10)) - present # Jika angka kanan tidak sesuai, kita pakai hasil hitung ulang dari angka 4D. if extracted_missing != recomputed_missing: bad_missing_lines.append((line_no, number, sorted(extracted_missing), sorted(recomputed_missing))) records.append({ "date": cur_date, "time": cur_time, "number": number, "present_set": present, "missing_set": recomputed_missing, "line": line_no }) if not records: raise ValueError("Data tidak terbaca. Pastikan format file seperti: Tanggal: ... | Waktu: ... lalu baris angka 4D.") df = pd.DataFrame(records) df["dt"] = pd.to_datetime(df["date"].dt.strftime("%Y-%m-%d") + " " + df["time"]) df["seq"] = range(len(df)) df["prize_idx"] = df.groupby(["date", "time"]).cumcount() + 1 for pos in range(4): df[f"d{pos}"] = df["number"].str[pos].astype(int) print(f"File: {filename}") print(f"Total angka terbaca: {len(df):,}") print(f"Rentang data: {df['date'].min().date()} sampai {df['date'].max().date()}") if bad_missing_lines: print(f"Catatan: ditemukan {len(bad_missing_lines)} baris list warna/absen yang tidak cocok; script memakai hitung ulang dari angka 4D.") # --- 3) Tentukan target prediksi dari blok terakhir --- time_slots = ["03:30", "06:30", "11:30", "13:30", "17:30", "21:30"] groups = ( df[["date", "time", "dt"]] .drop_duplicates() .sort_values(["dt"]) .reset_index(drop=True) ) latest_group = groups.iloc[-1] latest_date = latest_group["date"] latest_time = latest_group["time"] if latest_time in time_slots: idx = time_slots.index(latest_time) if idx == len(time_slots) - 1: target_time = time_slots[0] target_date = latest_date + pd.Timedelta(days=1) else: target_time = time_slots[idx + 1] target_date = latest_date else: # fallback kalau jam tidak termasuk daftar umum target_time = "NEXT" target_date = latest_date latest_block = df[(df["date"] == latest_date) & (df["time"] == latest_time)].copy() latest_present = set().union(*latest_block["present_set"].tolist()) latest_absent = set(range(10)) - latest_present print("\nBlok terakhir:") print(latest_block[["date", "time", "prize_idx", "number"]].to_string(index=False)) print(f"\nTarget prediksi otomatis: {target_date.date()} | {target_time}") print(f"Digit yang absen di blok terakhir: {sorted(latest_absent)}") # --- 4) Fungsi scoring paito warna --- digits = list(range(10)) latest_seq = int(df["seq"].max()) def normalize(arr, smoothing=1e-12): arr = np.array(arr, dtype=float) + smoothing total = arr.sum() if total <= 0: return np.ones_like(arr) / len(arr) return arr / total def exp_weighted_pos_freq(sub, pos, half_life=250): """Frekuensi posisi dengan bobot data terbaru lebih besar.""" if len(sub) == 0: return np.ones(10) / 10 weights = np.exp(-(latest_seq - sub["seq"].values) / half_life) counts = np.zeros(10) for val, weight in zip(sub[f"d{pos}"].values, weights): counts[int(val)] += weight return normalize(counts + 0.5) def absence_streaks(data): """Berapa baris terakhir digit tidak muncul.""" out = {} nums = data["number"].tolist() for d in digits: streak = 0 for s in reversed(nums): if str(d) not in s: streak += 1 else: break out[d] = streak return out streak = absence_streaks(df) recent_n = min(90, len(df)) recent = df.tail(recent_n) missing_rate = { d: sum(d in ms for ms in recent["missing_set"]) / len(recent) for d in digits } # Vektor "overdue": digit yang sering/baru absen diberi tambahan bobot kecil. overdue_raw = np.array([ ((streak[d] + 1) ** 0.6) * (missing_rate[d] + 0.05) for d in digits ]) overdue_score = normalize(overdue_raw) # --- 5) Transisi dari blok terakhir menuju jam target --- # Membuat pasangan blok berurutan: blok sekarang -> blok berikutnya. draw_keys = groups[["date", "time"]].to_dict("records") transition_rows = [] for i in range(len(draw_keys) - 1): cur = draw_keys[i] nxt = draw_keys[i + 1] if cur["time"] != latest_time or nxt["time"] != target_time: continue cur_rows = df[(df["date"] == cur["date"]) & (df["time"] == cur["time"])] nxt_rows = df[(df["date"] == nxt["date"]) & (df["time"] == nxt["time"])] for prize_idx in sorted(set(cur_rows["prize_idx"]).intersection(set(nxt_rows["prize_idx"]))): a = cur_rows[cur_rows["prize_idx"] == prize_idx].iloc[0] b = nxt_rows[nxt_rows["prize_idx"] == prize_idx].iloc[0] row = {"prize_idx": prize_idx} for pos in range(4): row[f"prev_d{pos}"] = int(a[f"d{pos}"]) row[f"target_d{pos}"] = int(b[f"d{pos}"]) transition_rows.append(row) pairs = pd.DataFrame(transition_rows) def transition_freq(pos, prize_idx, prev_digit): """Distribusi digit target berdasarkan digit posisi sebelumnya.""" if len(pairs) == 0: return np.ones(10) / 10, 0 sub = pairs[(pairs["prize_idx"] == prize_idx) & (pairs[f"prev_d{pos}"] == prev_digit)] if len(sub) < 8: sub = pairs[pairs[f"prev_d{pos}"] == prev_digit] if len(sub) < 8: sub = pairs[pairs["prize_idx"] == prize_idx] if len(sub) == 0: return np.ones(10) / 10, 0 counts = np.zeros(10) for val in sub[f"target_d{pos}"].values: counts[int(val)] += 1 return normalize(counts + 0.5), len(sub) # Bobot bisa kamu ubah. WEIGHTS = { "recent_all": 0.30, # tren terbaru semua jam "target_time": 0.30, # tren khusus jam target "transition": 0.25, # transisi dari jam terakhir ke jam target "overdue": 0.15 # paito warna/absen } last_all = df.tail(min(300, len(df))) target_time_rows = df[df["time"] == target_time].tail(min(180, len(df[df["time"] == target_time]))) def score_for_prize(prize_idx): pos_scores = [] comp_notes = [] current_row = latest_block[latest_block["prize_idx"] == prize_idx] if len(current_row) == 0: # fallback: pakai baris terakhir jika prize index tidak ada current_row = latest_block.tail(1) current_row = current_row.iloc[0] for pos in range(4): recent_freq = exp_weighted_pos_freq(last_all, pos, half_life=150) target_freq = exp_weighted_pos_freq(target_time_rows, pos, half_life=500) prev_digit = int(current_row[f"d{pos}"]) trans_freq, sample_n = transition_freq(pos, prize_idx, prev_digit) score = ( WEIGHTS["recent_all"] * recent_freq + WEIGHTS["target_time"] * target_freq + WEIGHTS["transition"] * trans_freq + WEIGHTS["overdue"] * overdue_score ) pos_scores.append(normalize(score)) comp_notes.append((prev_digit, sample_n)) return pos_scores, comp_notes def top_combinations(pos_scores, top_per_pos=6, n=15): top_digits = [ sorted(digits, key=lambda d: -pos_scores[pos][d])[:top_per_pos] for pos in range(4) ] combos = [] for combo in product(*top_digits): score = sum(math.log(pos_scores[pos][d] + 1e-12) for pos, d in enumerate(combo)) # Bonus kecil bila kombinasi mengandung digit yang absen di blok terakhir score += 0.04 * sum(1 for d in set(combo) if d in latest_absent) combos.append(("".join(map(str, combo)), score)) combos.sort(key=lambda x: -x[1]) return combos[:n], top_digits # --- 6) Hasil prediksi --- all_scores_by_prize = {} print("\n=== RINGKASAN PAITO WARNA / ABSEN ===") summary = pd.DataFrame({ "digit": digits, "absen_streak_baris": [streak[d] for d in digits], f"missing_rate_{recent_n}_baris_%": [round(missing_rate[d] * 100, 1) for d in digits], "overdue_score": [round(float(overdue_score[d]), 4) for d in digits], }).sort_values(["overdue_score"], ascending=False) print(summary.to_string(index=False)) print("\n=== PREDIKSI PER POSISI ===") pos_names = ["AS/Ribuan", "KOP/Ratusan", "KEPALA/Puluhan", "EKOR/Satuan"] for prize_idx in sorted(latest_block["prize_idx"].unique()): pos_scores, notes = score_for_prize(int(prize_idx)) all_scores_by_prize[int(prize_idx)] = pos_scores print(f"\nPrize {int(prize_idx)}:") for pos, score in enumerate(pos_scores): top5 = sorted([(d, float(score[d])) for d in digits], key=lambda x: -x[1])[:5] top5_txt = ", ".join([f"{d}({s:.3f})" for d, s in top5]) prev_digit, sample_n = notes[pos] print(f" {pos_names[pos]} | digit sebelumnya {prev_digit} | sampel transisi {sample_n}: {top5_txt}") combos, top_digits = top_combinations(pos_scores, top_per_pos=5, n=10) print(" Kandidat 4D:", ", ".join([c for c, _ in combos])) # Kombinasi gabungan dari seluruh prize index combined_scores = [] for pos in range(4): s = np.zeros(10) for prize_idx in all_scores_by_prize: s += all_scores_by_prize[prize_idx][pos] combined_scores.append(normalize(s)) combined_combos, combined_top_digits = top_combinations(combined_scores, top_per_pos=6, n=20) digit_strength = np.zeros(10) for pos in range(4): digit_strength += combined_scores[pos] bbfs_rank = sorted([(d, float(digit_strength[d])) for d in digits], key=lambda x: -x[1]) print("\n=== REKOMENDASI GABUNGAN ===") print("BBFS 8 digit:", "-".join(str(d) for d, _ in bbfs_rank[:8])) print("BBFS 7 digit:", "-".join(str(d) for d, _ in bbfs_rank[:7])) print("Top posisi gabungan:") for pos, topd in enumerate(combined_top_digits): print(f" {pos_names[pos]}: {topd}") print("\nKandidat 4D gabungan:") print(", ".join([c for c, _ in combined_combos[:20]])) # Top 2D belakang berdasarkan posisi puluhan+satuan pair_scores = [] for a, b in product(digits, digits): s = combined_scores[2][a] * combined_scores[3][b] pair_scores.append((f"{a}{b}", float(s))) pair_scores.sort(key=lambda x: -x[1]) print("\nTop 2D belakang:") print(", ".join([p for p, _ in pair_scores[:20]])) print("\nCatatan: prediksi ini memakai pola historis/warna/absen. Untuk data acak seperti undian, hasil aktual tetap tidak bisa dijamin.") ''' py_path = Path('/mnt/data/paito_prediksi_colab.py') py_path.write_text(script, encoding='utf-8') # Make an .ipynb with markdown + one code cell nb = { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Prediksi Paito Warna 4D\n", "\n", "Upload `PRIZE.txt`, lalu jalankan cell kode di bawah. Hasil adalah analisis statistik/pola historis, bukan jaminan." ], }, { "cell_type": "code", "execution_count": None, "metadata": {}, "outputs": [], "source": script.splitlines(True), }, ], "metadata": { "kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"name": "python", "pygments_lexer": "ipython3"}, "colab": {"name": "paito_prediksi_colab.ipynb"}, }, "nbformat": 4, "nbformat_minor": 5, } ipynb_path = Path('/mnt/data/paito_prediksi_colab.ipynb') ipynb_path.write_text(json.dumps(nb, ensure_ascii=False, indent=2), encoding='utf-8') print(f"Created: {py_path}") print(f"Created: {ipynb_path}")

回答

Saya pakai data dari PRIZE.txt; formatnya berisi hasil 4D per tanggal/jam, dan angka di kanan saya perlakukan sebagai digit absen/warna dari angka 4D tersebut. Ada beberapa baris warna yang tidak konsisten, jadi prediksi dan script saya hitung ulang dari angka 4D-nya. (PRIZE.txt)

Asumsi target prediksi: data terakhir adalah 07 Juni 2026 06:30, jadi target berikutnya saya anggap 07 Juni 2026 11:30.

Prediksi paito warna / absen

Digit absen kuat dari blok terakhir: 1, 6
BBFS 8D: 1-0-9-7-6-5-4-8
BBFS 7D: 1-0-9-7-6-5-4

Posisi kuat:

PosisiDigit rekomendasi
AS / Ribuan7, 1, 5, 4, 0, 9
KOP / Ratusan6, 1, 9, 0, 8, 5
KEPALA / Puluhan9, 0, 8, 5, 2, 6
EKOR / Satuan1, 7, 4, 0, 8, 3

Kandidat 4D gabungan teratas:

7691, 7601, 7681, 7651, 1691, 5691, 7621, 7191, 4691, 7991

Kandidat per prize:

PrizeKandidat
Prize 15191, 5151, 5197, 5157, 5101
Prize 27901, 4901, 7601, 7991, 7701
Prize 37081, 7681, 0081, 0681, 9081

2D belakang kuat:
91, 01, 81, 51, 21, 61, 41, 71, 11, 97

Catatan: ini hanya analisis pola historis/paito warna, bukan kepastian hasil undian.

Script Colab sudah saya buat:

[Download notebook Colab (.ipynb)]
Download script Python (.py)

分享这个问答