RuleGenerator<T> constructor

RuleGenerator<T>({
  1. required double minConfidence,
  2. required Map<List<T>, int> frequentItemsets,
  3. required int totalTransactions,
})

Creates a new RuleGenerator.

minConfidence is the minimum confidence for rules. frequentItemsets is the map of frequent itemsets to their support counts. totalTransactions is the total number of original transactions.

Implementation

RuleGenerator({
  required this.minConfidence,
  required this.frequentItemsets,
  required this.totalTransactions,
}) {
  // Populate the support cache for efficient lookups.
  for (final entry in frequentItemsets.entries) {
    _supportCache[entry.key.toSet()] = entry.value;
  }
}