📊
export_powerbi
Returns a JSON string representing a PowerBI Push dataset. Paste into the PowerBI REST API or save to .json.
📋
export_tableau_tds
Returns a Tableau Data Source XML (.tds). Defines all columns — open in Tableau Desktop to connect instantly.
📁
export_tableau_csv
Returns a CSV string with a header row. Includes feature columns, optional target and optional predictions.
🔗
Combine with Registry
Export predictions from a registry-loaded model payload and share reproducible exports alongside versioned models.
import seraplot as sp, numpy as np
X = np.random.randn(200, 3)
y = X[:, 0] * 2 + np.random.randn(200) * 0.1
model = sp.LinearRegression()
model.fit(X, y)
yhat = model.predict(X)
pbi_json = sp.export_powerbi(
name = "HousePrice",
table = "Predictions",
X = X,
y = list(y),
y_pred = list(yhat),
)
with open("powerbi_dataset.json", "w") as f:
f.write(pbi_json)
tds_xml = sp.export_tableau_tds(
name = "HousePrice",
X = X,
y = list(y),
y_pred = list(yhat),
)
with open("house_price.tds", "w") as f:
f.write(tds_xml)
csv_str = sp.export_tableau_csv(
name = "HousePrice",
X = X,
y = list(y),
y_pred = list(yhat),
)
with open("house_price.csv", "w") as f:
f.write(csv_str)
export_powerbi
| Parameter | Type | Default | Description |
name | str | — | Dataset name (appears in PowerBI) |
table | str | — | Table name inside the dataset |
X | list[list[float]] | — | Feature matrix, shape (n, p) |
y | list[float] | None | None | Target values (optional) |
y_pred | list[float] | None | None | Predicted values (optional) |
Returns → str — PowerBI Push dataset JSON
export_tableau_tds
| Parameter | Type | Default | Description |
name | str | — | Data source name in Tableau |
X | list[list[float]] | — | Feature matrix |
y | list[float] | None | None | Target values (optional) |
y_pred | list[float] | None | None | Predicted values (optional) |
Returns → str — Tableau TDS XML
export_tableau_csv
| Parameter | Type | Default | Description |
name | str | — | Used as comment in header row |
X | list[list[float]] | — | Feature matrix |
y | list[float] | None | None | Target values (optional) |
y_pred | list[float] | None | None | Predicted values (optional) |
Returns → str — CSV with header row (feat_0, feat_1, …, target, prediction)
ℹ️
Column names are auto-generated: feat_0 … feat_{p-1}, target, prediction. All functions return strings — write them to disk or POST them to the relevant API.
export_powerbi
| Paramètre | Type | Défaut | Description |
name | str | — | Nom du dataset (visible dans PowerBI) |
table | str | — | Nom de la table dans le dataset |
X | list[list[float]] | — | Matrice de features, forme (n, p) |
y | list[float] | None | None | Valeurs cibles (optionnel) |
y_pred | list[float] | None | None | Prédictions (optionnel) |
Retourne → str — JSON Push dataset PowerBI
export_tableau_tds
| Paramètre | Type | Défaut | Description |
name | str | — | Nom de la source de données dans Tableau |
X | list[list[float]] | — | Matrice de features |
y | list[float] | None | None | Valeurs cibles (optionnel) |
y_pred | list[float] | None | None | Prédictions (optionnel) |
Retourne → str — XML Tableau TDS
export_tableau_csv
| Paramètre | Type | Défaut | Description |
name | str | — | Utilisé en commentaire dans la ligne d'en-tête |
X | list[list[float]] | — | Matrice de features |
y | list[float] | None | None | Valeurs cibles (optionnel) |
y_pred | list[float] | None | None | Prédictions (optionnel) |
Retourne → str — CSV avec en-tête (feat_0, feat_1, …, target, prediction)
💡
Les colonnes sont nommées automatiquement : feat_0 … feat_{p-1}, target, prediction. Toutes les fonctions retournent des chaînes de caractères — écrivez-les sur disque ou envoyez-les à l'API concernée via HTTP POST.