#!/bin/bash
#SBATCH --job-name=classic_individual_explanations
#SBATCH --output=logs/classic_individual_explanations_%A_%a.out
#SBATCH --error=logs/classic_individual_explanations_%A_%a.err
#SBATCH --array=0-99  # Updated: (2 labels * 5 clusters * 10 cluster size) - 1
#SBATCH --time=10:00:00
#SBATCH --cpus-per-task=1
#SBATCH --constraint="hsw"

TASK_ID=$SLURM_ARRAY_TASK_ID
DATASET="wine"

# Configuration
NUM_LABELS=2
NUM_CLUSTERS=5
CLUSTER_SIZE=10

# Compute indices
LABEL=$((TASK_ID / (NUM_CLUSTERS * CLUSTER_SIZE)))
SAMPLE_INDEX=$((TASK_ID % (NUM_CLUSTERS * CLUSTER_SIZE)))

echo "Running task $TASK_ID on dataset $DATASET with LABEL=$LABEL and SAMPLE=$SAMPLE_INDEX"

python -m scripts.tools.generate_explanations \
    --dataset "$DATASET" \
    --explainer individual \
    --label "$LABEL" \
    --sample-index "$SAMPLE_INDEX" \
    --num-explanations 100000 \
    --num-consumers 1 \
    --output data/logs/cluster/classic/individual-explanations/"$DATASET"_label_"$LABEL"_sample_"$SAMPLE_INDEX".json
