| gif | R Documentation |
The function builds a generalized isolation forest that uses fuzzy logic to determine if a record is anomalous or not.
The function takes a wide-format data.frame object as input and returns it with two appended vectors.
The first vector contains the anomaly scores as numbers between zero and one, and the second vector provides
a set of logical values indicating whether the records are outliers (TRUE) or not (FALSE).
gif(dta, nt = 100L, nss = NULL, threshold = 0.95)
dta |
A wide-format |
nt |
Number of generalized isolation trees to build to form the forest. By default, it is set to |
nss |
Number of subsamples used to build a single generalized isolation tree.
If set (by default) to |
threshold |
A number between zero and one used as a threshold when identifying outliers from the anomaly scores.
By default, this argument is set to |
The argument dta is provided as an object of class data.frame.
This object is considered as a wide-format data.frame.
The use of the R-packages dplyr, purrr, and tidyr is highly recommended to simplify the conversion of datasets between long and wide formats.
The wide-format data.frame is provided as input data and contains extra columns:
A numeric vector of anomaly scores ranging from 0 to 1, where values closer to 1 indicate higher anomaly.
A logical vector indicating whether each record is flagged as an outlier (TRUE) or not (FALSE) based on the specified threshold.
Luca Sartore drwolf85@gmail.com
## Not run:
# Load the package
library(HRTnomaly)
set.seed(2025L)
# Detect outliers in the `iris` dataset
res <- gif(iris)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.