step_outliers_h2o.extendedIsolationForest: Calculate the h2o package extendedIsolationForest outlier...

View source: R/h2o.extendedIsolationForest.R

step_outliers_h2o.extendedIsolationForestR Documentation

Calculate the h2o package extendedIsolationForest outlier "score"

Description

step_outliers_h2o.extendedIsolationForest creates a specification of a recipe step that will calculate the outlier score using h2o.extendedIsolationForest from h2o.

Usage

step_outliers_h2o.extendedIsolationForest(
  recipe,
  ...,
  role = NA,
  trained = FALSE,
  outlier_score = NULL,
  columns = NULL,
  name_mutate = ".outliers_h2o.extendedIsolationForest",
  options = list(extension_level = "max"),
  init_options = list(),
  skip = TRUE,
  id = rand_id("outliers_h2o.extendedIsolationForest")
)

## S3 method for class 'step_outliers_h2o.extendedIsolationForest'
tidy(x, ...)

Arguments

recipe

A recipe object. The step will be added to the sequence of operations for this recipe.

...

One or more selector functions to choose variables for this step. See selections() for more details.

role

not defined for this function

trained

A logical to indicate if the quantities for preprocessing have been estimated.

outlier_score

a placeholder for the exit of this function don't change

columns

A character string of variable names that will be populated (eventually) by the terms argument.

name_mutate

the name of the generated column with h2o.extendedIsolationForest scores

options

a list with arguments to h2o::h2o.extendedIsolationForest function.

init_options

a list with parameters to h2o::h2o.init

skip

A logical. Should the step be skipped when the recipe is baked by bake()? While all operations are baked when prep() is run, some operations may not be able to be conducted on new data (e.g. processing the outcome variable(s)). Care should be taken when using skip = TRUE as it may affect the computations for subsequent operations.

id

A character string that is unique to this step to identify it.

x

A step_outliers_h2o.extendedIsolationForest object.

Details

All columns in the data are sampled and returned by juice() and bake().

When used in modeling, users should strongly consider using the option skip = TRUE so that this operation is not conducted outside of the training set.

Value

An updated version of recipe with the new step added to the sequence of existing steps (if any), with the name on name_mutate and the scores calculated. For the tidy method, a tibble with columns index (the row indexes of the tibble) and outlier_score (the scores).

Examples

library(recipes)
library(tidy.outliers)
rec <-
  recipe(mpg ~ ., data = mtcars) %>%
  step_outliers_h2o.extendedIsolationForest(all_predictors()) %>%
  prep(mtcars)

bake(rec, new_data = NULL)

tidy(rec, number = 1)

brunocarlin/tidy.outliers documentation built on Feb. 22, 2023, 8:24 p.m.