The included synthetic fixture and Python standard library are sufficient to run the example. The configured support thresholds and projection limits are example parameters.
Run the example
Use Python 3.10 or later and an API key from the quickstart. Running this script creates one fresh Domain and sends the observations below. It never clears existing state.Environment
first_learned_result.py:
Copy the complete Python program
Copy the complete Python program
first_learned_result.py
Read your actual responses
The script prints the before, after, and retained-use responses and saves them in full. Read the saved prediction and support fields for your run. The recorded projection trace shows admission and later prediction fields from a separate run.
Early events may report
projection_accumulating while Discovery forms a usable projection. They can be buffered and rebuilt when the projection becomes ready. Review learner_eligibility in each saved receipt to check whether the event was admitted to learning.
Only consume predicted values when transition_prediction.status is predicted. Keep the returned prediction object and its support information. Extract the target value using the response contract for your configured target.
The final comparison checks exposed transition sample counts and model versions. Other learner subsystems need their own frozen-state checks. See Choose a learning setup for the full evaluation boundary.
Task contract and learned result
Discovery selects eligible inputs from the records; the application supplies the target path and type. Completed measurements provide the observed target directly through events.
Reconnect, rerun, or clean up?
Reconnect, rerun, or clean up?
Keep the printed Domain ID and the same authenticated owner to reconnect to retained state. Running this script again intentionally creates a new Domain. It never resets or deletes the old one. Remove a tutorial Domain only through an explicit, ID-scoped deletion after deciding its state is no longer needed. The local response files can contain application data; protect them accordingly.
Use your own records
Replace the fixture with completed application records and the query with current measurements. Keep the target unavailable at query time. A new target path or type requires a matching event contract. Reserve evaluation records before ingestion to measure prediction quality on separate cases.Other prediction and Discovery patterns
Use categorical outputs, structural discovery, or before/after observations.
Learn from an executed decision
Bind the measured outcome to a policy and inspect the later preference.
