{
  "snapshot_date": "2026-04-27",
  "sensor_barcode": 50051,
  "methodology": {
    "training": "Each test setup is trained independently on its own segments only (matches the live tool when one experiment is toggled off).",
    "classifier": "KNN (k=3, distance-weighted, class-balanced)",
    "features": [
      "maxDrop",
      "maxRise",
      "sipmMaxDrop",
      "sipmMaxRise",
      "boardMaxDrop",
      "boardMaxRise",
      "uvledBoardDiff"
    ],
    "aggregation": "Raw (no aggregation; each diagnostic + tof reading joined nearest-time within \u00b12 min)",
    "evaluation": "Leave-One-Region-Out (LORO) cross-validation per segment",
    "air_strip": "KNN-predicted Air with signal_per_spad_kcps < 80 is downgraded to Still \u2014 the classifier is not allowed to call Air without optical evidence",
    "note_on_air_override": "The forward Air override (turb \u2265 80 \u2192 force Air regardless of KNN) is OFF in this analysis to match the live dashboard. With it ON, accuracy drops by ~6% on Closed Pipe Flow due to ~40 Still segments containing transient high-turbidity points that flip the segment majority to Air.",
    "segment_label_assignment": "Majority vote over per-point predictions within the segment"
  },
  "experiments": [
    {
      "id": "closed",
      "label": "Closed Pipe Flow",
      "window": "2026-04-13 14:00 \u2192 2026-04-16 12:15",
      "description": "Pump-driven flow through a closed pipe loop, alternating ~15 min flowing + ~45 min still per hour."
    },
    {
      "id": "bucket",
      "label": "Filling/Draining Bucket",
      "window": "2026-04-17 15:24 \u2192 present",
      "description": "Bucket dispenser filling and draining with intermittent Air exposure between fills."
    }
  ],
  "closed": {
    "segments": 142,
    "points": 696,
    "correct": 667,
    "accuracy": 0.9583333333333334,
    "balanced_accuracy": 0.6479230349991706,
    "kappa": 0.8887284033650508,
    "confusion": {
      "Air": {
        "Still": 13
      },
      "Flowing": {
        "Flowing": 156,
        "Still": 6
      },
      "Still": {
        "Still": 511,
        "Flowing": 10
      }
    },
    "per_class": {
      "Air": {
        "n": 13,
        "recall": 0.0,
        "precision": null,
        "f1": null
      },
      "Flowing": {
        "n": 162,
        "recall": 0.9629629629629629,
        "precision": 0.9397590361445783,
        "f1": 0.9512195121951219
      },
      "Still": {
        "n": 521,
        "recall": 0.980806142034549,
        "precision": 0.9641509433962264,
        "f1": 0.972407231208373
      }
    }
  },
  "bucket": {
    "segments": 276,
    "points": 903,
    "correct": 761,
    "accuracy": 0.8427464008859358,
    "balanced_accuracy": 0.8558813329550112,
    "kappa": 0.7523007023806765,
    "confusion": {
      "Air": {
        "Air": 395,
        "Flowing": 18,
        "Still": 72
      },
      "Flowing": {
        "Flowing": 186,
        "Still": 32
      },
      "Still": {
        "Still": 180,
        "Air": 2,
        "Flowing": 18
      }
    },
    "per_class": {
      "Air": {
        "n": 485,
        "recall": 0.8144329896907216,
        "precision": 0.9949622166246851,
        "f1": 0.8956916099773242
      },
      "Flowing": {
        "n": 218,
        "recall": 0.8532110091743119,
        "precision": 0.8378378378378378,
        "f1": 0.8454545454545455
      },
      "Still": {
        "n": 200,
        "recall": 0.9,
        "precision": 0.6338028169014085,
        "f1": 0.7438016528925621
      }
    }
  },
  "overall": {
    "segments": 418,
    "points": 1599,
    "correct": 1428,
    "accuracy": 0.8930581613508443,
    "balanced_accuracy": 0.8838546047342398,
    "kappa": 0.8317112486082568,
    "confusion": {
      "Air": {
        "Still": 85,
        "Air": 395,
        "Flowing": 18
      },
      "Flowing": {
        "Flowing": 342,
        "Still": 38
      },
      "Still": {
        "Still": 691,
        "Flowing": 28,
        "Air": 2
      }
    },
    "per_class": {
      "Air": {
        "n": 498,
        "recall": 0.7931726907630522,
        "precision": 0.9949622166246851,
        "f1": 0.88268156424581
      },
      "Flowing": {
        "n": 380,
        "recall": 0.9,
        "precision": 0.8814432989690721,
        "f1": 0.890625
      },
      "Still": {
        "n": 721,
        "recall": 0.9583911234396671,
        "precision": 0.8488943488943489,
        "f1": 0.9003257328990228
      }
    }
  }
}
