jialinzhang commited on
Commit
f3a970f
·
1 Parent(s): cf3c1db

Add syntheticSuccess c18

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +2 -0
  2. syntheticSuccess/c18/arf/arf-c18-20260422_055912/_arf_generate.py +23 -0
  3. syntheticSuccess/c18/arf/arf-c18-20260422_055912/_arf_train.py +37 -0
  4. syntheticSuccess/c18/arf/arf-c18-20260422_055912/arf-c18-103976-20260422_073913.csv +3 -0
  5. syntheticSuccess/c18/arf/arf-c18-20260422_055912/arf_model.pkl +3 -0
  6. syntheticSuccess/c18/arf/arf-c18-20260422_055912/gen_20260422_073913.log +3 -0
  7. syntheticSuccess/c18/arf/arf-c18-20260422_055912/input_snapshot.json +3 -0
  8. syntheticSuccess/c18/arf/arf-c18-20260422_055912/public_gate/normalized_schema_snapshot.json +3 -0
  9. syntheticSuccess/c18/arf/arf-c18-20260422_055912/public_gate/public_gate_report.json +3 -0
  10. syntheticSuccess/c18/arf/arf-c18-20260422_055912/public_gate/staged_input_manifest.json +3 -0
  11. syntheticSuccess/c18/arf/arf-c18-20260422_055912/runtime_result.json +3 -0
  12. syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/arf/adapter_report.json +3 -0
  13. syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/arf/adapter_transforms_applied.json +3 -0
  14. syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/arf/model_input_manifest.json +3 -0
  15. syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/public/staged_features.json +3 -0
  16. syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/public/test.csv +3 -0
  17. syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/public/train.csv +3 -0
  18. syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/public/val.csv +3 -0
  19. syntheticSuccess/c18/arf/arf-c18-20260422_055912/train_20260422_055923.log +3 -0
  20. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/_bayesnet_generate.py +105 -0
  21. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/_bayesnet_train.py +133 -0
  22. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet-c18-103976-20260422_192851.csv +3 -0
  23. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet_coltypes.json +3 -0
  24. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet_model.pkl +3 -0
  25. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/const_cols.json +3 -0
  26. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/gen_20260422_192851.log +3 -0
  27. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/input_snapshot.json +3 -0
  28. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/public_gate/normalized_schema_snapshot.json +3 -0
  29. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/public_gate/public_gate_report.json +3 -0
  30. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/public_gate/staged_input_manifest.json +3 -0
  31. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/runtime_result.json +3 -0
  32. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/bayesnet/adapter_report.json +3 -0
  33. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/bayesnet/adapter_transforms_applied.json +3 -0
  34. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/bayesnet/model_input_manifest.json +3 -0
  35. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/public/staged_features.json +3 -0
  36. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/public/test.csv +3 -0
  37. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/public/train.csv +3 -0
  38. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/public/val.csv +3 -0
  39. syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/train_20260422_192821.log +3 -0
  40. syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/gen_20260425_084947.log +3 -0
  41. syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/input_snapshot.json +3 -0
  42. syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/models_100epochs/id000017770781809035876352/rtf_config.json +3 -0
  43. syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/models_100epochs/id000017770781809035876352/rtf_model.pt +3 -0
  44. syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/public_gate/normalized_schema_snapshot.json +3 -0
  45. syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/public_gate/public_gate_report.json +3 -0
  46. syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/public_gate/staged_input_manifest.json +3 -0
  47. syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/realtabformer_features.json +3 -0
  48. syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/rtf-c18-103976-20260425_084947.csv +3 -0
  49. syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/rtf_checkpoints/checkpoint-324500/config.json +3 -0
  50. syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/rtf_checkpoints/checkpoint-324500/generation_config.json +3 -0
.gitattributes CHANGED
@@ -60,3 +60,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
  *.csv filter=lfs diff=lfs merge=lfs -text
62
  *.log filter=lfs diff=lfs merge=lfs -text
 
 
 
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
  *.csv filter=lfs diff=lfs merge=lfs -text
62
  *.log filter=lfs diff=lfs merge=lfs -text
