code: def calculate_hit_at_one(predictions, actuals):
      """Performs a local (numpy) calculation of the hit at one.
  
      Args:
        predictions: Matrix containing the outputs of the model.
          Dimensions are 'batch' x 'num_classes'.
        actuals: Matrix containing the ground truth labels.
          Dimensions are 'batch' x 'num_classes'.
  
      Returns:
        float: The average hit at one across the entire batch.
      """
      top_prediction = numpy.argmax(predictions, 1)
      hits = actuals[numpy.arange(actuals.shape[0]), top_prediction]
      return numpy.average(hits)
  
file_path: PaddleHub/modules/video/classification/videotag_tsn_lstm/resource/metrics/youtube8m/eval_util.py
imports: import datetime
  import numpy
  from .None import mean_average_precision_calculator
  from .None import average_precision_calculator
label_desc: Use image node_id 2 for calling a global function with example usage: calculate_hit_at_one(predictions, actuals) and returns: numpy