code: def join(self):
      data_file = open(self.data_file_name, "r")
      predict_file = open(self.predict_file_name, "r")
  
      range_val = self.max_val - self.min_val
      zero_one_h = abs(range_val) * self.zero_one_width
      N = 0
      abs_loss_acc = 0.0
      sqr_loss_acc = 0.0
      zero_one_loss_acc = 0.0
      abs_loss_max = float("-inf")
      sqr_loss_max = float("-inf")
      max_found = float("-inf")
      min_found = float("inf")
      for data_line, predict_line in zip(data_file, predict_file):
          # Get data
          act = self.get_action(predict_line)
          reg = self.get_regression_val(data_line)
          # Compute losses
          abss = abs((reg - act) / range_val)
          if abss > abs_loss_max:
              abs_loss_max = abss
          abs_loss_acc += abss
          sqrr = ((reg - act) / range_val) ** 2
          if sqrr > sqr_loss_max:
              sqr_loss_max = sqrr
          sqr_loss_acc += sqrr
          if not math.isclose(act, reg, abs_tol=zero_one_h):
              zero_one_loss_acc += 1.0
          N += 1
          if reg > max_found:
              max_found = reg
          if reg < min_found:
              min_found = reg
  
      abs_loss = abs_loss_acc / float(N)
      sqr_loss = sqr_loss_acc / float(N)
      zero_one_loss = zero_one_loss_acc / float(N)
  
      if self.loss_type_return == "abs":
          return abs_loss, abs_loss_max, N
      elif self.loss_type_return == "sqr":
          return sqr_loss, sqr_loss_max, N
      elif self.loss_type_return == "zerone":
          return zero_one_loss, 1, N
  
file_path: vowpal_wabbit/demo/cats/utility/ap_regression_data_join.py
imports: import sys
  import getopt
  import math
label_desc: Use image node_id 2 for calling the PredictDataJoiner_ap obj's underlying member method code with example usage: obj.join() and returns: abs_loss,  abs_loss_max,  N, sqr_loss,  sqr_loss_max,  N, zero_one_loss,  int,  N