| Outcome | R Documentation |
Outcome / partial residual used to sample an additive model. The outcome class is a wrapper around a vector of (mutable) outcomes for ML tasks (supervised learning, causal inference). When an additive tree ensemble is sampled, the outcome used to sample a specific model term is the "partial residual" consisting of the outcome minus the predictions of every other model term (trees, group random effects, etc...).
This class is intended for advanced use cases in which users require detailed control of sampling algorithms and data structures. Minimal input validation and error checks are performed – users are responsible for providing the correct inputs. For tutorials on the "proper" usage of the stochtree's advanced workflow, we provide several vignettes at https://stochtree.ai/
data_ptrExternal pointer to a C++ Outcome class
new()Create a new Outcome object.
Outcome$new(outcome)
outcomeVector of outcome values
A new Outcome object.
get_data()Extract raw data in R from the underlying C++ object
Outcome$get_data()
R vector containing (copy of) the values in Outcome object
add_vector()Update the current state of the outcome (i.e. partial residual) data by adding the values of update_vector
Outcome$add_vector(update_vector)
update_vectorVector to be added to outcome
None
subtract_vector()Update the current state of the outcome (i.e. partial residual) data by subtracting the values of update_vector
Outcome$subtract_vector(update_vector)
update_vectorVector to be subtracted from outcome
None
update_data()Update the current state of the outcome (i.e. partial residual) data by replacing each element with the elements of new_vector
Outcome$update_data(new_vector)
new_vectorVector from which to overwrite the current data
None
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.