Skip to content

ump_spec.models.planning

module ump-spec

Scenarios and optimisation results (spec §8 ladder, §12).

class

class PlanLine(StrictModel)

Fields

NameTypeDefaultDescription
media_idstr
spendfloat
region_idstr | NoneNone
periodstr | NoneNone
cost_basisLiteral['net', 'gross']'net'

Source: packages/ump-spec/src/ump_spec/models/planning.py, line 17

class

class ChannelResult(StrictModel)

Fields

NameTypeDefaultDescription
media_idstr
spendfloat
contributionShownNumber | NoneNone
marginal_roiShownNumber | NoneNone
outside_gridboolFalse

Source: packages/ump-spec/src/ump_spec/models/planning.py, line 25

class

class ScenarioResult(StrictModel)

Fields

NameTypeDefaultDescription
kpiShownNumber
per_channellist[ChannelResult]list()
ladder_stepLadderStep'full_model'
dependence_usedDependenceKind | NoneNone

Source: packages/ump-spec/src/ump_spec/models/planning.py, line 33

class

class Scenario(ArtifactDoc)

Fields

NameTypeDefaultDescription
client_idstr | NoneNone
namestr | NoneNone
model_idstr | NoneNone
endpoint_aliasstr | NoneNone
model_revisionstr | NoneNoneThe model revision this scenario was scored on (spec §12). The older member name revision is read for one cycle.
viewLiteral['full', 'curves', 'table']'full'
planlist[PlanLine]
resultsScenarioResult | NoneNone
assumptionsdict[str, Any]dict()
authorstr | NoneNone
purposestr | NoneNone
group_idstr | NoneNone
crn_seedint | NoneNone
thinning_indexstr | NoneNone
staleboolFalse
stale_since_versionint | NoneNone
fallbackslist[FallbackEntry]list()
noteslist[Note]list()
scenario_kindstr | NoneNoneKind of scenario: current, optimal, custom, … Written by planner (service.py) and Newton’s actor (actor_tools.py).
model_versionint | NoneNoneVersion of the model the scenario was scored on. Written by planner (service.py) and Newton’s actor (actor_tools.py).
model_content_hashstr | NoneNoneContent hash of that model version (§6). Written by planner (service.py) and Newton’s actor (actor_tools.py).
enginestr | NoneNoneWhat computed the scenario. Written by planner (service.py) and Newton’s actor (actor_tools.py).
ladder_stepstr | NoneNoneFallback-ladder rung the numbers came from (§8). Written by planner (service.py) and Newton’s actor (actor_tools.py).
dependencedict[str, Any] | str | NoneNoneDependence declaration used for the portfolio sums (§8). Written by planner (service.py) and Newton’s actor (actor_tools.py).
total_spendint | float | NoneNoneTotal planned spend. Written by planner (service.py) and Newton’s actor (actor_tools.py).
baseline_plandict[str, Any] | NoneNoneBaseline spend per channel. Written by planner (service.py) and Newton’s actor (actor_tools.py).
baseline_kpidict[str, Any] | NoneNoneBaseline KPI as a ShownNumber. Written by planner (service.py) and Newton’s actor (actor_tools.py).
upliftdict[str, Any] | NoneNoneUplift over the baseline as a ShownNumber. Written by planner (service.py) and Newton’s actor (actor_tools.py).
p_beat_planfloat | NoneNoneProbability the scenario beats the baseline plan. Written by planner (service.py) and Newton’s actor (actor_tools.py).
expected_regretfloat | NoneNoneExpected regret against the per-draw best plan. Written by planner (service.py) and Newton’s actor (actor_tools.py).
objectivestr | NoneNoneOptimiser objective: mean, p10 or cvar5. Written by planner (service.py) and Newton’s actor (actor_tools.py).
optimisation_result_idstr | NoneNoneThe optimisation result this scenario came from. Written by planner (service.py) and Newton’s actor (actor_tools.py).
allocationlist[Any] | NoneNoneAllocation lines copied from the optimisation result. Written by planner (service.py) and Newton’s actor (actor_tools.py).
audit_levelint | NoneNoneSpec §13 audit level of the run that made it. Written by planner (service.py) and Newton’s actor (actor_tools.py).
trust_levelint | NoneNoneTrust level shown with the numbers. Written by planner (service.py) and Newton’s actor (actor_tools.py).
seed_keystr | NoneNoneSeed-run key that made this scenario (e2e seed only). Written by planner (service.py) and Newton’s actor (actor_tools.py).
drafted_bystr | NoneNoneAgent principal that drafted the scenario. Written by planner (service.py) and Newton’s actor (actor_tools.py).
newton_sessionstr | NoneNoneNewton session that drafted this scenario. Written by planner (service.py) and Newton’s actor (actor_tools.py).
reader_findingslist[str] | NoneNoneReader finding ids the actor drew on (§17). Written by planner (service.py) and Newton’s actor (actor_tools.py).
reader_findings_untrustedlist[str] | NoneNoneReader finding ids marked untrusted text (§17). Written by planner (service.py) and Newton’s actor (actor_tools.py).
injection_flagged_findingslist[str] | NoneNoneReader findings flagged as possible prompt injection (§17). Written by planner (service.py) and Newton’s actor (actor_tools.py).
legacy_membersfrozenset[str]frozenset({'revision'})

