Typed result objects returned from every Experiment operation.
Every PyCaret 4.0 verb (compare_models, create_model, tune_model, ...)
returns a frozen dataclass. This gives us three things simultaneously:
- Notebook compatibility — the result's
.pipeline(or.models/.best) is still a sklearn Pipeline you can use directly, and thepull()functional still returns the leaderboard DataFrame. - Agent / UI friendliness — all fields are introspectable, typed, and serializable (except the sklearn Pipeline itself, which carries its own pickling contract via joblib/cloudpickle).
- Event trace — every result carries the
Eventlist produced during its operation so a UI can replay progress after the fact.
Fields that a React UI / LLM agent cares about are first-class; convenience fields (DataFrames) are derived or side-channel.