Prediksi untuk hasil selanjutnya fokus TOP 100 4D ...

생성일: 2026년 5월 30일

답변에 사용된 모델 GPT-5.5 Thinking by Chat01

질문

data_ekstraksi.json

Prediksi untuk hasil selanjutnya fokus TOP 100 4D terkuat dan buatkan scriptnya untuk di jalankan di google colab

Python

python
import json, os, re, math, statistics, itertools, collections, textwrap, pandas as pd, numpy as np path='/mnt/data/data_ekstraksi.json' print(os.path.exists(path), os.path.getsize(path)) with open(path,'r',encoding='utf-8') as f: data=json.load(f) type(data), len(data), data[0].keys(), data[-1].keys() (list, 645, dict_keys(['tanggal', 'waktu', 'daftar_prize']), dict_keys(['tanggal', 'waktu', 'daftar_prize']))

Python

python
from datetime import datetime 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 } def parse_dt(tanggal,waktu): # e.g. "10 Februari 2026", "03:30" parts=tanggal.split() day=int(parts[0]); mon=months[parts[1]]; year=int(parts[2]) hh,mm=map(int,waktu.split(':')) return datetime(year,mon,day,hh,mm) rows=[] for i,draw in enumerate(data): dt=parse_dt(draw['tanggal'], draw['waktu']) for prize_idx,p in enumerate(draw['daftar_prize'], start=1): code=str(p['kode']).zfill(4) rows.append({'draw_idx':i,'dt':dt,'tanggal':draw['tanggal'],'waktu':draw['waktu'], 'prize_idx':prize_idx,'kode':code,'angka':p ((8385, 7), Timestamp('2026-02-10 21:30:00'), Timestamp('2026-05-30 06:30:00'), draw_idx dt ... kode angka 0 0 2026-02-10 21:30:00 ... 6112 [0, 3, 4, 5, 7, 8, 9] 1 0 2026-02-10 21:30:00 ... 0236 [1, 4, 5, 7, 8, 9] 2 0 2026-02-10 21:30:00 ... 7341 [0, 2, 5, 6, 8, 9] 3 0 2026-02-10 21:30:00 ... 5278 [0, 1, 3, 4, 6, 9] 4 0 2026-02-10 21:30:00 ... 3328 [0, 1, 4, 5, 6, 7, 9] [5 rows x 7 columns], draw_idx dt ... kode angka 8380 644 2026-05-30 06:30:00 ... 3955 [0, 1, 2, 4, 6, 7, 8] 8381 644 2026-05-30 06:30:00 ... 7657 [0, 1, 2, 3, 4, 8, 9] 8382 644 2026-05-30 06:30:00 ... 4269 [0, 1, 3, 5, 7, 8] 8383 644 2026-05-30 06:30:00 ... 1604 [2, 3, 5, 7, 8, 9] 8384 644 2026-05-30 06:30:00 ... 1555 [0, 2, 3, 4, 6, 7, 8, 9] [5 rows x 7 columns])

Python

python
from collections import Counter, defaultdict import itertools, math, numpy as np, pandas as pd, json, os, re # Prepare chronological df already computed df = df.sort_values(['dt','prize_idx']).reset_index(drop=True) N=len(df) latest_dt=df['dt'].max() latest_time=latest_dt.strftime('%H:%M') slots=sorted(df['waktu'].unique(), key=lambda s: tuple(map(int,s.split(':')))) slots, latest_time (['03:30', '06:30', '11:30', '13:30', '17:30', '21:30'], '06:30')

Python

python
slot_order=slots idx=slot_order.index(latest_time) target_slot=slot_order[(idx+1)%len(slot_order)] target_slot '11:30'

Python