63
+ *.toml filter=lfs diff=lfs merge=lfs -text
64
+ *.json filter=lfs diff=lfs merge=lfs -text
syntheticSuccess/c18/arf/arf-c18-20260422_055912/_arf_generate.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pickle
2
+ import pandas as pd
3
+
4
+ n_target = int(103976)
5
+ with open("/work/output-SpecializedModels/c18/arf/arf-c18-20260422_055912/arf_model.pkl", "rb") as f:
6
+ model = pickle.load(f)
7
+ syn = model.forge(n=n_target)
8
+ syn = syn.reset_index(drop=True)
9
+ if len(syn) > n_target:
10
+ syn = syn.iloc[:n_target]
11
+ elif len(syn) < n_target:
12
+ parts = [syn]
13
+ tries = 0
14
+ while sum(len(p) for p in parts) < n_target and tries < 64:
15
+ tries += 1
16
+ need = n_target - sum(len(p) for p in parts)
17
+ chunk = model.forge(n=max(need, 1)).reset_index(drop=True)
18
+ if len(chunk) == 0:
19
+ break
20
+ parts.append(chunk)
21
+ syn = pd.concat(parts, ignore_index=True).iloc[:n_target]
22
+ syn.to_csv("/work/output-SpecializedModels/c18/arf/arf-c18-20260422_055912/arf-c18-103976-20260422_073913.csv", index=False)
23
+ print(f"[ARF] Generated {len(syn)} rows (requested {n_target}) -> /work/output-SpecializedModels/c18/arf/arf-c18-20260422_055912/arf-c18-103976-20260422_073913.csv")
syntheticSuccess/c18/arf/arf-c18-20260422_055912/_arf_train.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pickle
2
+ import numpy as np
3
+ import pandas as pd
4
+ from arfpy import arf
5
+
6
+ def _sanitize_for_arf(df: pd.DataFrame) -> pd.DataFrame:
7
+ """缓解 forge 阶段 scipy.stats.truncnorm / 除零:处理 inf、NaN 与极端尾部。"""
8
+ df = df.replace([np.inf, -np.inf], np.nan)
9
+ df = df.dropna(axis=1, how="all")
10
+ for col in df.select_dtypes(include=[np.number]).columns:
11
+ med = df[col].median()
12
+ if pd.isna(med):
13
+ med = 0.0
14
+ df[col] = df[col].fillna(med)
15
+ nu = int(df[col].nunique(dropna=True))
16
+ if nu <= 1:
17
+ continue
18
+ lo, hi = df[col].quantile(0.001), df[col].quantile(0.999)
19
+ if pd.notna(lo) and pd.notna(hi) and lo < hi:
20
+ df[col] = df[col].clip(lo, hi)
21
+ return df
22
+
23
+ df = pd.read_csv("/work/output-SpecializedModels/c18/arf/arf-c18-20260422_055912/staged/public/train.csv")
24
+ df = _sanitize_for_arf(df)
25
+ print(f"[ARF] Training on {len(df)} rows, {len(df.columns)} cols")
26
+
27
+ model = arf.arf(x=df)
28
+ if hasattr(model, "fit"):
29
+ model.fit()
30
+ elif hasattr(model, "forde"):
31
+ model.forde()
32
+ else:
33
+ raise RuntimeError("arfpy API: no fit() / forde()")
34
+
35
+ with open("/work/output-SpecializedModels/c18/arf/arf-c18-20260422_055912/arf_model.pkl", "wb") as f:
36
+ pickle.dump(model, f)
37
+ print(f"[ARF] Model saved -> /work/output-SpecializedModels/c18/arf/arf-c18-20260422_055912/arf_model.pkl")
syntheticSuccess/c18/arf/arf-c18-20260422_055912/arf-c18-103976-20260422_073913.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:efd9a936e0a6c2ceb8a2e5b81a75fa2a08274bbff98501c02e20418a0d12993f
3
+ size 46496248
syntheticSuccess/c18/arf/arf-c18-20260422_055912/arf_model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fd1cdc08e24aebcd8a88b5b2389635d905871aa66aae9e6703866890a279836
3
+ size 1193005953
syntheticSuccess/c18/arf/arf-c18-20260422_055912/gen_20260422_073913.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d78d0b88b9b6251fd3d55a1bb085865159dd2b3c120e56b7a045dc53a8bc38c1
3
+ size 3624
syntheticSuccess/c18/arf/arf-c18-20260422_055912/input_snapshot.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1c10b8cc4ec29f65b5327b5abba22064e170a371bbf0842768a4db88eab0e6d
3
+ size 1359
syntheticSuccess/c18/arf/arf-c18-20260422_055912/public_gate/normalized_schema_snapshot.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca33a02c28873c5ec5fec52da747d206cd9e461100244e401a7a2e5ef3cba096
3
+ size 8391
syntheticSuccess/c18/arf/arf-c18-20260422_055912/public_gate/public_gate_report.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27f1ca3c2a10e936a41ba26048d2f0bc62addbfac55033a559ba761621c8ed22
3
+ size 921
syntheticSuccess/c18/arf/arf-c18-20260422_055912/public_gate/staged_input_manifest.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5326e8dc8c38920650d69a484d1ad0328b0a37a5ec76dc39dae42cf01b199a49
3
+ size 9142
syntheticSuccess/c18/arf/arf-c18-20260422_055912/runtime_result.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:59011ca16f704b0ef3581e3d556dc196ad7da7332da51aca3f2cc03a750d5428
3
+ size 574
syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/arf/adapter_report.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a9b26bdad70e840f578c14cbcf2ba40e38f4124c8f67dda44dd0b15181c55b8
3
+ size 306
syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/arf/adapter_transforms_applied.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945
3
+ size 2
syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/arf/model_input_manifest.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8435b77ec8bc47a4d7cf5f6a6109ea1763384aaa35cf7f0d4fac64df27be8c6
3
+ size 9324
syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/public/staged_features.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:632cd1c583d7dfd3107947bb9a317b8bb4bc567040e03ec88232c59e6f87a161
3
+ size 1350
syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/public/test.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f9b247fe90d1b3de687afbee0871f768b5b9b41d8974110c1a1a4be0a1581258
3
+ size 5283050
syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/public/train.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d36ba8fd95415355fed46a70cd71921339f0b4b8f05320279bef35443ce4cc16
3
+ size 42317177
syntheticSuccess/c18/arf/arf-c18-20260422_055912/staged/public/val.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6368d0c3f97d7449830710d697fc67e7fb71fa7038bc480892279eb41c153f0b
3
+ size 5289617
syntheticSuccess/c18/arf/arf-c18-20260422_055912/train_20260422_055923.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ab14e38c987b32b095b7647c4be6f6bc305a0c75e29ebc58906f8e65381379e
3
+ size 625
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/_bayesnet_generate.py ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import pickle
3
+ import subprocess
4
+ import sys
5
+ import warnings
6
+
7
+ import numpy as np
8
+ import pandas as pd
9
+ from pgmpy.sampling import BayesianModelSampling
10
+
11
+ warnings.filterwarnings("ignore", category=FutureWarning)
12
+
13
+ def _ensure_cloudpickle():
14
+ try:
15
+ import cloudpickle # noqa: F401
16
+ except ModuleNotFoundError:
17
+ subprocess.check_call(
18
+ [sys.executable, "-m", "pip", "install", "--quiet", "cloudpickle"],
19
+ )
20
+
21
+ _ensure_cloudpickle()
22
+
23
+ with open("/work/output-SpecializedModels/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet_model.pkl", "rb") as f:
24
+ bundle = pickle.load(f)
25
+
26
+ network = bundle["network"]
27
+ inverse = bundle["inverse"]
28
+ cols = bundle["column_order"]
29
+ integer_columns = set(bundle.get("integer_columns") or [])
30
+ full_order = bundle.get("full_column_order") or cols
31
+ const_cols = bundle.get("const_cols") or {}
32
+
33
+ num_rows = int(103976)
34
+ sampler = BayesianModelSampling(network)
35
+ raw = sampler.forward_sample(size=num_rows, show_progress=False)
36
+ raw = raw.reset_index(drop=True)
37
+ if len(raw) > num_rows:
38
+ raw = raw.iloc[:num_rows]
39
+ _tries = 0
40
+ while len(raw) < num_rows and _tries < 64:
41
+ _tries += 1
42
+ nextra = min(10000, num_rows - len(raw))
43
+ more = sampler.forward_sample(size=max(nextra, 1), show_progress=False)
44
+ more = more.reset_index(drop=True)
45
+ if len(more) == 0:
46
+ break
47
+ raw = pd.concat([raw, more], ignore_index=True)
48
+ if len(raw) > num_rows:
49
+ raw = raw.iloc[:num_rows]
50
+
51
+ out = pd.DataFrame(index=raw.index)
52
+ rng = np.random.default_rng()
53
+
54
+ for c in cols:
55
+ if c in inverse["categorical"]:
56
+ levels = inverse["categorical"][c]
57
+ idx = raw[c].astype(int).to_numpy()
58
+ idx = np.clip(idx, 0, max(0, len(levels) - 1))
59
+ out[c] = [levels[i] for i in idx]
60
+ else:
61
+ edges = np.asarray(inverse["continuous"][c], dtype=float)
62
+ if edges.size < 2:
63
+ out[c] = 0.0
64
+ else:
65
+ nbin = edges.size - 1
66
+ res = []
67
+ for k in raw[c].astype(int).to_numpy():
68
+ k = int(k)
69
+ if k < 0:
70
+ k = 0
71
+ if k >= nbin:
72
+ k = nbin - 1
73
+ lo, hi = float(edges[k]), float(edges[k + 1])
74
+ if hi < lo:
75
+ lo, hi = hi, lo
76
+ v = rng.uniform(lo, hi)
77
+ if c in integer_columns:
78
+ v = int(round(v))
79
+ res.append(v)
80
+ out[c] = res
81
+
82
+ final = pd.DataFrame(index=out.index)
83
+ for c in full_order:
84
+ if c in const_cols:
85
+ final[c] = const_cols[c]
86
+ elif c in out.columns:
87
+ final[c] = out[c]
88
+
89
+ dtypes = bundle.get("original_dtypes") or {}
90
+ for c, dts in dtypes.items():
91
+ if c not in final.columns:
92
+ continue
93
+ try:
94
+ if "int" in dts:
95
+ final[c] = pd.to_numeric(final[c], errors="coerce").astype("Int64")
96
+ elif "float" in dts:
97
+ final[c] = pd.to_numeric(final[c], errors="coerce")
98
+ except Exception:
99
+ pass
100
+
101
+ if len(final) != num_rows:
102
+ final = final.iloc[:num_rows].copy()
103
+ final = final.reset_index(drop=True)
104
+ final.to_csv("/work/output-SpecializedModels/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet-c18-103976-20260422_192851.csv", index=False)
105
+ print(f"[BayesNet] Generated {len(final)} rows (requested {num_rows}) -> /work/output-SpecializedModels/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet-c18-103976-20260422_192851.csv")
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/_bayesnet_train.py ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import json
3
+ import pickle
4
+ import subprocess
5
+ import sys
6
+ import warnings
7
+
8
+ import numpy as np
9
+ import pandas as pd
10
+ from pgmpy.estimators import TreeSearch
11
+ from pgmpy.models import DiscreteBayesianNetwork
12
+ warnings.filterwarnings("ignore", category=FutureWarning)
13
+
14
+ def _ensure_cloudpickle():
15
+ try:
16
+ import cloudpickle # noqa: F401
17
+ except ModuleNotFoundError:
18
+ subprocess.check_call(
19
+ [sys.executable, "-m", "pip", "install", "--quiet", "cloudpickle"],
20
+ )
21
+
22
+ _ensure_cloudpickle()
23
+
24
+ with open("/work/output-SpecializedModels/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet_coltypes.json", "r", encoding="utf-8") as _f:
25
+ colmeta = json.load(_f)
26
+ integer_columns = set(colmeta.get("integer_columns") or [])
27
+
28
+ df = pd.read_csv("/work/output-SpecializedModels/c18/bayesnet/bayesnet-c18-20260422_192809/staged/public/train.csv")
29
+ df = df.dropna(axis=1, how="all")
30
+ full_column_order = list(df.columns)
31
+
32
+ const_cols = {}
33
+ for col in list(df.columns):
34
+ if df[col].nunique(dropna=True) <= 1:
35
+ const_cols[col] = df[col].iloc[0] if len(df) > 0 else None
36
+ df = df.drop(columns=[col])
37
+ print(f"[BayesNet] Dropped zero-variance column '{col}'")
38
+
39
+ const_path = "/work/output-SpecializedModels/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet_model.pkl".replace("bayesnet_model.pkl", "const_cols.json")
40
+ with open(const_path, "w", encoding="utf-8") as _f:
41
+ json.dump({k: str(v) for k, v in const_cols.items()}, _f)
42
+
43
+ inverse = {"categorical": {}, "continuous": {}}
44
+ enc = pd.DataFrame(index=df.index)
45
+ _n_samples = len(df)
46
+ _n_plan = sum(
47
+ 1 for e in colmeta["columns"] if str(e.get("name", "")) in df.columns
48
+ )
49
+ max_bins = 10
50
+ max_cat_levels = 256
51
+ if _n_plan > 35 or _n_samples > 200000:
52
+ max_bins = 5
53
+ max_cat_levels = 64
54
+ if _n_plan > 55:
55
+ max_bins = 4
56
+ max_cat_levels = 32
57
+ print(
58
+ f"[BayesNet] max_bins={max_bins}, max_cat_levels={max_cat_levels} "
59
+ f"(cols_in_df={_n_plan}, rows={_n_samples})"
60
+ )
61
+
62
+ for entry in colmeta["columns"]:
63
+ name = entry["name"]
64
+ if name not in df.columns:
65
+ continue
66
+ kind = entry["type"]
67
+ s = df[name]
68
+ if kind == "categorical":
69
+ s2 = s.astype(str).fillna("__NA__")
70
+ counts = s2.value_counts(dropna=False)
71
+ if len(counts) > max_cat_levels:
72
+ keep = set(counts.index[: max_cat_levels - 1].tolist())
73
+ s2 = s2.map(lambda x: x if x in keep else "__OTHER__")
74
+ uniques = sorted(s2.dropna().unique(), key=lambda x: str(x))
75
+ mapping = {str(v): i for i, v in enumerate(uniques)}
76
+ inverse["categorical"][name] = [uniques[i] for i in range(len(uniques))]
77
+ enc[name] = s2.map(lambda x, m=mapping: m.get(str(x), 0)).astype(int)
78
+ else:
79
+ s_num = pd.to_numeric(s, errors="coerce")
80
+ nu = int(s_num.nunique(dropna=True))
81
+ q = min(max_bins, max(2, nu))
82
+ if nu < 2:
83
+ enc[name] = np.zeros(len(s_num), dtype=int)
84
+ lo, hi = float(s_num.min()), float(s_num.max())
85
+ inverse["continuous"][name] = [lo, hi]
86
+ else:
87
+ try:
88
+ _, bins = pd.qcut(
89
+ s_num, q=q, retbins=True, duplicates="drop"
90
+ )
91
+ except Exception:
92
+ med = float(s_num.median())
93
+ s2 = s_num.fillna(med)
94
+ _, bins = pd.qcut(
95
+ s2, q=min(q, 3), retbins=True, duplicates="drop"
96
+ )
97
+ bins = np.asarray(bins, dtype=float)
98
+ lab = pd.cut(
99
+ s_num, bins=bins, labels=False, include_lowest=True
100
+ )
101
+ enc[name] = lab.fillna(0).astype(int)
102
+ inverse["continuous"][name] = bins.tolist()
103
+
104
+ print(f"[BayesNet] Training on {len(enc)} rows, {len(enc.columns)} cols (encoded)")
105
+
106
+ enc_struct = enc
107
+ if len(enc) > 25000:
108
+ enc_struct = enc.sample(n=25000, random_state=0, replace=False)
109
+ print(f"[BayesNet] TreeSearch on {len(enc_struct)} rows (subsample; full n={len(enc)})")
110
+ dag = TreeSearch(enc_struct).estimate(show_progress=False)
111
+ for col in enc.columns:
112
+ if col not in dag.nodes():
113
+ dag.add_node(col)
114
+ print(f"[BayesNet] Added isolated node to DAG: {col}")
115
+ network = DiscreteBayesianNetwork(dag)
116
+ enc_fit = enc
117
+ if len(enc) > 120000:
118
+ enc_fit = enc.sample(n=120000, random_state=1, replace=False)
119
+ print(f"[BayesNet] fit() on {len(enc_fit)} rows (full n={len(enc)})")
120
+ network.fit(enc_fit)
121
+
122
+ bundle = {
123
+ "network": network,
124
+ "inverse": inverse,
125
+ "column_order": list(enc.columns),
126
+ "full_column_order": full_column_order,
127
+ "integer_columns": list(integer_columns),
128
+ "original_dtypes": {c: str(df[c].dtype) for c in enc.columns},
129
+ "const_cols": const_cols,
130
+ }
131
+ with open("/work/output-SpecializedModels/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet_model.pkl", "wb") as _f:
132
+ pickle.dump(bundle, _f)
133
+ print(f"[BayesNet] Model saved -> /work/output-SpecializedModels/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet_model.pkl")
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet-c18-103976-20260422_192851.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d974e70f5c3aa91965972c577ce845ff7ea6a3d0f36e53c37d24bfec7386463
3
+ size 17238811
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet_coltypes.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8cda6947a7fcf53749561c0079c94010324f32a400d051ad9dc494f71552c810
3
+ size 989
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/bayesnet_model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e8285ef152901f1195310373b86aa633ed3e0fb68af2808bb4419d55d68a098
3
+ size 3564015
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/const_cols.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
3
+ size 2
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/gen_20260422_192851.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d2434896ab720382c4ae78e684ded2f0da9205ecaba501541abba77bcee11fa
3
+ size 3396
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/input_snapshot.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:17f0c9bffdd9d7a3551a0aec99481a7c0b88aba73d374849730b6c57372e07fb
3
+ size 1364
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/public_gate/normalized_schema_snapshot.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca33a02c28873c5ec5fec52da747d206cd9e461100244e401a7a2e5ef3cba096
3
+ size 8391
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/public_gate/public_gate_report.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27f1ca3c2a10e936a41ba26048d2f0bc62addbfac55033a559ba761621c8ed22
3
+ size 921
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/public_gate/staged_input_manifest.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5682aec53d8dae292824c2456ca9d6c5d80895c34c4a505d8f97ab229ba59422
3
+ size 9192
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/runtime_result.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a296a7ca8db38deabc940e878d77b5c475a3ec7fdb19e4611d1290ac0365bdb6
3
+ size 614
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/bayesnet/adapter_report.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb579c72d5185fd24d7be8806f8ebb105824c580f095aea6acb4e6124f9663de
3
+ size 321
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/bayesnet/adapter_transforms_applied.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945
3
+ size 2
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/bayesnet/model_input_manifest.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57286b97c87f0814ae815a3a964ddd33c3d23b95d9b4df881e09f22a440fc158
3
+ size 9389
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/public/staged_features.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:632cd1c583d7dfd3107947bb9a317b8bb4bc567040e03ec88232c59e6f87a161
3
+ size 1350
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/public/test.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f9b247fe90d1b3de687afbee0871f768b5b9b41d8974110c1a1a4be0a1581258
3
+ size 5283050
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/public/train.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d36ba8fd95415355fed46a70cd71921339f0b4b8f05320279bef35443ce4cc16
3
+ size 42317177
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/staged/public/val.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6368d0c3f97d7449830710d697fc67e7fb71fa7038bc480892279eb41c153f0b
3
+ size 5289617
syntheticSuccess/c18/bayesnet/bayesnet-c18-20260422_192809/train_20260422_192821.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7dae46b6d3ec0927f712d1c944fdffc026905a5f54f6b09028e201efd026912d
3
+ size 3535
syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/gen_20260425_084947.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:562984d42e2c4f4ad6815da64c54123af9bfcba5188f6fd8a43a18c5df1512f6
3
+ size 346381
syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/input_snapshot.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b0c17e43cc28374b8404eb3dc1d3ea80bada61543e8bc750a0b54886fb08fb5
3
+ size 1369
syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/models_100epochs/id000017770781809035876352/rtf_config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee941ac35640055f5e9f84056538ce77b820f0a74420b61730747b04bd4b5a68
3
+ size 84590540
syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/models_100epochs/id000017770781809035876352/rtf_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:295713790a621c9435ef955f57ca153ebb92fd3ca8f675574f3b495575c5f800
3
+ size 927846883
syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/public_gate/normalized_schema_snapshot.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca33a02c28873c5ec5fec52da747d206cd9e461100244e401a7a2e5ef3cba096
3
+ size 8391
syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/public_gate/public_gate_report.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27f1ca3c2a10e936a41ba26048d2f0bc62addbfac55033a559ba761621c8ed22
3
+ size 921
syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/public_gate/staged_input_manifest.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3b14ecdce5d9796fba724d7c689412e3fe2bdb0b8cdd0e1a69a26798b6db843a
3
+ size 9192
syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/realtabformer_features.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:632cd1c583d7dfd3107947bb9a317b8bb4bc567040e03ec88232c59e6f87a161
3
+ size 1350
syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/rtf-c18-103976-20260425_084947.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cca888a21a39ab0e712b920c33f930c2acb4913a5341f6be6775f0895b3a7810
3
+ size 41493773
syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/rtf_checkpoints/checkpoint-324500/config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99d62702a67cb2b8d3b4e62f86ef998e6e2263aec5a0147c72405badf82ac079
3
+ size 824
syntheticSuccess/c18/realtabformer/rtf-c18-20260424_175433/rtf_checkpoints/checkpoint-324500/generation_config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba646891af3688a94e7af450f87ec1aea9e6c5339741bb2fb42433d6da3346ad
3
+ size 194