private function generateRules(array $frequent): void
    {
        foreach ($this->antecedents($frequent) as $antecedent) {
            $confidence = $this->confidence($frequent, $antecedent);
            if ($this->confidence <= $confidence) {
                $consequent = array_values(array_diff($frequent, $antecedent));
                $this->rules[] = [
                    self::ARRAY_KEY_ANTECEDENT => $antecedent,
                    self::ARRAY_KEY_CONSEQUENT => $consequent,
                    self::ARRAY_KEY_SUPPORT => $this->support($frequent),
                    self::ARRAY_KEY_CONFIDENCE => $confidence,
                ];
            }
        }
    }