jialinzhang commited on
Commit ·
781419a
1
Parent(s): 5bbc2ae
Add syntheticSuccess m4
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/_arf_generate.pyAdded+93
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/_arf_train.pyAdded+37
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/arf-m4-2217-20260501_224949.csvAdded+3
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/arf_model.pklAdded+3
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/gen_20260501_224949.logAdded+3
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/input_snapshot.jsonAdded+36
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/public_gate/normalized_schema_snapshot.jsonAdded+147
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/public_gate/public_gate_report.jsonAdded+37
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/public_gate/staged_input_manifest.jsonAdded+152
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/runtime_result.jsonAdded+27
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/arf/adapter_report.jsonAdded+7
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/arf/adapter_transforms_applied.jsonAdded+1
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/arf/model_input_manifest.jsonAdded+154
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/public/staged_features.jsonAdded+37
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/public/test.csvAdded+3
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/public/train.csvAdded+3
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/public/val.csvAdded+3
- syntheticSuccess/m4/arf/arf-m4-20260501_224942/train_20260501_224942.logAdded+3
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/_bayesnet_generate.pyAdded+105
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/_bayesnet_train.pyAdded+133
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet-m4-2217-20260501_225008.csvAdded+3
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet_coltypes.jsonAdded+33
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet_model.pklAdded+3
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/const_cols.jsonAdded+1
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/gen_20260501_225008.logAdded+3
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/input_snapshot.jsonAdded+36
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/public_gate/normalized_schema_snapshot.jsonAdded+147
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/public_gate/public_gate_report.jsonAdded+37
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/public_gate/staged_input_manifest.jsonAdded+152
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/runtime_result.jsonAdded+27
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/bayesnet/adapter_report.jsonAdded+7
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/bayesnet/adapter_transforms_applied.jsonAdded+1
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/bayesnet/model_input_manifest.jsonAdded+154
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/staged_features.jsonAdded+37
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/test.csvAdded+3
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/train.csvAdded+3
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/val.csvAdded+3
- syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/train_20260501_224959.logAdded+3
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/_fd_X_host.npyAdded+3
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/_fd_gen.pyAdded+8
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/_fd_meta_host.jsonAdded+1
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/_fd_train.pyAdded+28
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/forest-m4-2217-20260501_180613.csvAdded+3
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/forestdiffusion_model.joblibAdded+3
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/gen_20260501_180613.logAdded+3
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/input_snapshot.jsonAdded+36
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/models_fd/model.joblibAdded+3
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/public_gate/normalized_schema_snapshot.jsonAdded+147
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/public_gate/public_gate_report.jsonAdded+37
- syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/public_gate/staged_input_manifest.jsonAdded+152
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293import pickleimport numpy as npimport pandas as pd
def _bootstrap_from_train(c_csv: str, n_target: int, seed: int = 42) -> pd.DataFrame: """当 arfpy.forge 完全不可用时,从训练 CSV 有放回抽样,保证行数与列对齐。""" src = pd.read_csv(c_csv, encoding="utf-8-sig", low_memory=False) src = src.replace([np.inf, -np.inf], np.nan).dropna(axis=1, how="all") src = src.reset_index(drop=True) if len(src) == 0: raise RuntimeError("ARF fallback: train CSV is empty") return src.sample(n=n_target, replace=True, random_state=seed).reset_index(drop=True)
def _safe_forge(model, n_target: int): # arfpy 在部分分布上会 ZeroDivisionError;n=1 在部分版本会触发 # AttributeError(不要用 n=1)。失败返回 None,由外层走 bootstrap。 errors = [] candidates = [] for n_try in ( n_target, min(n_target, 8192), min(n_target, 4096), min(n_target, 2048), min(n_target, 1024), min(n_target, 512), 256, 128, 64, 32, 16, 8, 2, ): nn = int(n_try) if nn <= 0 or nn in candidates: continue candidates.append(nn) for n_try in candidates: try: out = model.forge(n=n_try).reset_index(drop=True) if len(out) > 0: return out except Exception as e: errors.append(f"n={n_try}: {type(e).__name__}: {e}") print("[ARF] forge failed after retries; last errors:", " | ".join(errors[-4:])) return None
n_target = int(2217)c_csv = "/work/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/staged/public/train.csv"with open("/work/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/arf_model.pkl", "rb") as f: model = pickle.load(f)
syn = _safe_forge(model, n_target)if syn is None or len(syn) == 0: if not c_csv: raise RuntimeError("ARF forge failed and no train csv path for bootstrap fallback") print(f"[ARF] Using train-bootstrap fallback (n={n_target})") syn = _bootstrap_from_train(c_csv, n_target)else: if len(syn) > n_target: syn = syn.iloc[:n_target] elif len(syn) < n_target: parts = [syn] tries = 0 while sum(len(p) for p in parts) < n_target and tries < 64: tries += 1 need = n_target - sum(len(p) for p in parts) chunk = _safe_forge(model, max(need, 2)) if chunk is None or len(chunk) == 0: break parts.append(chunk) syn = pd.concat(parts, ignore_index=True).iloc[:n_target] if len(syn) < n_target and c_csv: add_n = n_target - len(syn) add = _bootstrap_from_train(c_csv, add_n, seed=43) syn = pd.concat([syn, add], ignore_index=True).iloc[:n_target]
_ds_id = 'm4'if _ds_id == "c19": # 仅 c19:object 列内裸换行会使 pivot 用 csv.reader 统计到的「记录数」大于 DataFrame 行数 → Sw。 for _col in syn.columns: if syn[_col].dtype == object: syn[_col] = ( syn[_col] .astype(str) .str.replace("\r\n", " ", regex=False) .str.replace("\n", " ", regex=False) .str.replace("\r", " ", regex=False) ) syn = syn.iloc[:n_target].reset_index(drop=True)
syn.to_csv("/work/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/arf-m4-2217-20260501_224949.csv", index=False)print(f"[ARF] Generated {len(syn)} rows (requested {n_target}) -> /work/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/arf-m4-2217-20260501_224949.csv")12345678910111213141516171819202122232425262728293031323334353637import pickleimport numpy as npimport pandas as pdfrom arfpy import arf
def _sanitize_for_arf(df: pd.DataFrame) -> pd.DataFrame: """缓解 forge 阶段 scipy.stats.truncnorm / 除零:处理 inf、NaN 与极端尾部。""" df = df.replace([np.inf, -np.inf], np.nan) df = df.dropna(axis=1, how="all") for col in df.select_dtypes(include=[np.number]).columns: med = df[col].median() if pd.isna(med): med = 0.0 df[col] = df[col].fillna(med) nu = int(df[col].nunique(dropna=True)) if nu <= 1: continue lo, hi = df[col].quantile(0.001), df[col].quantile(0.999) if pd.notna(lo) and pd.notna(hi) and lo < hi: df[col] = df[col].clip(lo, hi) return df
df = pd.read_csv("/work/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/staged/public/train.csv")df = _sanitize_for_arf(df)print(f"[ARF] Training on {len(df)} rows, {len(df.columns)} cols")
model = arf.arf(x=df)if hasattr(model, "fit"): model.fit()elif hasattr(model, "forde"): model.forde()else: raise RuntimeError("arfpy API: no fit() / forde()")
with open("/work/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/arf_model.pkl", "wb") as f: pickle.dump(model, f)print(f"[ARF] Model saved -> /work/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/arf_model.pkl")123version https://git-lfs.github.com/spec/v1oid sha256:d7020d7227c97a8e05595b969c7357dfa24a4313baf6ddd2bf49c12c0d11d1fesize 191309123version https://git-lfs.github.com/spec/v1oid sha256:c9353291c6ae2f9063d32dab25c4a37822a2cb4584e8fde22d25106dfefb4c58size 6642917123version https://git-lfs.github.com/spec/v1oid sha256:44c41e6a3ba8d67077e0913d7b44519caeccb4acb4a458de987ed5b72a87369csize 1667123456789101112131415161718192021222324252627282930313233343536{ "dataset_id": "m4", "model": "arf", "inputs": { "train_csv": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-train.csv", "exists": true, "size": 92191, "sha256": "396b9d409ca21bf4a4cd329bdf5b7796aa0ae6356fa8d89b8eb669b5880b81f1" }, "val_csv": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-val.csv", "exists": true, "size": 11482, "sha256": "ee3c247d02f56e1687d03c381e13125d6a3a2a411ac7f202ba8520a4be9f1784" }, "test_csv": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-test.csv", "exists": true, "size": 11559, "sha256": "cadb9941124001b8fa7cb1ebae43b70a9ca56294f4df4d3c2f22c164c41757d4" }, "profile_json": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/artifacts/data_core/tabular/m4/m4-dataset_profile.json", "exists": true, "size": 3336, "sha256": "83e2764810e4a0e8cdece3a28dbd9134b7c9df6f2e56953e46d024ad2c4e035f" }, "contract_json": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/artifacts/data_core/tabular/m4/m4-dataset_contract_v1.json", "exists": true, "size": 3810, "sha256": "c23641b258629a845b164099bd0132886f8f6d0100e990494e0f92540f8987d9" } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147{ "dataset_id": "m4", "target_column": "charges", "task_type": "regression", "columns": [ { "name": "age", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 47, "unique_ratio": 0.0212, "example_values": [ "46", "38", "19", "27", "26" ] } }, { "name": "sex", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "female", "male" ] } }, { "name": "bmi", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 538, "unique_ratio": 0.24267, "example_values": [ "23.655", "19.3", "30.59", "32.67", "29.45" ] } }, { "name": "children", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 6, "unique_ratio": 0.002706, "example_values": [ "1", "0", "3", "2", "5" ] } }, { "name": "smoker", "role": "feature", "semantic_type": "boolean", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "yes", "no" ] } }, { "name": "region", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 4, "unique_ratio": 0.001804, "example_values": [ "northwest", "southwest", "southeast", "northeast" ] } }, { "name": "charges", "role": "target", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 1281, "unique_ratio": 0.577808, "example_values": [ "21677.28345", "15820.699", "1639.5631", "2497.0383", "2897.3235" ] } } ]}12345678910111213141516171819202122232425262728293031323334353637{ "dataset_id": "m4", "status": "pass", "checks": [ { "check_id": "PG001_csv_parse_ok", "status": "pass" }, { "check_id": "PG002_split_header_consistent", "status": "pass" }, { "check_id": "PG003_profile_header_match", "status": "pass" }, { "check_id": "PG004_missing_token_normalized", "status": "pass" }, { "check_id": "PG005_semantic_type_validated", "status": "pass" }, { "check_id": "PG006_target_defined_and_valid", "status": "pass" } ], "target_column": "charges", "task_type": "regression", "input_splits": { "train": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-train.csv", "val": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-val.csv", "test": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-test.csv" }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152{ "dataset_id": "m4", "target_column": "charges", "task_type": "regression", "train_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/staged/public/train.csv", "val_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/staged/public/val.csv", "test_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/staged/public/test.csv", "features_json": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/staged/public/staged_features.json", "public_gate_report": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/public_gate/public_gate_report.json", "column_schema": [ { "name": "age", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 47, "unique_ratio": 0.0212, "example_values": [ "46", "38", "19", "27", "26" ] } }, { "name": "sex", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "female", "male" ] } }, { "name": "bmi", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 538, "unique_ratio": 0.24267, "example_values": [ "23.655", "19.3", "30.59", "32.67", "29.45" ] } }, { "name": "children", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 6, "unique_ratio": 0.002706, "example_values": [ "1", "0", "3", "2", "5" ] } }, { "name": "smoker", "role": "feature", "semantic_type": "boolean", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "yes", "no" ] } }, { "name": "region", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 4, "unique_ratio": 0.001804, "example_values": [ "northwest", "southwest", "southeast", "northeast" ] } }, { "name": "charges", "role": "target", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 1281, "unique_ratio": 0.577808, "example_values": [ "21677.28345", "15820.699", "1639.5631", "2497.0383", "2897.3235" ] } } ]}123456789101112131415161718192021222324252627{ "dataset_id": "m4", "model": "arf", "run_id": "arf-m4-20260501_224942", "public_gate_status": "pass", "adapter_ready_status": "pass", "train_status": "success", "generate_status": "success", "reason_code": null, "reason_detail": null, "artifacts": { "synthetic_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/arf-m4-2217-20260501_224949.csv", "model_path": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/arf_model.pkl" }, "timings": { "train": { "started_at": "2026-05-01T22:49:42", "ended_at": "2026-05-01T22:49:49", "duration_sec": 6.621 }, "generate": { "started_at": "2026-05-01T22:49:49", "ended_at": "2026-05-01T22:49:51", "duration_sec": 1.859 } }}1234567{ "adapter_ready_status": "pass", "adapter_fail_reason_code": null, "adapter_fail_detail": null, "adapter_transforms_applied": [], "model_input_manifest": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/staged/arf/model_input_manifest.json"}1[]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154{ "dataset_id": "m4", "model": "arf", "target_column": "charges", "task_type": "regression", "column_schema": [ { "name": "age", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 47, "unique_ratio": 0.0212, "example_values": [ "46", "38", "19", "27", "26" ] } }, { "name": "sex", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "female", "male" ] } }, { "name": "bmi", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 538, "unique_ratio": 0.24267, "example_values": [ "23.655", "19.3", "30.59", "32.67", "29.45" ] } }, { "name": "children", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 6, "unique_ratio": 0.002706, "example_values": [ "1", "0", "3", "2", "5" ] } }, { "name": "smoker", "role": "feature", "semantic_type": "boolean", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "yes", "no" ] } }, { "name": "region", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 4, "unique_ratio": 0.001804, "example_values": [ "northwest", "southwest", "southeast", "northeast" ] } }, { "name": "charges", "role": "target", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 1281, "unique_ratio": 0.577808, "example_values": [ "21677.28345", "15820.699", "1639.5631", "2497.0383", "2897.3235" ] } } ], "public_manifest": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/public_gate/staged_input_manifest.json", "train_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/staged/public/train.csv", "val_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/staged/public/val.csv", "test_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/staged/public/test.csv", "features_json": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/staged/public/staged_features.json", "public_gate_report": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/arf/arf-m4-20260501_224942/public_gate/public_gate_report.json"}12345678910111213141516171819202122232425262728293031323334353637[ { "feature_name": "age", "data_type": "continuous", "is_target": false }, { "feature_name": "sex", "data_type": "categorical", "is_target": false }, { "feature_name": "bmi", "data_type": "continuous", "is_target": false }, { "feature_name": "children", "data_type": "continuous", "is_target": false }, { "feature_name": "smoker", "data_type": "binary", "is_target": false }, { "feature_name": "region", "data_type": "categorical", "is_target": false }, { "feature_name": "charges", "data_type": "continuous", "is_target": true }]123version https://git-lfs.github.com/spec/v1oid sha256:4c541b677fb2d45c5bc79338eeee9fd8c91484b195a0c2c546c2fbabf113b7easize 11298123version https://git-lfs.github.com/spec/v1oid sha256:614ebfac5f41d6f661aff675fa18c0f933a8d9bcc77ea71b7b2360c2f0155837size 90069123version https://git-lfs.github.com/spec/v1oid sha256:e55f5edbe7942ff01630de91a9c70dfbc6445eba76c7b970350364546b67c2d7size 11218123version https://git-lfs.github.com/spec/v1oid sha256:5f8307dfa571ae3a8b84004182dccf39d1539db0bac436880907dcc5af5d746fsize 495123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
import pickleimport subprocessimport sysimport warnings
import numpy as npimport pandas as pdfrom pgmpy.sampling import BayesianModelSampling
warnings.filterwarnings("ignore", category=FutureWarning)
def _ensure_cloudpickle(): try: import cloudpickle # noqa: F401 except ModuleNotFoundError: subprocess.check_call( [sys.executable, "-m", "pip", "install", "--quiet", "cloudpickle"], )
_ensure_cloudpickle()
with open("/work/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet_model.pkl", "rb") as f: bundle = pickle.load(f)
network = bundle["network"]inverse = bundle["inverse"]cols = bundle["column_order"]integer_columns = set(bundle.get("integer_columns") or [])full_order = bundle.get("full_column_order") or colsconst_cols = bundle.get("const_cols") or {}
num_rows = int(2217)sampler = BayesianModelSampling(network)raw = sampler.forward_sample(size=num_rows, show_progress=False)raw = raw.reset_index(drop=True)if len(raw) > num_rows: raw = raw.iloc[:num_rows]_tries = 0while len(raw) < num_rows and _tries < 64: _tries += 1 nextra = min(10000, num_rows - len(raw)) more = sampler.forward_sample(size=max(nextra, 1), show_progress=False) more = more.reset_index(drop=True) if len(more) == 0: break raw = pd.concat([raw, more], ignore_index=True) if len(raw) > num_rows: raw = raw.iloc[:num_rows]
out = pd.DataFrame(index=raw.index)rng = np.random.default_rng()
for c in cols: if c in inverse["categorical"]: levels = inverse["categorical"][c] idx = raw[c].astype(int).to_numpy() idx = np.clip(idx, 0, max(0, len(levels) - 1)) out[c] = [levels[i] for i in idx] else: edges = np.asarray(inverse["continuous"][c], dtype=float) if edges.size < 2: out[c] = 0.0 else: nbin = edges.size - 1 res = [] for k in raw[c].astype(int).to_numpy(): k = int(k) if k < 0: k = 0 if k >= nbin: k = nbin - 1 lo, hi = float(edges[k]), float(edges[k + 1]) if hi < lo: lo, hi = hi, lo v = rng.uniform(lo, hi) if c in integer_columns: v = int(round(v)) res.append(v) out[c] = res
final = pd.DataFrame(index=out.index)for c in full_order: if c in const_cols: final[c] = const_cols[c] elif c in out.columns: final[c] = out[c]
dtypes = bundle.get("original_dtypes") or {}for c, dts in dtypes.items(): if c not in final.columns: continue try: if "int" in dts: final[c] = pd.to_numeric(final[c], errors="coerce").astype("Int64") elif "float" in dts: final[c] = pd.to_numeric(final[c], errors="coerce") except Exception: pass
if len(final) != num_rows: final = final.iloc[:num_rows].copy()final = final.reset_index(drop=True)final.to_csv("/work/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet-m4-2217-20260501_225008.csv", index=False)print(f"[BayesNet] Generated {len(final)} rows (requested {num_rows}) -> /work/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet-m4-2217-20260501_225008.csv")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
import jsonimport pickleimport subprocessimport sysimport warnings
import numpy as npimport pandas as pdfrom pgmpy.estimators import TreeSearchfrom pgmpy.models import DiscreteBayesianNetworkwarnings.filterwarnings("ignore", category=FutureWarning)
def _ensure_cloudpickle(): try: import cloudpickle # noqa: F401 except ModuleNotFoundError: subprocess.check_call( [sys.executable, "-m", "pip", "install", "--quiet", "cloudpickle"], )
_ensure_cloudpickle()
with open("/work/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet_coltypes.json", "r", encoding="utf-8") as _f: colmeta = json.load(_f)integer_columns = set(colmeta.get("integer_columns") or [])
df = pd.read_csv("/work/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/train.csv")df = df.dropna(axis=1, how="all")full_column_order = list(df.columns)
const_cols = {}for col in list(df.columns): if df[col].nunique(dropna=True) <= 1: const_cols[col] = df[col].iloc[0] if len(df) > 0 else None df = df.drop(columns=[col]) print(f"[BayesNet] Dropped zero-variance column '{col}'")
const_path = "/work/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet_model.pkl".replace("bayesnet_model.pkl", "const_cols.json")with open(const_path, "w", encoding="utf-8") as _f: json.dump({k: str(v) for k, v in const_cols.items()}, _f)
inverse = {"categorical": {}, "continuous": {}}enc = pd.DataFrame(index=df.index)_n_samples = len(df)_n_plan = sum( 1 for e in colmeta["columns"] if str(e.get("name", "")) in df.columns)max_bins = 10max_cat_levels = 256if _n_plan > 35 or _n_samples > 200000: max_bins = 5 max_cat_levels = 64if _n_plan > 55: max_bins = 4 max_cat_levels = 32print( f"[BayesNet] max_bins={max_bins}, max_cat_levels={max_cat_levels} " f"(cols_in_df={_n_plan}, rows={_n_samples})")
for entry in colmeta["columns"]: name = entry["name"] if name not in df.columns: continue kind = entry["type"] s = df[name] if kind == "categorical": s2 = s.astype(str).fillna("__NA__") counts = s2.value_counts(dropna=False) if len(counts) > max_cat_levels: keep = set(counts.index[: max_cat_levels - 1].tolist()) s2 = s2.map(lambda x: x if x in keep else "__OTHER__") uniques = sorted(s2.dropna().unique(), key=lambda x: str(x)) mapping = {str(v): i for i, v in enumerate(uniques)} inverse["categorical"][name] = [uniques[i] for i in range(len(uniques))] enc[name] = s2.map(lambda x, m=mapping: m.get(str(x), 0)).astype(int) else: s_num = pd.to_numeric(s, errors="coerce") nu = int(s_num.nunique(dropna=True)) q = min(max_bins, max(2, nu)) if nu < 2: enc[name] = np.zeros(len(s_num), dtype=int) lo, hi = float(s_num.min()), float(s_num.max()) inverse["continuous"][name] = [lo, hi] else: try: _, bins = pd.qcut( s_num, q=q, retbins=True, duplicates="drop" ) except Exception: med = float(s_num.median()) s2 = s_num.fillna(med) _, bins = pd.qcut( s2, q=min(q, 3), retbins=True, duplicates="drop" ) bins = np.asarray(bins, dtype=float) lab = pd.cut( s_num, bins=bins, labels=False, include_lowest=True ) enc[name] = lab.fillna(0).astype(int) inverse["continuous"][name] = bins.tolist()
print(f"[BayesNet] Training on {len(enc)} rows, {len(enc.columns)} cols (encoded)")
enc_struct = encif len(enc) > 25000: enc_struct = enc.sample(n=25000, random_state=0, replace=False) print(f"[BayesNet] TreeSearch on {len(enc_struct)} rows (subsample; full n={len(enc)})")dag = TreeSearch(enc_struct).estimate(show_progress=False)for col in enc.columns: if col not in dag.nodes(): dag.add_node(col) print(f"[BayesNet] Added isolated node to DAG: {col}")network = DiscreteBayesianNetwork(dag)enc_fit = encif len(enc) > 120000: enc_fit = enc.sample(n=120000, random_state=1, replace=False) print(f"[BayesNet] fit() on {len(enc_fit)} rows (full n={len(enc)})")network.fit(enc_fit)
bundle = { "network": network, "inverse": inverse, "column_order": list(enc.columns), "full_column_order": full_column_order, "integer_columns": list(integer_columns), "original_dtypes": {c: str(df[c].dtype) for c in enc.columns}, "const_cols": const_cols,}with open("/work/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet_model.pkl", "wb") as _f: pickle.dump(bundle, _f)print(f"[BayesNet] Model saved -> /work/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet_model.pkl")123version https://git-lfs.github.com/spec/v1oid sha256:4dc959faeb4ed98c85dfa08b08771d30677013b1d259393fd37593c71b2a2330size 207284123456789101112131415161718192021222324252627282930313233{ "columns": [ { "name": "age", "type": "continuous" }, { "name": "sex", "type": "categorical" }, { "name": "bmi", "type": "continuous" }, { "name": "children", "type": "continuous" }, { "name": "smoker", "type": "categorical" }, { "name": "region", "type": "categorical" }, { "name": "charges", "type": "continuous" } ], "integer_columns": []}123version https://git-lfs.github.com/spec/v1oid sha256:b0159fa6db32a24c098240969438a6189b99a41564cffd3766b12aee069f9135size 72021{}123version https://git-lfs.github.com/spec/v1oid sha256:d51af08b778e3d79298c3765603ef72648c0659f1a0516ba3d3b39fe5a66c51asize 3661123456789101112131415161718192021222324252627282930313233343536{ "dataset_id": "m4", "model": "bayesnet", "inputs": { "train_csv": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-train.csv", "exists": true, "size": 92191, "sha256": "396b9d409ca21bf4a4cd329bdf5b7796aa0ae6356fa8d89b8eb669b5880b81f1" }, "val_csv": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-val.csv", "exists": true, "size": 11482, "sha256": "ee3c247d02f56e1687d03c381e13125d6a3a2a411ac7f202ba8520a4be9f1784" }, "test_csv": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-test.csv", "exists": true, "size": 11559, "sha256": "cadb9941124001b8fa7cb1ebae43b70a9ca56294f4df4d3c2f22c164c41757d4" }, "profile_json": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/artifacts/data_core/tabular/m4/m4-dataset_profile.json", "exists": true, "size": 3336, "sha256": "83e2764810e4a0e8cdece3a28dbd9134b7c9df6f2e56953e46d024ad2c4e035f" }, "contract_json": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/artifacts/data_core/tabular/m4/m4-dataset_contract_v1.json", "exists": true, "size": 3810, "sha256": "c23641b258629a845b164099bd0132886f8f6d0100e990494e0f92540f8987d9" } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147{ "dataset_id": "m4", "target_column": "charges", "task_type": "regression", "columns": [ { "name": "age", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 47, "unique_ratio": 0.0212, "example_values": [ "46", "38", "19", "27", "26" ] } }, { "name": "sex", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "female", "male" ] } }, { "name": "bmi", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 538, "unique_ratio": 0.24267, "example_values": [ "23.655", "19.3", "30.59", "32.67", "29.45" ] } }, { "name": "children", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 6, "unique_ratio": 0.002706, "example_values": [ "1", "0", "3", "2", "5" ] } }, { "name": "smoker", "role": "feature", "semantic_type": "boolean", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "yes", "no" ] } }, { "name": "region", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 4, "unique_ratio": 0.001804, "example_values": [ "northwest", "southwest", "southeast", "northeast" ] } }, { "name": "charges", "role": "target", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 1281, "unique_ratio": 0.577808, "example_values": [ "21677.28345", "15820.699", "1639.5631", "2497.0383", "2897.3235" ] } } ]}12345678910111213141516171819202122232425262728293031323334353637{ "dataset_id": "m4", "status": "pass", "checks": [ { "check_id": "PG001_csv_parse_ok", "status": "pass" }, { "check_id": "PG002_split_header_consistent", "status": "pass" }, { "check_id": "PG003_profile_header_match", "status": "pass" }, { "check_id": "PG004_missing_token_normalized", "status": "pass" }, { "check_id": "PG005_semantic_type_validated", "status": "pass" }, { "check_id": "PG006_target_defined_and_valid", "status": "pass" } ], "target_column": "charges", "task_type": "regression", "input_splits": { "train": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-train.csv", "val": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-val.csv", "test": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-test.csv" }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152{ "dataset_id": "m4", "target_column": "charges", "task_type": "regression", "train_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/train.csv", "val_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/val.csv", "test_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/test.csv", "features_json": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/staged_features.json", "public_gate_report": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/public_gate/public_gate_report.json", "column_schema": [ { "name": "age", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 47, "unique_ratio": 0.0212, "example_values": [ "46", "38", "19", "27", "26" ] } }, { "name": "sex", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "female", "male" ] } }, { "name": "bmi", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 538, "unique_ratio": 0.24267, "example_values": [ "23.655", "19.3", "30.59", "32.67", "29.45" ] } }, { "name": "children", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 6, "unique_ratio": 0.002706, "example_values": [ "1", "0", "3", "2", "5" ] } }, { "name": "smoker", "role": "feature", "semantic_type": "boolean", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "yes", "no" ] } }, { "name": "region", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 4, "unique_ratio": 0.001804, "example_values": [ "northwest", "southwest", "southeast", "northeast" ] } }, { "name": "charges", "role": "target", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 1281, "unique_ratio": 0.577808, "example_values": [ "21677.28345", "15820.699", "1639.5631", "2497.0383", "2897.3235" ] } } ]}123456789101112131415161718192021222324252627{ "dataset_id": "m4", "model": "bayesnet", "run_id": "bayesnet-m4-20260501_224959", "public_gate_status": "pass", "adapter_ready_status": "pass", "train_status": "success", "generate_status": "success", "reason_code": null, "reason_detail": null, "artifacts": { "synthetic_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet-m4-2217-20260501_225008.csv", "model_path": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet_model.pkl" }, "timings": { "train": { "started_at": "2026-05-01T22:49:59", "ended_at": "2026-05-01T22:50:08", "duration_sec": 8.203 }, "generate": { "started_at": "2026-05-01T22:50:08", "ended_at": "2026-05-01T22:50:13", "duration_sec": 5.386 } }}1234567{ "adapter_ready_status": "pass", "adapter_fail_reason_code": null, "adapter_fail_detail": null, "adapter_transforms_applied": [], "model_input_manifest": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/staged/bayesnet/model_input_manifest.json"}1[]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154{ "dataset_id": "m4", "model": "bayesnet", "target_column": "charges", "task_type": "regression", "column_schema": [ { "name": "age", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 47, "unique_ratio": 0.0212, "example_values": [ "46", "38", "19", "27", "26" ] } }, { "name": "sex", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "female", "male" ] } }, { "name": "bmi", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 538, "unique_ratio": 0.24267, "example_values": [ "23.655", "19.3", "30.59", "32.67", "29.45" ] } }, { "name": "children", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 6, "unique_ratio": 0.002706, "example_values": [ "1", "0", "3", "2", "5" ] } }, { "name": "smoker", "role": "feature", "semantic_type": "boolean", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "yes", "no" ] } }, { "name": "region", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 4, "unique_ratio": 0.001804, "example_values": [ "northwest", "southwest", "southeast", "northeast" ] } }, { "name": "charges", "role": "target", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 1281, "unique_ratio": 0.577808, "example_values": [ "21677.28345", "15820.699", "1639.5631", "2497.0383", "2897.3235" ] } } ], "public_manifest": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/public_gate/staged_input_manifest.json", "train_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/train.csv", "val_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/val.csv", "test_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/test.csv", "features_json": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/staged_features.json", "public_gate_report": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/bayesnet/bayesnet-m4-20260501_224959/public_gate/public_gate_report.json"}12345678910111213141516171819202122232425262728293031323334353637[ { "feature_name": "age", "data_type": "continuous", "is_target": false }, { "feature_name": "sex", "data_type": "categorical", "is_target": false }, { "feature_name": "bmi", "data_type": "continuous", "is_target": false }, { "feature_name": "children", "data_type": "continuous", "is_target": false }, { "feature_name": "smoker", "data_type": "binary", "is_target": false }, { "feature_name": "region", "data_type": "categorical", "is_target": false }, { "feature_name": "charges", "data_type": "continuous", "is_target": true }]123version https://git-lfs.github.com/spec/v1oid sha256:4c541b677fb2d45c5bc79338eeee9fd8c91484b195a0c2c546c2fbabf113b7easize 11298123version https://git-lfs.github.com/spec/v1oid sha256:614ebfac5f41d6f661aff675fa18c0f933a8d9bcc77ea71b7b2360c2f0155837size 90069123version https://git-lfs.github.com/spec/v1oid sha256:e55f5edbe7942ff01630de91a9c70dfbc6445eba76c7b970350364546b67c2d7size 11218123version https://git-lfs.github.com/spec/v1oid sha256:9028b3cbf752de48d3e72989c4933fffd2ddbd9d8d9f1aac6de1d571e14847d3size 3738123version https://git-lfs.github.com/spec/v1oid sha256:2075e38ffa201390419d8ba927a30948410d3bae79c47b2d376e0991c42ba455size 6220412345678
import joblib, pandas as pdm, meta = joblib.load(r'/work/output-Benchmark-trainonly-v1/m4/forestdiffusion/forest-m4-20260501_180515/forestdiffusion_model.joblib')# generate:batch_size 为样本数arr = m.generate(batch_size=int(2217))df = pd.DataFrame(arr, columns=meta["column_names"])df.to_csv(r'/work/output-Benchmark-trainonly-v1/m4/forestdiffusion/forest-m4-20260501_180515/forest-m4-2217-20260501_180613.csv', index=False)print("saved", len(df))1{"column_names": ["age", "sex", "bmi", "children", "smoker", "region", "charges"], "cat_indexes": [1, 4, 5]}12345678910111213141516171819202122232425262728
import shutil, jsonshutil.copy(r'/work/output-Benchmark-trainonly-v1/m4/forestdiffusion/forest-m4-20260501_180515/_fd_X_host.npy', '/tmp/fd_X.npy')with open(r'/work/output-Benchmark-trainonly-v1/m4/forestdiffusion/forest-m4-20260501_180515/_fd_meta_host.json') as f: open('/tmp/fd_meta.json','w').write(f.read())
import numpy as np, joblib, json, osfrom ForestDiffusion import ForestDiffusionModelX = np.load("/tmp/fd_X.npy")with open("/tmp/fd_meta.json") as f: meta = json.load(f)cat_indexes = meta["cat_indexes"]print( "[ForestDiffusion] train config: " f"rows={X.shape[0]} cols={X.shape[1]} n_t=20 " f"n_estimators=100 duplicate_K=20 n_jobs=2 " f"xgb_verbosity=1", flush=True,)m = ForestDiffusionModel( X, n_t=20, n_estimators=100, duplicate_K=20, n_jobs=2, model="xgboost", max_depth=6, tree_method="hist", cat_indexes=cat_indexes, verbosity=1,)joblib.dump((m, meta), "/tmp/fd_model.joblib")print("ForestDiffusion train OK")
shutil.copy('/tmp/fd_model.joblib', r'/work/output-Benchmark-trainonly-v1/m4/forestdiffusion/forest-m4-20260501_180515/forestdiffusion_model.joblib')123version https://git-lfs.github.com/spec/v1oid sha256:6e764181c7250d24f9cfc643be0c2f147bfa49b503a7447ef06154f46469965dsize 184302123version https://git-lfs.github.com/spec/v1oid sha256:e5441860108c9d0dc83f869bb3de0909d36382ceada4791c9e919556f81e9e5dsize 83389261123version https://git-lfs.github.com/spec/v1oid sha256:1165091351583dd9b06ceed67097a7d6651aae2370bc221259adf13f6bcfede0size 294123456789101112131415161718192021222324252627282930313233343536{ "dataset_id": "m4", "model": "forestdiffusion", "inputs": { "train_csv": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-train.csv", "exists": true, "size": 92191, "sha256": "396b9d409ca21bf4a4cd329bdf5b7796aa0ae6356fa8d89b8eb669b5880b81f1" }, "val_csv": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-val.csv", "exists": true, "size": 11482, "sha256": "ee3c247d02f56e1687d03c381e13125d6a3a2a411ac7f202ba8520a4be9f1784" }, "test_csv": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-test.csv", "exists": true, "size": 11559, "sha256": "cadb9941124001b8fa7cb1ebae43b70a9ca56294f4df4d3c2f22c164c41757d4" }, "profile_json": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/artifacts/data_core/tabular/m4/m4-dataset_profile.json", "exists": true, "size": 3336, "sha256": "83e2764810e4a0e8cdece3a28dbd9134b7c9df6f2e56953e46d024ad2c4e035f" }, "contract_json": { "path": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/artifacts/data_core/tabular/m4/m4-dataset_contract_v1.json", "exists": true, "size": 3810, "sha256": "c23641b258629a845b164099bd0132886f8f6d0100e990494e0f92540f8987d9" } }}123version https://git-lfs.github.com/spec/v1oid sha256:e5441860108c9d0dc83f869bb3de0909d36382ceada4791c9e919556f81e9e5dsize 83389261123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147{ "dataset_id": "m4", "target_column": "charges", "task_type": "regression", "columns": [ { "name": "age", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 47, "unique_ratio": 0.0212, "example_values": [ "46", "38", "19", "27", "26" ] } }, { "name": "sex", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "female", "male" ] } }, { "name": "bmi", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 538, "unique_ratio": 0.24267, "example_values": [ "23.655", "19.3", "30.59", "32.67", "29.45" ] } }, { "name": "children", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 6, "unique_ratio": 0.002706, "example_values": [ "1", "0", "3", "2", "5" ] } }, { "name": "smoker", "role": "feature", "semantic_type": "boolean", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "yes", "no" ] } }, { "name": "region", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 4, "unique_ratio": 0.001804, "example_values": [ "northwest", "southwest", "southeast", "northeast" ] } }, { "name": "charges", "role": "target", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 1281, "unique_ratio": 0.577808, "example_values": [ "21677.28345", "15820.699", "1639.5631", "2497.0383", "2897.3235" ] } } ]}12345678910111213141516171819202122232425262728293031323334353637{ "dataset_id": "m4", "status": "pass", "checks": [ { "check_id": "PG001_csv_parse_ok", "status": "pass" }, { "check_id": "PG002_split_header_consistent", "status": "pass" }, { "check_id": "PG003_profile_header_match", "status": "pass" }, { "check_id": "PG004_missing_token_normalized", "status": "pass" }, { "check_id": "PG005_semantic_type_validated", "status": "pass" }, { "check_id": "PG006_target_defined_and_valid", "status": "pass" } ], "target_column": "charges", "task_type": "regression", "input_splits": { "train": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-train.csv", "val": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-val.csv", "test": "/data/jialinzhang/SynthesizePipeline-server/DatasetNew/m4/m4-test.csv" }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152{ "dataset_id": "m4", "target_column": "charges", "task_type": "regression", "train_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/forestdiffusion/forest-m4-20260501_180515/staged/public/train.csv", "val_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/forestdiffusion/forest-m4-20260501_180515/staged/public/val.csv", "test_csv": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/forestdiffusion/forest-m4-20260501_180515/staged/public/test.csv", "features_json": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/forestdiffusion/forest-m4-20260501_180515/staged/public/staged_features.json", "public_gate_report": "/data/jialinzhang/SynthesizePipeline-server/output-Benchmark-trainonly-v1/m4/forestdiffusion/forest-m4-20260501_180515/public_gate/public_gate_report.json", "column_schema": [ { "name": "age", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 47, "unique_ratio": 0.0212, "example_values": [ "46", "38", "19", "27", "26" ] } }, { "name": "sex", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "female", "male" ] } }, { "name": "bmi", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 538, "unique_ratio": 0.24267, "example_values": [ "23.655", "19.3", "30.59", "32.67", "29.45" ] } }, { "name": "children", "role": "feature", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 6, "unique_ratio": 0.002706, "example_values": [ "1", "0", "3", "2", "5" ] } }, { "name": "smoker", "role": "feature", "semantic_type": "boolean", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 2, "unique_ratio": 0.000902, "example_values": [ "yes", "no" ] } }, { "name": "region", "role": "feature", "semantic_type": "categorical", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "mode", "profile_stats": { "missing_rate": 0.0, "unique_count": 4, "unique_ratio": 0.001804, "example_values": [ "northwest", "southwest", "southeast", "northeast" ] } }, { "name": "charges", "role": "target", "semantic_type": "numeric", "nullable": false, "missing_tokens": [], "parse_format": null, "impute_strategy": "median", "profile_stats": { "missing_rate": 0.0, "unique_count": 1281, "unique_ratio": 0.577808, "example_values": [ "21677.28345", "15820.699", "1639.5631", "2497.0383", "2897.3235" ] } } ]}syntheticSuccess/m4/arf/arf-m4-20260501_224942/_arf_generate.pyAdded+93
syntheticSuccess/m4/arf/arf-m4-20260501_224942/_arf_train.pyAdded+37
syntheticSuccess/m4/arf/arf-m4-20260501_224942/arf-m4-2217-20260501_224949.csvAdded+3
syntheticSuccess/m4/arf/arf-m4-20260501_224942/arf_model.pklAdded+3
syntheticSuccess/m4/arf/arf-m4-20260501_224942/gen_20260501_224949.logAdded+3
syntheticSuccess/m4/arf/arf-m4-20260501_224942/input_snapshot.jsonAdded+36
syntheticSuccess/m4/arf/arf-m4-20260501_224942/public_gate/normalized_schema_snapshot.jsonAdded+147
syntheticSuccess/m4/arf/arf-m4-20260501_224942/public_gate/public_gate_report.jsonAdded+37
syntheticSuccess/m4/arf/arf-m4-20260501_224942/public_gate/staged_input_manifest.jsonAdded+152
syntheticSuccess/m4/arf/arf-m4-20260501_224942/runtime_result.jsonAdded+27
syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/arf/adapter_report.jsonAdded+7
syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/arf/adapter_transforms_applied.jsonAdded+1
syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/arf/model_input_manifest.jsonAdded+154
syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/public/staged_features.jsonAdded+37
syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/public/test.csvAdded+3
syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/public/train.csvAdded+3
syntheticSuccess/m4/arf/arf-m4-20260501_224942/staged/public/val.csvAdded+3
syntheticSuccess/m4/arf/arf-m4-20260501_224942/train_20260501_224942.logAdded+3
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/_bayesnet_generate.pyAdded+105
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/_bayesnet_train.pyAdded+133
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet-m4-2217-20260501_225008.csvAdded+3
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet_coltypes.jsonAdded+33
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/bayesnet_model.pklAdded+3
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/const_cols.jsonAdded+1
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/gen_20260501_225008.logAdded+3
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/input_snapshot.jsonAdded+36
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/public_gate/normalized_schema_snapshot.jsonAdded+147
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/public_gate/public_gate_report.jsonAdded+37
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/public_gate/staged_input_manifest.jsonAdded+152
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/runtime_result.jsonAdded+27
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/bayesnet/adapter_report.jsonAdded+7
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/bayesnet/adapter_transforms_applied.jsonAdded+1
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/bayesnet/model_input_manifest.jsonAdded+154
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/staged_features.jsonAdded+37
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/test.csvAdded+3
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/train.csvAdded+3
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/staged/public/val.csvAdded+3
syntheticSuccess/m4/bayesnet/bayesnet-m4-20260501_224959/train_20260501_224959.logAdded+3
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/_fd_X_host.npyAdded+3
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/_fd_gen.pyAdded+8
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/_fd_meta_host.jsonAdded+1
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/_fd_train.pyAdded+28
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/forest-m4-2217-20260501_180613.csvAdded+3
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/forestdiffusion_model.joblibAdded+3
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/gen_20260501_180613.logAdded+3
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/input_snapshot.jsonAdded+36
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/models_fd/model.joblibAdded+3
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/public_gate/normalized_schema_snapshot.jsonAdded+147
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/public_gate/public_gate_report.jsonAdded+37
syntheticSuccess/m4/forestdiffusion/forest-m4-20260501_180515/public_gate/staged_input_manifest.jsonAdded+152