python
def build_scores(df, target_slot=None, half_life=1800, alpha_pos=1.0, alpha_pair=1.0, alpha_triple=0.5): df = df.copy().reset_index(drop=True) n=len(df) # Recency exponential weights. Prize index slightly favors top entries. idx=np.arange(n) w=np.exp(-(n-1-idx)/half_life) prize_weight = 1.0 + np.where(df['prize_idx'].values==1, 0.15, 0.0) + np.where(df['prize_idx'].values<=3, 0.05, 0.0) w = w * prize_weight df['w']=w total_w=w.sum() # counts pos_counts=[defaultdict(float) for _ in range(4)] pair_pos=list(itertools.combinations(range(4),2)) pair_counts={p:defaultdict(float) for p in pair_pos} trip_pos=list(itertools.combinations(range(4),3)) trip_counts={p:defaultdict(float) for p in trip_pos} exact_counts=defaultdict(float) exact_all=Counter ({'target_slot': '11:30', 'latest_dt': Timestamp('2026-05-30 06:30:00'), 'n_codes': 8385, 'n_sessions': 645, 'slot_df_n': 1404}, kode pos_log pair_log ... score_raw score rank 0 4517 -8.928317 -26.165886 ... 2.347384 100.000000 1 1 4557 -9.052172 -26.187303 ... 2.316335 99.322212 2 2 7517 -9.005461 -26.178574 ... 2.247519 97.819982 3 3 4577 -8.915455 -26.303618 ... 2.233427 97.512364 4 4 4519 -8.968486 -26.161446 ... 2.069681 93.937846 5 5 7557 -9.129316 -26.135209 ... 2.061363 93.756269 6 6 7514 -8.986770 -26.395456 ... 2.001419 92.447716 7 7 6217 -8.912416 -26.352285 ... 1.990602 92.211571 8 8 6219 -8.952585 -26.253026 ... 1.954479 91.423031 9 9 4579 -8.955624 -26.558138 ... 1.937342 91.048937 10 10 4527 -9.066826 -26.101153 ... 1.931053 90.911645 11 11 4574 -8.896764 -26.882933 ... 1.910591 90.464974 12 12 6276 -8.959715 -26.129218 ... 1.853314 89.214623 13 13 1294 -8.948945 -26.504699 ... 1.841086 88.947700 14 14 4507 -9.055434 -26.369606 ... 1.836491 88.847386 15 15 9517 -9.012207 -26.514346 ... 1.816874 88.419173 16 16 4677 -8.941151 -26.621974 ... 1.816705 88.415467 17 17 6294 -8.923566 -26.744381 ... 1.812730 88.328692 18 18 8294 -9.036419 -26.461898 ... 1.809648 88.261429 19 19 6214 -8.893725 -26.717868 ... 1.804959 88.159070 20 [20 rows x 19 columns])

Python

