code: def kendall(y_true, y_pred, nb_sample=100000):
      
      y_true, y_pred = _mask_nan(y_true, y_pred)
      if len(y_true) > nb_sample:
          idx = np.arange(len(y_true))
          np.random.shuffle(idx)
          idx = idx[:nb_sample]
          y_true = y_true[idx]
          y_pred = y_pred[idx]
      return kendalltau(y_true, y_pred)[0]
docs: Kendall's tau coefficient, Kendall rank correlation coefficient