<?php

declare(strict_types=1);

namespace App\Framework\Waf\MachineLearning;

/**
 * Interface for anomaly detectors that support feature weight adjustments
 */
interface FeatureWeightAdjustableInterface
{
    /**
     * Adjust the weights of specific features
     *
     * Positive adjustment: Increase feature importance
     * Negative adjustment: Decrease feature importance
     *
     * @param array<string, float> $adjustments Map of feature names to adjustment values
     * @return array<string, float> Map of feature names to their new weights
     */
    public function adjustFeatureWeights(array $adjustments): array;

    /**
     * Get the current weight for a specific feature
     *
     * @param string $featureName Name of the feature
     * @return float|null Current weight or null if feature not found
     */
    public function getFeatureWeight(string $featureName): ?float;

    /**
     * Set the weight for a specific feature
     *
     * @param string $featureName Name of the feature
     * @param float $weight New weight value
     * @return bool True if setting was successful
     */
    public function setFeatureWeight(string $featureName, float $weight): bool;

    /**
     * Get all feature weights
     *
     * @return array<string, float> Map of feature names to their weights
     */
    public function getAllFeatureWeights(): array;

    /**
     * Reset all feature weights to their default values
     *
     * @return bool True if reset was successful
     */
    public function resetFeatureWeights(): bool;
}
