also: Attribute-wise Learning for Scoring Outliers.

Description Usage Arguments Value References Examples

Description

Attribute-wise Learning for Scoring Outliers.

Usage

1
2
also(data, scale_numerics = TRUE, method, cross_validate = TRUE,
  n_folds = 5, scores_only = TRUE, ...)

Arguments

data

a matrix or data.frame.

scale_numerics

logical, if TRUE then center and scale numeric variables. If FALSE then ignore scaling

method

a function name in the form of a character string which is passed to formula (e.g. 'lm')

cross_validate

logical indicating the use of cross validation for scoring

n_folds

an integer specifying the number of folds if cross validating. Defaults to 5

scores_only

logical, if TRUE return outlier scores only. If FALSE return a list with outlier scores and the error matrix

...

additional arguments passed to method

Value

If scores_only = TRUE, only outlier scores are returned. If FALSE, the function returns a list containing outlier scores, feature RMSE, feature weights, raw prediction error matrix, squared prediction error matrix, and feature weighted squared prediction error matrix

References

see "Outlier Analysis" (C.C Aggarwal. Springer, 2017) section 7.7

Examples

1
2
3
4
5
6
7
8
# OLS with cross validation for out of sample scoring
also(data = state.x77, scale_numerics = TRUE, method = 'lm', cross_validate = TRUE, 
n_folds = 10, scores_only = TRUE)

# random forest without cross validation#'  
rf_also <- also(data = scale(state.x77), scale_numerics = FALSE, method = 'randomForest', 
cross_validate = FALSE, scores_only = FALSE)
rf_also$scores; rf_also$feature_weights; rf_also$raw_error_matrix

dannymorris/outsiders documentation built on May 13, 2019, 1:22 p.m.