Delta Lake
Last updated
aporia.create_model("<MODEL_ID>", "<MODEL_NAME>")apr_model = aporia.create_model_version(
model_id="<MODEL_ID>",
model_version="v1",
model_type="binary"
raw_inputs={
"raw_text": "text",
},
features={
"amount": "numeric",
"owner": "string",
"is_new": "boolean",
"embeddings": {"type": "tensor", "dimensions": [768]},
},
predictions={
"will_buy_insurance": "boolean",
"proba": "numeric",
},
)data_source = S3DataSource(
object_path="s3://my-bucket/my-file.parquet"
object_format="delta",
# Optional - use the select_expr param to apply additional Spark SQL
select_expr=["<SPARK_SQL>", ...],
# Optional - use the read_options param to apply any Spark configuration
# (e.g custom Spark resources necessary for this model)
read_options={...}
)
apr_model.connect_serving(
data_source=data_source,
# Names of the prediction ID and prediction timestamp columns
id_column="prediction_id",
timestamp_column="prediction_timestamp",
)