prepare_xgboost_model: NLP modeling using xgboost.

Description Usage Arguments Examples

View source: R/wordly_functions.R

Description

Allows for modeling of Natural Language Processing (NLP) data using the xgboost package. Default param values are optimized for NLP.

Usage

1
2
3
4
prepare_xgboost_model(train_data, dtm_train_data, response_label_name,
  xgb_objective, xgb_nrounds = 100, xgb_max_depth = 20,
  xgb_eta = 0.1, xgb_nthread = 4, xgb_weight = NULL,
  xgb_missing = NA)

Arguments

train_data

The NON-DTM training input data.

dtm_train_data

The DTM training input data. Returned from prepare_dtm().

response_label_name

The name of the column in dat_in containing the text source.

xgb_objective

The xgboost parameter for objective (see xgboost documentation). One of "reg:linear", "binary:logistic", etc.

xgb_nrounds

The xgboost parameter for nrounds (see xgboost documentation). Defaults to 100.

xgb_max_depth

The xgboost parameter for max_depth (see xgboost documentation). Defaults to 20.

xgb_eta

The xgboost parameter for eta (see xgboost documentation). Defaults to 0.1.

xgb_nthread

The xgboost parameter for nthreads (see xgboost documentation). Defaults to 4.

xgb_weight

The xgboost parameter for weight (see xgboost documentation). Defaults to NULL.

xgb_missing

The xgboost parameter for missing (see xgboost documentation). Defaults to NA.

Examples

1
xgb_mod <- prepare_xgboost_model(train_, dtm_train, "product_review", xgb_objective = "binary:logistic")

tomathon-io/wordly documentation built on June 15, 2020, 12:41 a.m.