class_docstr: Base class for models
class_docstr_tok: ["Base","class","for","models"]
docstr: Devide `labels` and `preds` into several group according to values in group keys.
  
  Args:
      labels (list): ground truth label list.
      preds (list): prediction score list.
      group_keys (list): group key list.
  
  Returns:
      list, list:
      - Labels after group.
      - Predictions after group.
docstr_tok: ["Devide","`","labels","`","and","`","preds","`","into","several","group","according","to","values","in","group","keys",".","Args",":","labels","(","list",")",":","ground","truth","label","list",".","preds","(","list",")",":","prediction","score","list",".","group_keys","(","list",")",":","group","key","list",".","Returns",":","list",",","list",":","-","Labels","after","group",".","-","Predictions","after","group","."]
code: def group_labels(self, labels, preds, group_keys):
      """Devide `labels` and `preds` into several group according to values in group keys.
  
      Args:
          labels (list): ground truth label list.
          preds (list): prediction score list.
          group_keys (list): group key list.
  
      Returns:
          list, list:
          - Labels after group.
          - Predictions after group.
      """
      all_keys = list(set(group_keys))
      group_labels = {k: [] for k in all_keys}
      group_preds = {k: [] for k in all_keys}
      for label, p, k in zip(labels, preds, group_keys):
          group_labels[k].append(label)
          group_preds[k].append(p)
      all_labels = []
      all_preds = []
      for k in all_keys:
          all_labels.append(group_labels[k])
          all_preds.append(group_preds[k])
      return all_labels, all_preds
  
imports: from os.path import join
  import abc
  import time
  import os
  import numpy
  import tensorflow
  from recommenders.models.deeprec.deeprec_utils import cal_metric
label_desc: Use image node_id 22 for calling the BaseModel obj's underlying member method code with example usage: obj.group_labels(labels, preds, group_keys) and returns: all_labels,  all_preds