Source: packages/ump-spec/src/ump_spec/models/planning.py, line 40

class

class AllocationLine(StrictModel)

Fields

NameTypeDefaultDescription
media_idstr
current_spendfloat
optimal_spendfloat
change_pctfloat | NoneNone
spend_intervalInterval | NoneNone

Source: packages/ump-spec/src/ump_spec/models/planning.py, line 168

class

class OptimisationResult(ArtifactDoc)

Fields

NameTypeDefaultDescription
client_idstr | NoneNone
model_idstr | NoneNone
enginestr | NoneNone
objectiveLiteral['mean', 'p10', 'cvar5']'mean'
total_budgetfloat
allocationlist[AllocationLine]
expected_kpiShownNumber
current_kpiShownNumber | NoneNone
upliftShownNumber | NoneNone
p_beat_planfloat | NoneNone
expected_regretfloat | NoneNone
dependenceDependenceKind | NoneNone
ladder_stepLadderStep'full_model'
fallbackslist[FallbackEntry]list()
noteslist[Note]list()
model_versionint | NoneNoneVersion of the model optimised against. Written by planner (optimise.py, service.py) and the planner adapters.
methodstr | NoneNoneOptimiser method, e.g. slsqp or greedy. Written by planner (optimise.py, service.py) and the planner adapters.
requested_objectivestr | NoneNoneObjective the caller asked for. Written by planner (optimise.py, service.py) and the planner adapters.
engine_requestedstr | NoneNoneEngine the caller asked for. Written by planner (optimise.py, service.py) and the planner adapters.
engine_versionstr | NoneNoneVersion of the engine that ran. Written by planner (optimise.py, service.py) and the planner adapters.
engine_resultdict[str, Any] | NoneNoneThe engine’s own result payload. Written by planner (optimise.py, service.py) and the planner adapters.
engine_result_digeststr | NoneNoneDigest of the engine’s raw result. Written by planner (optimise.py, service.py) and the planner adapters.
stubbool | NoneNoneTrue when a stub engine produced the result. Written by planner (optimise.py, service.py) and the planner adapters.
plandict[str, Any] | NoneNoneOptimal spend per channel. Written by planner (optimise.py, service.py) and the planner adapters.
current_plandict[str, Any] | NoneNoneCurrent spend per channel. Written by planner (optimise.py, service.py) and the planner adapters.
boundsdict[str, Any] | NoneNonePer-channel spend bounds [lo, hi]. Written by planner (optimise.py, service.py) and the planner adapters.
per_channellist[Any] | NoneNonePer-channel spend and contribution ShownNumbers. Written by planner (optimise.py, service.py) and the planner adapters.
convergencedict[str, Any] | NoneNoneOptimiser runs and the one chosen. Written by planner (optimise.py, service.py) and the planner adapters.
stabilitydict[str, Any] | NoneNoneShare stability across reoptimised draws. Written by planner (optimise.py, service.py) and the planner adapters.
per_draw_reoptimisedint | NoneNoneHow many draws were reoptimised for stability. Written by planner (optimise.py, service.py) and the planner adapters.
n_drawsint | NoneNoneDraws used. Written by planner (optimise.py, service.py) and the planner adapters.
crndict[str, Any] | NoneNoneCommon-random-numbers settings: seed, thinning index, draws. Written by planner (optimise.py, service.py) and the planner adapters.
shadow_pricedict[str, Any] | NoneNoneApproximate value of the next dollar, with its definition. Written by planner (optimise.py, service.py) and the planner adapters.
modestr | NoneNoneEngine mode, e.g. single. Written by planner (optimise.py, service.py) and the planner adapters.
kpi_resultslist[Any] | NoneNonePer-KPI results from the engine. Written by planner (optimise.py, service.py) and the planner adapters.
contributions_notestr | NoneNoneHow per-channel contributions were read. Written by planner (optimise.py, service.py) and the planner adapters.
fit_idstr | NoneNoneEngine fit id the result was computed from. Written by planner (optimise.py, service.py) and the planner adapters.
bundle_addressstr | NoneNoneWorkflow bundle address the engine ran (mapi-mmm). Written by planner (optimise.py, service.py) and the planner adapters.

Source: packages/ump-spec/src/ump_spec/models/planning.py, line 176

NameTypeValueDescription
LadderStepLiteral['full_model', 'curve_params', 'spend_table', 'summary', 'benchmarks',...