rarefun: Functions for Rare Events Analysis

Overview

rarefun is an R package that provides a collection of functions for detecting and analyzing rare events in datasets. The package includes implementations of various anomaly detection methods and tools for spatial and temporal analysis of rare events.

Features

Installation

You can install the development version of rarefun from GitHub:

# install.packages("devtools")
# devtools::install_github("vlyubchich/rarefun")
install.packages("rarefun", repos = c('https://vlyubchich.r-universe.dev', 'https://cloud.r-project.org'))

Usage

library(rarefun)

# Example: Detect anomalies using Isolation Forest
set.seed(123)
data <- matrix(rnorm(1000), nrow = 500)
data[1:5, ] <- data[1:5, ] + 10  # Add some outliers

result <- rare_iforest(data, ntrees = 100, threshold = 0.7)
table(result$is_anomaly)

Authors

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Bug reports

If you encounter any bugs or issues, please report them at: https://github.com/vlyubchich/rarefun/issues