code: def make_dict_learning_scorers(caller):
      caller.train_scorer = lambda _, __: (
          neg_mean_data_error(
              caller.X,
              caller.estimator.transform(caller.X),
              caller.estimator.components_,
          )
      )
      caller.test_scorer = lambda _, __: (
          neg_mean_data_error(
              caller.X_val,
              caller.estimator.transform(caller.X_val),
              caller.estimator.components_,
          )
      )
  
file_path: scikit-learn/asv_benchmarks/benchmarks/utils.py
imports: import numpy
  from sklearn.metrics import balanced_accuracy_score, r2_score
label_desc: Use image node_id 5 for calling a global function with example usage: make_dict_learning_scorers(caller) without return types