bind_numerical_vars: bind_numerical_vars

Description Usage Arguments Value

View source: R/bind_numerical_vars.R

Description

Add numerical variables to the document term matrices such as follower count, favourites, and reach.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
bind_numerical_vars(
  labelled_raw,
  unlabelled_raw,
  full_labelled_dtm,
  train_labelled_dtm,
  valid_labelled_dtm,
  unlabelled_dtm,
  numerical_vars,
  val_split = 0.2
)

Arguments

labelled_raw

Original labelled dataframe before any pre-processing.

unlabelled_raw

Original unlabelled datafame before any pre-processing.

full_labelled_dtm

Full labelled document term matrix.

train_labelled_dtm

Training labelled document term matrix.

valid_labelled_dtm

Validation labelled document term matrix.

unlabelled_dtm

Unlabelled document term matrix.

numerical_vars

List of numerical variables to include.

val_split

The amount of training data that should be included in the validation set. Must be the same as in create_dt_matrices function. Default: 0.2.

Value

A complete labelled document-term matrix, a labelled document-term matrix split into training and validation sets, and an unlabelled document-term matrix used for predictions.


rosepeglershare/TagR documentation built on Dec. 31, 2020, 3:12 a.m.