Add files using upload-large-folder tool
Browse files- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/_tabpfgen_generate.py +100 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/gen_20260429_060202.log +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/gen_20260429_064819.log +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/input_snapshot.json +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/public_gate/normalized_schema_snapshot.json +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/public_gate/public_gate_report.json +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/public_gate/staged_input_manifest.json +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/runtime_result.json +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/public/staged_features.json +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/public/test.csv +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/public/train.csv +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/public/val.csv +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/tabpfgen/adapter_report.json +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/tabpfgen/adapter_transforms_applied.json +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/tabpfgen/model_input_manifest.json +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/tabpfgen-n6-6400-20260429_064819.csv +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/tabpfgen_meta.json +3 -0
- syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/train_20260429_060202.log +3 -0
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/_tabpfgen_generate.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import numpy as np
|
| 3 |
+
import pandas as pd
|
| 4 |
+
import json
|
| 5 |
+
from tabpfgen import TabPFGen
|
| 6 |
+
|
| 7 |
+
df = pd.read_csv("/work/output-Benchmark-trainonly-v1/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/public/train.csv")
|
| 8 |
+
target_col = "y"
|
| 9 |
+
|
| 10 |
+
target_missing = df[target_col].isna()
|
| 11 |
+
if target_missing.any():
|
| 12 |
+
dropped = int(target_missing.sum())
|
| 13 |
+
df = df.loc[~target_missing].copy()
|
| 14 |
+
print(
|
| 15 |
+
f"[TabPFGen] Dropped {dropped} rows with missing target '{target_col}'"
|
| 16 |
+
)
|
| 17 |
+
if df.empty:
|
| 18 |
+
raise ValueError(
|
| 19 |
+
f"[TabPFGen] No rows remain after dropping missing target '{target_col}'"
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
feature_cols = [c for c in df.columns if c != target_col]
|
| 23 |
+
|
| 24 |
+
cat_encodings = {}
|
| 25 |
+
for col in feature_cols:
|
| 26 |
+
if df[col].dtype == object or str(df[col].dtype) == 'category':
|
| 27 |
+
cats = sorted(df[col].dropna().unique().tolist(), key=str)
|
| 28 |
+
cat_map = {v: i for i, v in enumerate(cats)}
|
| 29 |
+
df[col] = df[col].map(cat_map).astype(float)
|
| 30 |
+
cat_encodings[col] = cats
|
| 31 |
+
print(f"[TabPFGen] Label-encoded '{col}' ({len(cats)} categories)")
|
| 32 |
+
|
| 33 |
+
target_cats = None
|
| 34 |
+
if df[target_col].dtype == object or str(df[target_col].dtype) == 'category':
|
| 35 |
+
cats = sorted(df[target_col].dropna().unique().tolist(), key=str)
|
| 36 |
+
t_map = {v: i for i, v in enumerate(cats)}
|
| 37 |
+
df[target_col] = df[target_col].map(t_map).astype(float)
|
| 38 |
+
target_cats = cats
|
| 39 |
+
print(f"[TabPFGen] Label-encoded target '{target_col}' ({len(cats)} categories)")
|
| 40 |
+
|
| 41 |
+
X = df[feature_cols].values.astype(np.float32)
|
| 42 |
+
y = df[target_col].values
|
| 43 |
+
target_n = int(6400)
|
| 44 |
+
|
| 45 |
+
for i in range(X.shape[1]):
|
| 46 |
+
col_vals = X[:, i]
|
| 47 |
+
mask = np.isnan(col_vals)
|
| 48 |
+
if mask.any():
|
| 49 |
+
mean_val = np.nanmean(col_vals)
|
| 50 |
+
X[mask, i] = mean_val if not np.isnan(mean_val) else 0.0
|
| 51 |
+
|
| 52 |
+
# TabPFGen v0.1.x API:仅支持 n_sgld_steps / sgld_* / device。
|
| 53 |
+
# (旧版脚本中的 energy_*_chunk 与上游 TabPFGen 不一致,会导致 TypeError。)
|
| 54 |
+
gen = TabPFGen(
|
| 55 |
+
n_sgld_steps=1000,
|
| 56 |
+
sgld_step_size=0.01,
|
| 57 |
+
sgld_noise_scale=0.01,
|
| 58 |
+
device="auto",
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
print(f"[TabPFGen] Generating {target_n} rows via generate_classification")
|
| 62 |
+
X_syn, y_syn = gen.generate_classification(X, y, n_samples=target_n)
|
| 63 |
+
|
| 64 |
+
syn_df = pd.DataFrame(X_syn, columns=feature_cols)
|
| 65 |
+
syn_df[target_col] = y_syn
|
| 66 |
+
|
| 67 |
+
for col, cats in cat_encodings.items():
|
| 68 |
+
codes = np.round(syn_df[col].values).astype(int)
|
| 69 |
+
codes = np.clip(codes, 0, len(cats) - 1)
|
| 70 |
+
syn_df[col] = [cats[c] for c in codes]
|
| 71 |
+
|
| 72 |
+
if target_cats is not None:
|
| 73 |
+
codes = np.round(syn_df[target_col].values).astype(int)
|
| 74 |
+
codes = np.clip(codes, 0, len(target_cats) - 1)
|
| 75 |
+
syn_df[target_col] = [target_cats[c] for c in codes]
|
| 76 |
+
|
| 77 |
+
if len(syn_df) > target_n:
|
| 78 |
+
print(f"[TabPFGen] Trimming rows: {len(syn_df)} -> {target_n}")
|
| 79 |
+
syn_df = syn_df.iloc[:target_n].copy()
|
| 80 |
+
elif len(syn_df) < target_n:
|
| 81 |
+
deficit = target_n - len(syn_df)
|
| 82 |
+
print(f"[TabPFGen] Padding rows: {len(syn_df)} -> {target_n} (deficit={deficit})")
|
| 83 |
+
if len(syn_df) > 0:
|
| 84 |
+
extra = syn_df.sample(n=deficit, replace=True, random_state=42)
|
| 85 |
+
syn_df = pd.concat(
|
| 86 |
+
[syn_df.reset_index(drop=True), extra.reset_index(drop=True)],
|
| 87 |
+
ignore_index=True,
|
| 88 |
+
)
|
| 89 |
+
else:
|
| 90 |
+
syn_df = df[feature_cols + [target_col]].sample(
|
| 91 |
+
n=target_n, replace=True, random_state=42
|
| 92 |
+
).reset_index(drop=True)
|
| 93 |
+
|
| 94 |
+
syn_df = syn_df[list(df.columns)]
|
| 95 |
+
if len(syn_df) != target_n:
|
| 96 |
+
raise RuntimeError(
|
| 97 |
+
f"[TabPFGen] Row alignment failed: got {len(syn_df)}, expected {target_n}"
|
| 98 |
+
)
|
| 99 |
+
syn_df.to_csv("/work/output-Benchmark-trainonly-v1/n6/tabpfgen/tabpfgen-n6-20260429_060202/tabpfgen-n6-6400-20260429_064819.csv", index=False)
|
| 100 |
+
print(f"[TabPFGen] Saved {len(syn_df)} rows -> /work/output-Benchmark-trainonly-v1/n6/tabpfgen/tabpfgen-n6-20260429_060202/tabpfgen-n6-6400-20260429_064819.csv")
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/gen_20260429_060202.log
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cf614ffa33debcc7aaeecccd66203f2a3378da121d4d7f017da6cb088596f996
|
| 3 |
+
size 633
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/gen_20260429_064819.log
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3ac7d3b9d2d0ed415f3c9ebabd4338ba723f796f4efcbccf0bbaec121ec2dcc4
|
| 3 |
+
size 761
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/input_snapshot.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5458217c344cd3c9706516dc661fc579d74f0249dc01b0a7adc5f4d8ac9ac087
|
| 3 |
+
size 1347
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/public_gate/normalized_schema_snapshot.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2b240ee2cf62a2868bf54e3b4393eadd3d7751825bf4bb34743e85547f7cbcd3
|
| 3 |
+
size 7725
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/public_gate/public_gate_report.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:225732b90f81f74a3430523830af44cf151a7f15f2571a57ad83c2d55f982195
|
| 3 |
+
size 908
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/public_gate/staged_input_manifest.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2a5ade9e14cd849faac56f032d1e278ad24111a25a59384a04bc0cb321d652fd
|
| 3 |
+
size 8541
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/runtime_result.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e67d2df42d90017409cff50bbfc04441cb4c9eb501b90c22680890e136c5b866
|
| 3 |
+
size 461
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/public/staged_features.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e2869694dd92d59628a62fdd1349d4dd69eb6608ed9b0fdeb4b0800b6334d81
|
| 3 |
+
size 1520
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/public/test.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f1922293e501d8f17f56a321a1305e44d20a6ad7ed67e97af754dea170989fc5
|
| 3 |
+
size 39918
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/public/train.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c8545a9761061bd99d67935948928e2840e6ae4b5c9760cad2de82198676db2b
|
| 3 |
+
size 316902
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/public/val.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:60a3dd7f655f8086e53402dcdcfa42297d586d8483f2afd6e1bbc6bd3521303f
|
| 3 |
+
size 39705
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/tabpfgen/adapter_report.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f315a7244504e6ae7f745c9efd4066d30d7dac516cc3b7d38e9d260eba302113
|
| 3 |
+
size 324
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/tabpfgen/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/n6/tabpfgen/tabpfgen-n6-20260429_060202/staged/tabpfgen/model_input_manifest.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4613549a17da4f376556eebc1e47ad25f569ece3644598be73849d6926792ff6
|
| 3 |
+
size 8741
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/tabpfgen-n6-6400-20260429_064819.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:54cd83306171151f16a98707d307bb2231084a9b1b61ec8b5ec0700c29e47f34
|
| 3 |
+
size 1062052
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/tabpfgen_meta.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d585b929255bedf0cbbf4497c5caab9fdc4067dca26f0c6b5e9d9cf75d57e335
|
| 3 |
+
size 441
|
syntheticSuccess/n6/tabpfgen/tabpfgen-n6-20260429_060202/train_20260429_060202.log
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8e80a1cd11cf3475fda3886f822166c60419b46ff3e9a940b60da4ad8b9c8ce2
|
| 3 |
+
size 595
|