"""Statistical analysis, recommendation, and intervention constants."""
from wisent.core.constant_definitions.for_experiments.by_domain.analysis.infra import *  # noqa: F401,F403

# --- Recommendation thresholds ---
RECOMMEND_LINEAR_PROBE_HIGH = 0.85
RECOMMEND_LINEAR_PROBE_LOW = 0.65
RECOMMEND_NONLINEARITY_GAP = 0.05
RECOMMEND_ICD_HIGH = 0.7
RECOMMEND_ICD_LOW = 0.3
RECOMMEND_STABILITY_HIGH = 0.8
RECOMMEND_STABILITY_LOW = 0.5
RECOMMEND_TOP_K = 2
RECOMMEND_N_TRIALS = 500
RECOMMEND_COLLECTOR_PER_TYPE = 2

# --- Recommendation extended thresholds ---
RECOMMEND_MULTI_CONCEPT_SILHOUETTE = 0.3
RECOMMEND_ALIGNMENT_HIGH = 0.3
RECOMMEND_ALIGNMENT_LOW = 0.1
RECOMMEND_VARIANCE_CONCENTRATED = 0.15
RECOMMEND_EFFECTIVE_DIMS_LOW = 20.0
RECOMMEND_MULTI_DIR_GAIN_HIGH = 0.05
RECOMMEND_COHERENCE_HIGH = 0.8
RECOMMEND_COHERENCE_LOW = 0.5
RECOMMEND_ICD_TOP5_THRESHOLD = 0.4
RECOMMEND_NOT_VIABLE_SCALE = 0.5
RECOMMEND_CONFIDENCE_BASE = 0.5
RECOMMEND_CONFIDENCE_MARGIN_WEIGHT = 0.5
RECOMMEND_BASELINE_CONFIDENCE = 0.3

# --- Vector quality thresholds ---
VQ_CONVERGENCE_CRITICAL = 0.5
VQ_CONVERGENCE_WARNING = 0.75
VQ_CV_SCORE_CRITICAL = 0.3
VQ_CV_SCORE_WARNING = 0.6
VQ_SNR_CRITICAL = 10.0
VQ_SNR_WARNING = 30.0
VQ_PCA_VARIANCE_CRITICAL = 0.05
VQ_PCA_VARIANCE_WARNING = 0.15
VQ_ALIGNMENT_STD_WARNING = 0.30
VQ_ALIGNMENT_MIN_CRITICAL = 0.2
VQ_SILHOUETTE_CRITICAL = -0.1
VQ_SILHOUETTE_WARNING = 0.05
VQ_MIN_PAIRS = 5

# --- Intervention selection thresholds ---
INTERVENTION_CONFIDENCE_BASE = 0.5
INTERVENTION_MARGIN_WEIGHT = 0.3
INTERVENTION_Z_NORMALIZER = 3.0
INTERVENTION_CONF_STD_FACTOR = 0.1
INTERVENTION_MIN_SILHOUETTE = 0.1

# --- Intervention scoring increments ---
INTERVENTION_SCORE_LOW_DIM_CAA = 1.0
INTERVENTION_SCORE_LOW_DIM_OSTRZE = 0.5
INTERVENTION_SCORE_NO_LOW_DIM = 0.5
INTERVENTION_SCORE_LINEAR_CAA = 2.0
INTERVENTION_SCORE_LINEAR_OSTRZE = 1.5
INTERVENTION_SCORE_NONLINEAR_MLP = 1.5
INTERVENTION_SCORE_NONLINEAR_OSTRZE = 1.0
INTERVENTION_SCORE_NONLINEAR_GROM = 0.5
INTERVENTION_SCORE_FRAGMENTED_TECZA = 2.0
INTERVENTION_SCORE_FRAGMENTED_GROM = 1.0
INTERVENTION_SCORE_FRAGMENTED_CAA_PENALTY = -1.0
INTERVENTION_SCORE_SINGLE_CAA = 0.5
INTERVENTION_SCORE_TRANSLATION_CAA = 1.0

# --- Statistical power analysis ---
POWER_EXCELLENT_THRESHOLD = 0.9
POWER_LOW_THRESHOLD = 0.5
MDE_SMALL_THRESHOLD = 0.3
MDE_MEDIUM_THRESHOLD = 0.6
MDE_LARGE_THRESHOLD = 1.0

# --- Shrinkage interpretation ---
SHRINKAGE_LOW = 0.1
SHRINKAGE_MODERATE = 0.3
SHRINKAGE_HIGH = 0.6

# --- Guided weight modification scoring ---
GUIDED_MIN_LINEAR_SCORE = 0.5
GUIDED_SURGICAL_TOP_K = 3
GUIDED_FISHER_WEIGHT_MIN = 0.1
GUIDED_FISHER_WEIGHT_MAX = 2.0
GUIDED_MAX_DEGRADATION = 0.1
GUIDED_VARIANCE_THRESHOLD = 0.05
GUIDED_STRONG_SIGNAL = 0.8
GUIDED_MODERATE_SIGNAL = 0.6
GUIDED_FISHER_MAX_BOOST = 0.3
GUIDED_FISHER_BOOST_SCALE = 0.1
GUIDED_FISHER_LOG_DIVISOR = 5.0
GUIDED_EFFECT_MAX_BOOST = 0.2
GUIDED_EFFECT_BOOST_SCALE = 0.1
GUIDED_COHENS_D_NORMALIZER = 2.0
GUIDED_NONLINEAR_PENALTY = 0.5
GUIDED_WEIGHT_MAX = 1.5

