code: def _get_metrics(model, train_set, test_set):
      train_set = train_set.tocsr()
      test_set = test_set.tocsr()
  
      train_set.data[train_set.data < 0] = 0.0
      test_set.data[test_set.data < 0] = 0.0
  
      train_set.eliminate_zeros()
      test_set.eliminate_zeros()
  
      return (
          precision_at_k(model, train_set).mean(),
          precision_at_k(model, test_set).mean(),
          auc_score(model, train_set).mean(),
          auc_score(model, test_set).mean(),
      )
  
imports: import pickle
  import numpy
  import scipy.sparse
  from scipy import stats
  from sklearn.metrics import roc_auc_score
  from sklearn.model_selection import KFold, RandomizedSearchCV
  from lightfm.lightfm import LightFM
  from lightfm.datasets import fetch_movielens
  from lightfm.evaluation import auc_score, precision_at_k
label_desc: Use image node_id 1 for calling a global function with example usage: _get_metrics(model, train_set, test_set) and returns: precision_at_k,  precision_at_k,  auc_score,  auc_score