Conditioning examples - #16
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 87f66ac. Configure here.
| return dataframe_to_history_rows(query_rows, schema, field="query_rows") | ||
| return [dict(row) for row in query_rows] | ||
|
|
||
|
|
There was a problem hiding this comment.
Arrays helper cannot score log_prob
Low Severity
build_forecast_payload_from_arrays still accepts return_mode="log_prob" but has no query_rows argument, so the new request check that log_prob and query_rows must appear together now rejects every arrays-built scoring payload. Callers who previously built the payload here and attached query_rows afterward can no longer get a payload back.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 87f66ac. Configure here.


Note
Medium Risk
Introduces a new public forecast return mode and stricter response parsing on the core contract path; behavior is well covered by tests but mistakes in validation or parsing would affect all log-prob callers.
Overview
Adds first-class
log_probscoring:JointFMClient.forecast_log_prob(...)takesquery_rows(one observed row perquery_times) and returnsLogProbResult/LogProbScores, withForecastRequestenforcing thatreturn_mode="log_prob"andquery_rowsstay paired and thatrequested_columnslists every readable column in schema order (pinned equality columns excepted).Request building and adapters accept
query_rows(DataFrame encoding reuses history row conversion withquery_rows[...]error paths). Response parsing addsoutputs.log_prob, recomputes summary fields from per-horizon values, and refuses unknownreturn_modes instead of mis-reading another mode’s shape.ConditionPlausibilitydocs clarify joint densities and how equality and region plausibility chain.notebooks/forecast_condition.ipynbgrows into a full conditioning walkthrough: unconditional vs conditional means, joint samples, quantiles inside bands, multi-interval box estimation, rally ranking via log-density differences, and conditionalforecast_log_probfor comparing outcomes. README anddocs/api-reference.mddocument the helper and wire fields; fixtures andtests/test_log_prob_mode.pycover validation and client round-trips.Reviewed by Cursor Bugbot for commit 87f66ac. Configure here.