rbartpackages.dbarts.updatePredictorPerObservationJointly¶
- rbartpackages.dbarts.updatePredictorPerObservationJointly(samplers, x, column, *, updateState=None)[source]¶
Jointly update a shared predictor column, one observation at a time.
- Parameters:
samplers (
dbarts|Sequence[dbarts]) – A sampler, or several sharing the same (index-aligned) observations.x (
Float64[ndarray, 'n']) – The new values of the shared column, one per observation.column (
int|str) – The 1-based index or the name of the shared column. An index refers to the first sampler and is matched by name in the others, so every sampler needs named predictor columns.updateState (
bool|None, default:None) – Whether to refresh the samplers’ cached states afterwards;Noneleaves each of them to its owncontrol.
- Returns:
Bool[ndarray, 'n']– One flag per observation, telling whether its new value was installed in all the samplers.
Notes
This is the multi-sampler counterpart of
dbarts.setPredictorwithforceUpdate='partial': an observation’s new value is installed only if it leaves every leaf of every tree of every sampler non-empty, and is rolled back in all of them otherwise. The tree structures are unchanged; only the observations are re-routed.