code: def ratio_of_ones(y_true, y_pred):
      true_ones = [label for label in y_true if label == 1]
      pred_ones = [label for label in y_pred if label == 1]
      return len(pred_ones) / (len(true_ones) + len(pred_ones))
  
file_path: skll/tests/other/custom_metrics.py
imports: from sklearn.metrics import average_precision_score, f1_score, fbeta_score, precision_score, r2_score, roc_auc_score
label_desc: Use image node_id 2 for calling a global function with example usage: ratio_of_ones(y_true, y_pred) and returns: unknown