do_predict: Make predictions

View source: R/do_predict.R

do_predictR Documentation

Make predictions

Description

Make predictions for new tweets, appending to existing predictions and SHAP values.

Usage

do_predict(
  tweets_transformed,
  stem = get_valid_stems(),
  overwrite = TRUE,
  fit = NULL,
  path_fit = NULL,
  ...,
  .overwrite = list(preds = NULL, shap = NULL),
  .path = list(preds = NULL, shap = NULL)
)

Arguments

tweets_transformed

Tweets retrieved from retrieve_tweets() and passed into transform_tweeets()

stem

Either "favorite" or "retweet"

overwrite

Whether to overwrite existing fit, predictions, and SHAP values.

fit

xgboost fit

path_fit

If fit is not provided, then the fit is imported from path_fit.

...

Unused

.overwrite

Specific booleans for overwriting specific outputs saved to file. Default is to use same value as overwrite. Only use this if you know what you're doing.

.path

Specific paths to export the predictions and SHAP values to. If left as NULL, they are saved as "preds_{stem}.rds" and "shap_{stem}.rds" in the directory at getOption("xengagement.dir_data"). As with .overwrite, only use this if you know what you're doing.


tonyelhabr/xengagement documentation built on June 22, 2022, 5 a.m.