python
top100 = score_df.head(100)[['rank','kode','score','freq','wfreq']] # Print grouped for i in range(0,100,10): print(f"{i+1:02d}-{i+10:03d}: " + " ".join(f"{int(r.rank):02d}.{r.kode}" for r in top100.iloc[i:i+10].itertuples())) top100.head(100).to_string(index=False) ' rank kode score freq wfreq\n 1 4517 100.000000 5 1.183601\n 2 4557 99.322212 4 1.666213\n 3 7517 97.819982 2 1.342655\n 4 4577 97.512364 3 0.568504\n 5 4519 93.937846 2 0.832096\n 6 7557 93.756269 3 0.749794\n 7 7514 92.447716 2 0.995542\n 8 6217 92.211571 2 0.143948\n 9 6219 91.423031 1 1.069639\n 10 4579 91.048937 2 0.967583\n 11 4527 90.911645 2 0.882342\n 12 4574 90.464974 3 0.868783\n 13 6276 89.214623 2 1.349919\n 14 1294 88.947700 3 0.401179\n 15 4507 88.847386 4 0.297183\n 16 9517 88.419173 1 0.127667\n 17 4677 88.415467 3 0.846770\n 18 6294 88.328692 0 0.000000\n 19 8294 88.261429 5 1.604062\n 20 6214 88.159070 1 0.854989\n 21 6297 88.092387 4 1.263014\n 22 4217 87.621065 1 0.067580\n 23 2517 87.422021 2 1.282071\n 24 4514 87.383253 0 0.000000\n 25 7519 87.372546 2 0.818983\n 26 1574 87.161633 2 1.034328\n 27 6279 86.827403 1 0.877521\n 28 6277 86.765745 0 0.000000\n 29 6577 86.261660 0 0.000000\n 30 4576 86.187542 1 0.943766\n 31 4819 85.893036 2 1.702206\n 32 4573 85.853962 1 0.552176\n 33 0297 85.852044 2 0.542274\n 34 0514 85.753500 2 0.658056\n 35 0194 85.635532 1 0.112603\n 36 0577 85.618663 1 0.642607\n 37 4587 85.595469 0 0.000000\n 38 4817 85.549515 3 0.979465\n 39 9576 85.493423 2 1.477267\n 40 2294 85.425107 3 0.879908\n 41 6677 85.399230 1 0.019373\n 42 6077 85.339395 1 0.333579\n 43 7217 85.178844 1 0.126467\n 44 2217 85.151410 1 0.463785\n 45 4219 85.123844 1 0.288742\n 46 7577 85.072094 2 0.461943\n 47 4627 85.036179 2 0.060462\n 48 6579 84.992424 2 1.049031\n 49 0557 84.947085 1 0.056385\n 50 8214 84.893283 2 0.917272\n 51 0527 84.596173 1 1.021235\n 52 1514 84.511443 2 1.482891\n 53 7614 84.468742 2 1.187653\n 54 0294 84.329667 0 0.000000\n 55 4794 84.275068 1 0.466369\n 56 4714 83.993272 1 0.371746\n 57 4287 83.897872 2 0.891483\n 58 4297 83.779531 1 0.310367\n 59 0584 83.765794 2 0.037761\n 60 0517 83.673564 0 0.000000\n 61 6517 83.632817 0 0.000000\n 62 6213 83.628978 1 0.889388\n 63 6299 83.620422 2 0.514367\n 64 4697 83.575581 1 0.758307\n 65 5276 83.574659 1 0.268597\n 66 9557 83.400833 2 1.617476\n 67 0676 83.368958 4 0.418312\n 68 4571 83.272733 2 0.209692\n 69 0677 83.234463 1 0.396713\n 70 4617 83.136881 0 0.000000\n 71 2194 83.091757 3 0.835618\n 72 6284 83.090699 5 1.355215\n 73 7554 83.058584 2 0.189691\n 74 0574 83.037446 0 0.000000\n 75 7214 82.973422 2 0.166800\n 76 2557 82.963568 3 0.947949\n 77 9514 82.918058 1 0.900825\n 78 4674 82.888667 0 0.000000\n 79 2519 82.793767 4 0.843566\n 80 0524 82.767410 4 2.053303\n 81 7694 82.748278 2 0.693982\n 82 6274 82.741742 0 0.000000\n 83 4694 82.701871 0 0.000000\n 84 1594 82.690831 2 1.003157\n 85 6074 82.659390 3 0.967899\n 86 1694 82.658444 2 0.254526\n 87 9507 82.654726 4 1.426815\n 88 2219 82.602708 1 0.020893\n 89 8194 82.602657 2 0.468757\n 90 0576 82.542087 3 0.252820\n 91 4614 82.528731 2 0.666168\n 92 5217 82.524801 2 0.048190\n 93 9217 82.394863 2 1.500414\n 94 4227 82.388357 1 0.614672\n 95 6017 82.336341 1 0.874687\n 96 8276 82.304113 4 1.561438\n 97 7017 82.298294 1 0.221011\n 98 6178 82.201751 2 1.162467\n 99 4774 82.160271 0 0.000000\n 100 6271 82.046740 0 0.000000'

사고

Ensuring clarity and safety in output

I’m thinking about checking exact frequencies for the top codes and possibly including "terkuat" ones or unseen combos. It’s okay to present predictions without exact lines. I want to clearly mention the data source from the file with a citation. I also need to make sure the script is informative without encouraging misuse.

Thought for 1m 28s

답변

Saya olah dari file data_ekstraksi.json: ada data tanggal, waktu, dan daftar_prize berisi kode 4D. Data terakhir yang terbaca adalah 30 Mei 2026 06:30, jadi fokus “hasil selanjutnya” saya arahkan ke slot 11:30. Ini analisis pola statistik, bukan jaminan hasil undian. (data_ekstraksi.json)

TOP 100 4D terkuat

