arlc_fct_get_best_apriori_thresholds {arlclustering}R Documentation

Get Best Apriori Thresholds

Description

This function finds the best support and confidence thresholds for the Apriori algorithm to maximize the lift of the generated association rules.

Usage

arlc_fct_get_best_apriori_thresholds(transactions, support_range, conf)

Arguments

transactions

A transaction dataset of class transactions from the arules package.

support_range

A numeric vector specifying the range of support values to be tested.

conf

A numeric value (0.5 or 1.0) specifying the confidence value.

Details

This function iterates through the given ranges of support and confidence values, applies the Apriori algorithm to find association rules for each pair of values, and selects the pair that produces rules with the highest lift.

Value

A numeric vector containing the best support, best confidence, highest lift, and the number of rules found. The return value is a named vector with elements best_support, best_confidence, best_lift, and len_rules.

Examples


library(arlclustering)
sample_gml_file <- system.file("extdata", "karate.gml", package = "arlclustering")
g <- arlc_get_network_dataset(sample_gml_file, "Karate Club")
trans <- arlc_gen_transactions(g$graph)
supportRange <- seq(0.1, 0.2, by = 0.1)
Conf <- 0.5
best_thresholds <- arlc_fct_get_best_apriori_thresholds(trans, supportRange, Conf)



[Package arlclustering version 1.0.5 Index]