tl_anomaly_aware: Anomaly-Aware Supervised Learning

View source: R/integration.R

tl_anomaly_awareR Documentation

Anomaly-Aware Supervised Learning

Description

Detect outliers using DBSCAN or other methods, then optionally remove them or down-weight them before supervised learning.

Usage

tl_anomaly_aware(
  data,
  formula,
  response,
  anomaly_method = "dbscan",
  action = "flag",
  supervised_method = "logistic",
  ...
)

Arguments

data

A data frame

formula

Model formula

response

Response variable name

anomaly_method

Method for anomaly detection: "dbscan", "isolation_forest"

action

Action to take: "remove", "flag", "downweight"

supervised_method

Supervised learning method

...

Additional arguments

Value

A tidylearn model or list with model and anomaly info

Examples


model <- tl_anomaly_aware(iris, Species ~ ., response = "Species",
                           anomaly_method = "dbscan", action = "flag")


tidylearn documentation built on Feb. 6, 2026, 5:07 p.m.