import pandas as pd
from sklearn.datasets import fetch_california_housing
from synthefy import SynthefyNoriClient
X, y = fetch_california_housing(return_X_y=True, as_frame=True)
df = X.copy()
df["price"] = y
target_col = "price"
feature_cols = [c for c in df.columns if c != target_col]
train = df.sample(frac=0.8, random_state=42)
test = df.drop(train.index)
client = SynthefyNoriClient(mode="local")
predictions = client.predict(
train[feature_cols].values,
train[target_col].values,
test[feature_cols].values,
)
test["predicted_price"] = predictions
print(test[["price", "predicted_price"]].head())