metadata_dict = metadata.to_dict()
diagnostic = DiagnosticReport()
diagnostic.generate(real_data=actual, synthetic_data=synthetic_sdv, metadata=metadata_dict, verbose=True)
print("Diagnostic rating:", diagnostic.get_score())
high quality = QualityReport()
high quality.generate(real_data=actual, synthetic_data=synthetic_sdv, metadata=metadata_dict, verbose=True)
print("High quality rating:", high quality.get_score())
def show_report_details(report, title):
print(f"n===== {title} particulars =====")
props = report.get_properties()
for p in props:
print(f"n--- {p} ---")
particulars = report.get_details(property_name=p)
strive:
show(particulars.head(10))
besides Exception:
show(particulars)
show_report_details(diagnostic, "DiagnosticReport")
show_report_details(high quality, "QualityReport")
train_real, test_real = train_test_split(
actual, test_size=0.25, random_state=42, stratify=actual[target_col]
)
def make_pipeline(cat_cols, num_cols):
pre = ColumnTransformer(
transformers=[
("cat", OneHotEncoder(handle_unknown="ignore"), cat_cols),
("num", "passthrough", num_cols),
],
the rest="drop"
)
clf = LogisticRegression(max_iter=200)
return Pipeline([("pre", pre), ("clf", clf)])
pipe_syn = make_pipeline(categorical_cols, numerical_cols)
pipe_syn.match(synthetic_sdv.drop(columns=[target_col]), synthetic_sdv[target_col])
proba_syn = pipe_syn.predict_proba(test_real.drop(columns=[target_col]))[:, 1]
y_true = (test_real[target_col].astype(str).str.incorporates(">")).astype(int)
auc_syn = roc_auc_score(y_true, proba_syn)
print("Artificial-train -> Actual-test AUC:", auc_syn)
pipe_real = make_pipeline(categorical_cols, numerical_cols)
pipe_real.match(train_real.drop(columns=[target_col]), train_real[target_col])
proba_real = pipe_real.predict_proba(test_real.drop(columns=[target_col]))[:, 1]
auc_real = roc_auc_score(y_true, proba_real)
print("Actual-train -> Actual-test AUC:", auc_real)
model_path = "ctgan_sdv_synth.pkl"
synth.save(model_path)
print("Saved synthesizer to:", model_path)
from sdv.utils import load_synthesizer
synth_loaded = load_synthesizer(model_path)
synthetic_loaded = synth_loaded.pattern(1000)
print("Loaded synthesizer pattern:")
show(synthetic_loaded.head())
Saturday, February 14
Trending
- Banks Ought to Embrace Stablecoin Yield in CLARITY Act: White Home Adviser
- Lecturers Jobs 2026 in Opal Crown College Quetta 2026 Job Commercial Pakistan
- Hatsune Miku Honkai: Star Rail Artwork Shared Forward of 4.0
- Arsenal held by Brentford in EPL
- Airbnb says a 3rd of its buyer help is now dealt with by AI within the U.S. and Canada
- 5 Life Adjustments That Sign It is Time for a Checking Account
- Metrolinx CEO guarantees fewer authorized battles on future Ontario transit initiatives
- Defiant TTAP stage sit-in at Parliament Home over Imran’s well being, vow to stay till calls for fulfilled – Pakistan
- Analysts from Fortrade Assessment the Summit from a Monetary Level of View
- XRP In The Highlight After Ripple CEO’s Gorgeous Disclosure That May Change Its Outlook

![[In-Depth Guide] The Full CTGAN + SDV Pipeline for Excessive-Constancy Artificial Knowledge [In-Depth Guide] The Full CTGAN + SDV Pipeline for Excessive-Constancy Artificial Knowledge](https://thenews92.com/wp-content/uploads/2026/02/blog-banner23-22-1024x731.png)