class_docstr: Grouped KNN density estimator.
  
  Keeps track of the group (e.g. video id) from which the features were sampled for normalization purposes.
  
  Args:
      n_neighbors (int): Number of neighbors used in KNN search.
docstr: Update the internal feature bank while keeping track of the group.
  
  Args:
      features (Tensor): Feature vectors extracted from a video frame.
      group (Any): Identifier of the group (video) from which the frame was sampled.
code: def update(self, features: Tensor, group: Any = None) -> None:
      """Update the internal feature bank while keeping track of the group.
  
      Args:
          features (Tensor): Feature vectors extracted from a video frame.
          group (Any): Identifier of the group (video) from which the frame was sampled.
      """
      group = group or "default"
  
      if group in self.memory_bank:
          self.memory_bank[group].append(features)
      else:
          self.memory_bank[group] = [features]
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from typing import Any
  import torch
  from sklearn.mixture import GaussianMixture
  from torch import Tensor, nn
  from anomalib.models.ai_vad.features import FeatureType
  from anomalib.utils.metrics.min_max import MinMax
label_desc: Use image node_id 2 for calling the GroupedKNNEstimator obj's underlying member method code with example usage: obj.update(features, group) without return types