compute_predictions: Compute predictions

Description Usage Arguments Value

View source: R/5-compute-predictions.R

Description

Computes predictions from a trained viewpoint regression model. The following routines will typically be run first:

  1. compute_viewpoints

  2. compute_ppm_analyses

  3. compute_model_matrix

  4. viewpoint_regression

Usage

1
2
3
4
5
6
7
compute_predictions(
  parent_dir,
  weights = NULL,
  model_matrix_dir = file.path(parent_dir, "2-model-matrix"),
  regression_dir = file.path(parent_dir, "3-viewpoint-regression"),
  output_dir = file.path(parent_dir, "4-predictions")
)

Arguments

parent_dir

(Character scalar) The parent directory for the output files, shared with functions such as compute_viewpoints and compute_ppm_analyses. Ignored if all other directory arguments are manually specified.

weights

If NULL (default), the regression weights are extracted from the viewpoint regression model output in regression_dir. Alternatively, the weights can be manually specified as a named numeric vector where the names correspond to the label column of the tibble stored in predictors.rds in model_matrix_dir.

model_matrix_dir

(Character scalar) The directory for the already-generated output files from compute_model_matrix. The default should be correct if the user used the default dir argument in compute_model_matrix.

regression_dir

(Character scalar) The directory for the already-generated output files from viewpoint_regression. The default should be correct if the user used the default dir argument in viewpoint_regression.

output_dir

(Character scalar) The output directory for the new results. Will be created if it doesn't exist already.

Value

A tibble with one row for each event in the model matrix, with the following columns:


pmcharrison/hvr documentation built on April 14, 2020, 2:47 a.m.