text
01.4517 02.4557 03.7517 04.4577 05.4519 06.7557 07.7514 08.6217 09.6219 10.4579 11.4527 12.4574 13.6276 14.1294 15.4507 16.9517 17.4677 18.6294 19.8294 20.6214 21.6297 22.4217 23.2517 24.4514 25.7519 26.1574 27.6279 28.6277 29.6577 30.4576 31.4819 32.4573 33.0297 34.0514 35.0194 36.0577 37.4587 38.4817 39.9576 40.2294 41.6677 42.6077 43.7217 44.2217 45.4219 46.7577 47.4627 48.6579 49.0557 50.8214 51.0527 52.1514 53.7614 54.0294 55.4794 56.4714 57.4287 58.4297 59.0584 60.0517 61.6517 62.6213 63.6299 64.4697 65.5276 66.9557 67.0676 68.4571 69.0677 70.4617 71.2194 72.6284 73.7554 74.0574 75.7214 76.2557 77.9514 78.4674 79.2519 80.0524 81.7694 82.6274 83.4694 84.1594 85.6074 86.1694 87.9507 88.2219 89.8194 90.0576 91.4614 92.5217 93.9217 94.4227 95.6017 96.8276 97.7017 98.6178 99.4774 100.6271

Script Google Colab

Tempel script ini di Colab, lalu upload data_ekstraksi.json.

