Model(...) to load it, conventionally as model=, and the lineage follows: datasets -> train -> model -> transform -> dataset.
The model object
AModel(...) binding, and the Output of a training, arrive as a TransformModel:
Documentation Index
Fetch the complete documentation index at: /atlas/llms.txt
Use this file to discover all available pages before exploring further.
Load a trained model in a transform and score a dataset with it.
Model(...) to load it, conventionally as model=, and the lineage follows: datasets -> train -> model -> transform -> dataset.
import joblib
from gwenlake.transforms import transform_df, Input, Model, Output
@transform_df(
customers=Input("Project_A.customers"),
model=Model("Project_A.churn"), # a model this transform loads
output=Output("Project_A.churn_scores"),
)
def predict(customers, model):
clf = joblib.load(model.file("model.pkl"))
return customers.assign(churn=clf.predict(customers))
Model(...) binding, and the Output of a training, arrive as a TransformModel:
| Member | Meaning |
|---|---|
model.path | the model’s directory in the repository checkout |
model.file("weights.pkl") | a path under it |
model.parameters, model.version | from the model card |
model.info() | the model card |
model.update(metrics=..., version=...) | update the card |
model.save(source, message=) | push artifacts from your machine and pin the model to them |
/models endpoints of the catalog are not exposed through the public gateway yet. model.info() and model.update() work from inside a build, but not from a local script. model.path never needs an API call.