f_predict_regression_add_predictions: adds predictions, residuals, abolute residuals, squared...

Description Usage Arguments Details Value Examples

Description

absolute percent error = (abs(resid/pred)*100 )

Usage

1
2
f_predict_regression_add_predictions(data_test, m, col_target = NULL,
  data_train = NULL, cols_id = NULL, formula = NULL, ...)

Arguments

data_test

dataframe containing data to be used as the basis for prediction. Can also be a modelR resample object

m

regression model

col_target

character vector naming target/response variable

data_train

dataframe with trainig data, Default: 'NULL'

cols_id

character vector naming id columns, if specified non_id columns will be dropped from dataframe, in order to be more memory efficient.

formula

Default NULL

...

additional arguments passed to HDtweedie and glmnet predict functions

Details

works with HDtweedie, randomForest, rpart, e1071::svm, glmnet, gamlss, caret

Value

dataframe

dataframe

Examples

1
2
3
4
5
df = mtcars %>%
mutate(names = row.names(.))
m = rpart::rpart(disp~., df)
pred = f_predict_regression_add_predictions(df, m, 'disp', 'names')
pred

erblast/oetteR documentation built on May 27, 2019, 12:11 p.m.