expct | R Documentation |
Compute the expectation of some query variable(s), optionally conditioned on some event(s).
expct(params, query = NULL, evidence = NULL)
params |
Circuit parameters learned via |
query |
Optional character vector of variable names. Estimates will be
computed for each. If |
evidence |
Optional set of conditioning events. This can take one of three forms: (1) a partial sample, i.e. a single row of data with some but not all columns; (2) a data frame of conditioning events, which allows for inequalities; or (3) a posterior distribution over leaves. See Details. |
This function computes expected values for any subset of features, optionally conditioned on some event(s).
A one row data frame with values for all query variables.
Watson, D., Blesch, K., Kapar, J., & Wright, M. (2023). Adversarial random forests for density estimation and generative modeling. In Proceedings of the 26th International Conference on Artificial Intelligence and Statistics, pp. 5357-5375.
adversarial_rf
, forde
, lik
# Train ARF and corresponding circuit
arf <- adversarial_rf(iris)
psi <- forde(arf, iris)
# What is the expected value Sepal.Length?
expct(psi, query = "Sepal.Length")
# What if we condition on Species = "setosa"?
evi <- data.frame(Species = "setosa")
expct(psi, query = "Sepal.Length", evidence = evi)
# Compute expectations for all features other than Species
expct(psi, evidence = evi)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.