{ "cells": [ { "cell_type": "markdown", "id": "a6c4301acabc", "metadata": {}, "source": "# Predictor identity and operation usage\n\nThis executable example uses synthetic input and a default no-network fixture. In explicit live mode it fits the qualified classifier; created synthetic datasets/predictors are retained. It never deletes state. Usage shows workload and lifecycle events, with no monetary rates or inferred prices." }, { "cell_type": "code", "id": "49eece00ca6b", "metadata": {}, "source": "from support import notebook_client, prepare\nclient = notebook_client()\ncolumns, query, predictor = prepare(client)", "outputs": [], "execution_count": null }, { "cell_type": "markdown", "id": "c172161c6baf", "metadata": {}, "source": "Inspect the immutable fitted identity and reopen it. Metadata export returns pinned server provenance only; names, deletion plans and recipes remain later routes; a predictor ID is not an exported executable model." }, { "cell_type": "code", "id": "b70603a31ba8", "metadata": {}, "source": "metadata = client.predictor(predictor[\"id\"])\nassert metadata[\"dataset_id\"] == predictor[\"dataset_id\"]\nassert metadata[\"model_version\"] == predictor[\"model_version\"]\nassert metadata[\"configuration\"] == predictor[\"configuration\"]\nassert any(p[\"id\"] == predictor[\"id\"] for p in client.predictors())\nclient.predict(predictor[\"id\"], columns=columns, rows=query.tolist(), probabilities=False)", "outputs": [], "execution_count": null }, { "cell_type": "markdown", "id": "2be6a56a278d", "metadata": {}, "source": "One logical fit can have queued/running/finished usage records. Count distinct operation IDs, not every event as another fit; preserve attempt/status details. Row/column metadata describes workloads, not charges." }, { "cell_type": "code", "id": "eff618c11f0f", "metadata": {}, "source": "events = [e for e in client.usage() if e.get(\"dataset_id\") == predictor[\"dataset_id\"]]\nfit_events = [e for e in events if e[\"kind\"] == \"fit\"]\nassert fit_events\nassert len({e[\"operation_id\"] for e in fit_events}) == 1\nassert any(e[\"status\"] == \"succeeded\" for e in fit_events)\nassert all(e[\"rows\"] >= 0 and e[\"columns\"] >= 0 for e in events)\nassert all(\"predictions\" not in e and \"probabilities\" not in e for e in events)\nassert {\"fit\", \"predict\"} <= {e[\"kind\"] for e in events}\nclient.close()", "outputs": [], "execution_count": null }, { "cell_type": "markdown", "id": "92c4718760ea", "metadata": {}, "source": "Cache eviction and process restart are independent operational checks. Reopening metadata here does not force or prove them. Datasets/predictors persist until explicit authorized deletion; seven-day temporary result access expiry is distinct from physical storage cleanup." } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 5 }