# --- Signal analysis ---
SIGNAL_NULL_MEAN = 0.5
SIGNAL_NULL_STD = 0.1
SIGNAL_SATURATION_DELTA = 0.02
SIGNAL_POWER_SAMPLE_SIZES = (10, 20, 50, 100, 200, 500)
SIGNAL_ICD_THRESHOLD = 20
SIGNAL_EXIST_THRESHOLD = 0.6
SIGNAL_LINEAR_GAP = 0.15
SIGNAL_STRENGTH_THRESHOLD = 0.6
SIGNAL_PROBE_ACCURACY_THRESHOLD = 0.6
SIGNAL_BASELINE_RATIO_DEFAULT = 1.0

# --- Effectiveness thresholds ---
EFFECTIVENESS_HIGH = 0.1
EFFECTIVENESS_MODERATE = 0.05
EFFECTIVENESS_SLIGHT = 0.01

# --- Strategy diagnostics scoring ---
STRATEGY_DIAG_W_LINEAR = 0.3
STRATEGY_DIAG_W_CONSISTENCY = 0.4
STRATEGY_DIAG_W_STEERING = 0.3
STRATEGY_DIAG_AB_THRESHOLD = 0.5
STRATEGY_DIAG_AB_PENALTY = 0.5
STRATEGY_DIAG_NONLINEAR_GAP = 0.05
STRATEGY_DIAG_LOW_CONSISTENCY = 0.1
STRATEGY_DIAG_LOW_LINEAR_ACC = 0.7
STRATEGY_DIAG_LOW_SEMANTIC = 0.05

# --- Probe metrics ---
PROBE_MIN_PER_CLASS = 5
PROBE_SMALL_HIDDEN = 16
PROBE_MLP_HIDDEN = 64
PROBE_MLP_ALPHA = 0.01
PROBE_VALIDATION_FRACTION = 0.1
PROBE_KNN_K = 10

# --- Direction stability metrics ---
DIRECTION_N_BOOTSTRAP = 30
DIRECTION_SUBSET_FRACTION = 0.5
DIRECTION_STD_PENALTY = 0.5
CONSISTENCY_W_COSINE = 0.4
CONSISTENCY_W_POSITIVE = 0.3
CONSISTENCY_W_HIGH_SIM = 0.3

# --- Concept analysis ---
CONCEPT_MIN_SAMPLES = 10
CONCEPT_SEPARABILITY_HIGH = 0.95
CONCEPT_MIXED_PAIR_THRESHOLD = 0.3
CONCEPT_K_MAX = 10
CONCEPT_PCA_COMPONENTS = 20
CONCEPT_TOP_SINGULAR_VALUES = 10
CONCEPT_STABILITY_N_BOOTSTRAP = 20
CONCEPT_CORRELATION_HIGH = 0.5
CONCEPT_CORRELATION_MODERATE = 0.2

# --- Concept detection ---
CONCEPT_PCA_VARIANCE_90 = 0.90
CONCEPT_BIC_STRONG_THRESHOLD = 10
CONCEPT_SILHOUETTE_STRONG = 0.15
CONCEPT_SILHOUETTE_MODERATE = 0.08
CONCEPT_DIRECTION_DISTINCT = 0.15
CONCEPT_DIRECTION_MODERATE = 0.25
CONCEPT_STABILITY_THRESHOLD = 0.85
CONCEPT_K_DIRECTION_THRESHOLD = 0.20
CONCEPT_DETECTION_DEFAULT_N = 2

# --- ICD thresholds ---
ICD_SINGLE_CONCEPT_THRESHOLD = 20
ICD_MODERATE_THRESHOLD = 100
SILHOUETTE_MULTI_CONCEPT_THRESHOLD = 0.3
SILHOUETTE_WEAK_MULTI_THRESHOLD = 0.2

# --- Sparsity metrics ---
SPARSITY_THRESHOLD_FRACTION = 0.01

# --- Kernel steering ---
KERNEL_DISTANCE_FRACTION = 0.6
KERNEL_MIN_ALPHA = 0.5

# --- Bootstrap confidence ---
BOOTSTRAP_CI_LOW_DEFAULT = 0.4
BOOTSTRAP_CI_HIGH_DEFAULT = 0.6

# --- Significance ---
SIGNIFICANCE_MARGIN = 0.1

# --- Dip test / direction consistency ---
DIP_TEST_SIMULATIONS = 1000
DIRECTION_N_SPLITS = 10
DENSITY_RATIO_DEFAULT = 1.0

# --- Sample adequacy ratios (n/d) ---
SAMPLE_RATIO_ADEQUATE = 20
SAMPLE_RATIO_GOOD = 10
SAMPLE_RATIO_ACCEPTABLE = 5
SAMPLE_RATIO_MARGINAL = 2

# --- N stability / CV ---
N_STABILITY_RUNS = 5
CV_FOLDS = 5
VAL_SPLIT = 0.2

# --- Dimensionality diagnostics ---
SHRINKAGE_INTENSITY_THRESHOLD = 0.3
STATISTICAL_POWER_THRESHOLD = 0.5
PCA_MAX_COMPONENTS_NULL = 50
