fortify_stranger: Merge stranger/singular objects to a dataset

fortify.anomaliesR Documentation

Merge stranger/singular objects to a dataset

Description

fortify method for anomalies, stranger and singular objects to enrich data. Usually, this is invoked on source data. For obvious precautions, this is done on an id column as managed by the typical workflow (crazyfy). In case you enrich data without any specific id, it is just assumed to have those data in the same order than data used in anomaly detection computations – this behavior may really needs to unwanted results.

Usage

## S3 method for class 'anomalies'
fortify(x, data = NULL, id = NULL, colname = "flag_anomaly", ...)

## S3 method for class 'stranger'
fortify(x, data = NULL, id = NULL, all.x = TRUE, all.y = FALSE, ...)

## S3 method for class 'singular'
fortify(x, data = NULL, id = NULL, all.x = TRUE, all.y = FALSE, ...)

Arguments

x

anomalies objects as generated by a call to get_anomalies.

data

data to enrich; if NULL (default), we use the data used during computation

id

character - name of the id column. No need to specify this if you follow the recommended process using either first add_id or crazyfy.

colname

character - name of the column to be created for the flag (default: flag_anomaly).

...

fortify generic parameter – not used for stranger objects.

all.x

merge parameter

all.y

merge parameter


welovedatascience/stranger documentation built on Oct. 12, 2022, 10:52 p.m.