class DataTraining {
  final double ppm;
  final int label; // 0 = Aman, 1 = Sedang, 2 = Bahaya

  const DataTraining(this.ppm, this.label);
}

const List<DataTraining> dataset = [
  // --- Volume 0 ml (Semua Status: Aman -> Label 0) ---
  DataTraining(0.00, 0), DataTraining(0.00, 0), DataTraining(0.00, 0), // Formalin murni 0ml
  DataTraining(0.00, 0), DataTraining(0.00, 0), DataTraining(0.00, 0), // Bakso 0ml
  DataTraining(0.00, 0), DataTraining(0.00, 0), DataTraining(0.00, 0), // Mie Ayam 0ml

  // --- Campuran Volume 1ml, 2ml, 3ml yang berstatus SEDANG (Label 1) ---
  DataTraining(0.51, 1), DataTraining(0.67, 1),             // Formalin murni 1ml (Percobaan 1 & 2 = Sedang)
  DataTraining(0.52, 1),                         // Mie Ayam 1ml (Percobaan 3 = Sedang)

  // --- Campuran Volume 1ml, 2ml, 3ml yang berstatus BAHAYA (Label 2) ---
  DataTraining(0.93, 2),                         // Formalin murni 1ml (Percobaan 3 = Bahaya)
  DataTraining(1.30, 2), DataTraining(2.37, 2), DataTraining(1.44, 2), // Formalin murni 2ml (Semua Bahaya)
  DataTraining(1.54, 2), DataTraining(2.81, 2), DataTraining(1.11, 2), // Formalin murni 3ml (Semua Bahaya)
  
  DataTraining(1.07, 2), DataTraining(0.76, 2), DataTraining(1.28, 2), // Bakso 1ml (Semua Bahaya)
  DataTraining(0.85, 2), DataTraining(1.05, 2), DataTraining(1.10, 2), // Bakso 2ml (Semua Bahaya)
  DataTraining(1.16, 2), DataTraining(1.18, 2), DataTraining(1.31, 2), // Bakso 3ml (Semua Bahaya)
  
  DataTraining(1.00, 2), DataTraining(1.00, 2),             // Mie Ayam 1ml (Percobaan 1 & 2 = Bahaya)
  DataTraining(0.88, 2), DataTraining(1.35, 2), DataTraining(0.71, 2), // Mie Ayam 2ml (Semua Bahaya)
  DataTraining(0.92, 2), DataTraining(1.89, 2), DataTraining(1.13, 2)  // Mie Ayam 3ml (Semua Bahaya)
];

String klasifikasiKNN(double inputPpm) {
  if (inputPpm < 0.30) return "Aman";
  if (inputPpm < 0.70) return "Sedang";
  return "Bahaya";
}