python
# ========================= # PREDIKSI TOP 100 4D # Google Colab Script # ========================= import json import math import itertools from collections import Counter, defaultdict from datetime import datetime import numpy as np import pandas as pd # 1) Upload file JSON try: from google.colab import files uploaded = files.upload() FILE_PATH = list(uploaded.keys())[0] except Exception: # Kalau jalan lokal, ganti path ini sesuai lokasi file FILE_PATH = "data_ekstraksi.json" # 2) Baca data with open(FILE_PATH, "r", encoding="utf-8") as f: data = json.load(f) bulan_map = { "Januari": 1, "Februari": 2, "Maret": 3, "April": 4, "Mei": 5, "Juni": 6, "Juli": 7, "Agustus": 8, "September": 9, "Oktober": 10, "November": 11, "Desember": 12 } def parse_dt(tanggal, waktu): # contoh tanggal: "10 Februari 2026" d, b, y = tanggal.split() hh, mm = waktu.split(":") return datetime(int(y), bulan_map[b], int(d), int(hh), int(mm)) # 3) Flatten data menjadi baris kode rows = [] for draw_idx, item in enumerate(data): dt = parse_dt(item["tanggal"], item["waktu"]) for prize_idx, prize in enumerate(item["daftar_prize"], start=1): kode = str(prize["kode"]).zfill(4) rows.append({ "draw_idx": draw_idx, "dt": dt, "tanggal": item["tanggal"], "waktu": item["waktu"], "prize_idx": prize_idx, "kode": kode }) df = pd.DataFrame(rows).sort_values(["dt", "prize_idx"]).reset_index(drop=True) # 4) Tentukan slot hasil selanjutnya slots = sorted(df["waktu"].unique(), key=lambda s: tuple(map(int, s.split(":")))) latest_dt = df["dt"].max() latest_time = latest_dt.strftime("%H:%M") if latest_time in slots: target_slot = slots[(slots.index(latest_time) + 1) % len(slots)] else: target_slot = None print("Total sesi:", df["draw_idx"].nunique()) print("Total kode:", len(df)) print("Data terakhir:", latest_dt) print("Target slot berikutnya:", target_slot) # 5) Fungsi scoring def build_top100(df, target_slot=None, half_life=1800): df = df.copy().reset_index(drop=True) n = len(df) # Bobot recency: data terbaru lebih kuat idx = np.arange(n) w = np.exp(-(n - 1 - idx) / half_life) # Sedikit bobot tambahan untuk prize awal prize_weight = ( 1.0 + np.where(df["prize_idx"].values == 1, 0.15, 0.0) + np.where(df["prize_idx"].values <= 3, 0.05, 0.0) ) w = w * prize_weight df["w"] = w total_w = df["w"].sum() pos_counts = [defaultdict(float) for _ in range(4)] pair_pos = list(itertools.combinations(range(4), 2)) triple_pos = list(itertools.combinations(range(4), 3)) pair_counts = {p: defaultdict(float) for p in pair_pos} triple_counts = {p: defaultdict(float) for p in triple_pos} exact_weighted = defaultdict(float) exact_plain = Counter(df["kode"]) for kode, wt in zip(df["kode"], df["w"]): exact_weighted[kode] += wt for i, d in enumerate(kode): pos_counts[i][d] += wt for p in pair_pos: key = "".join(kode[i] for i in p) pair_counts[p][key] += wt for p in triple_pos: key = "".join(kode[i] for i in p) triple_counts[p][key] += wt # Slot khusus, misalnya 11:30 slot_df = df[df["waktu"] == target_slot].copy() if target_slot else df.iloc[0:0].copy() total_sw = slot_df["w"].sum() if len(slot_df) else 0 slot_pos_counts = [defaultdict(float) for _ in range(4)] slot_pair_counts = {p: defaultdict(float) for p in pair_pos} for kode, wt in zip(slot_df["kode"], slot_df["w"]): for i, d in enumerate(kode): slot_pos_counts[i][d] += wt for p in pair_pos: key = "".join(kode[i] for i in p) slot_pair_counts[p][key] += wt alpha_pos = 1.0 alpha_pair = 1.0 alpha_triple = 0.5 exact_max = max(exact_weighted.values()) if exact_weighted else 1 plain_max = max(exact_plain.values()) if exact_plain else 1 result = [] for num in range(10000): kode = f"{num:04d}" # Skor posisi digit pos_log = 0.0 for i, d in enumerate(kode): pos_log += math.log( (pos_counts[i].get(d, 0) + alpha_pos) / (total_w + 10 * alpha_pos) ) # Skor pasangan posisi pair_log = 0.0 for p in pair_pos: key = "".join(kode[i] for i in p) pair_log += math.log( (pair_counts[p].get(key, 0) + alpha_pair) / (total_w + 100 * alpha_pair) ) # Skor triple posisi triple_log = 0.0 for p in triple_pos: key = "".join(kode[i] for i in p) triple_log += math.log( (triple_counts[p].get(key, 0) + alpha_triple) / (total_w + 1000 * alpha_triple) ) # Skor khusus slot berikutnya slot_log = 0.0 if total_sw > 0: for i, d in enumerate(kode): slot_log += math.log( (slot_pos_counts[i].get(d, 0) + alpha_pos) / (total_sw + 10 * alpha_pos) ) for p in pair_pos: key = "".join(kode[i] for i in p) slot_log += 0.65 * math.log( (slot_pair_counts[p].get(key, 0) + alpha_pair) / (total_sw + 100 * alpha_pair) ) exact_recency = math.log1p(exact_weighted.get(kode, 0)) / math.log1p(exact_max) exact_freq = exact_plain.get(kode, 0) / plain_max result.append({ "kode": kode, "pos_log": pos_log, "pair_log": pair_log, "triple_log": triple_log, "slot_log": slot_log, "freq": exact_plain.get(kode, 0), "weighted_freq": exact_weighted.get(kode, 0), "exact_recency": exact_recency, "exact_freq": exact_freq }) score_df = pd.DataFrame(result) # Normalisasi z-score for col in ["pos_log", "pair_log", "triple_log", "slot_log"]: std = score_df[col].std() if std == 0: std = 1 score_df[col + "_z"] = (score_df[col] - score_df[col].mean()) / std # Bobot final score_df["score_raw"] = ( 0.27 * score_df["pos_log_z"] + 0.26 * score_df["pair_log_z"] + 0.12 * score_df["triple_log_z"] + 0.16 * score_df["slot_log_z"] + 0.12 * score_df["exact_recency"] + 0.07 * score_df["exact_freq"] ) # Skala 0-100 mn = score_df["score_raw"].min() mx = score_df["score_raw"].max() score_df["score"] = (score_df["score_raw"] - mn) / (mx - mn) * 100 score_df = score_df.sort_values("score", ascending=False).reset_index(drop=True) score_df["rank"] = np.arange(1, len(score_df) + 1) return score_df[[ "rank", "kode", "score", "freq", "weighted_freq", "exact_recency", "exact_freq" ]].head(100) # 6) Jalankan prediksi top100 = build_top100(df, target_slot=target_slot) pd.set_option("display.max_rows", 120) print("\nTOP 100 4D TERKUAT:") display(top100) # 7) Simpan hasil ke CSV output_file = "top100_prediksi_4d.csv" top100.to_csv(output_file, index=False) print("File tersimpan:", output_file) try: files.download(output_file) except Exception: pass

Model ini menggabungkan frekuensi kode, bobot data terbaru, pola digit per posisi, pola pasangan/triple digit, dan pola khusus slot 11:30.

이 Q&A 공유하기