code: def get_salsa_estimator_from_data_and_hyperparams(
      X_tr,
      Y_tr,
      kernel_type,
      add_order,
      kernel_scale,
      bandwidths,
      l2_reg,
  ):
      """Returns an estimator using the data."""
      problem_dim = np.array(X_tr).shape[1]
      kernel = get_salsa_kernel_from_params(
          kernel_type, add_order, kernel_scale, bandwidths, problem_dim
      )
  
      def _get_mean_func(_mean_func_const_value):
          """Returns the mean function from the constant value."""
          return lambda x: np.array([_mean_func_const_value] * len(x))
  
      mean_func = _get_mean_func(np.median(Y_tr))
      salsa_obj = SALSA(X_tr, Y_tr, kernel, mean_func, l2_reg)
      return salsa_obj.eval
  
imports: from __future__ import print_function
  import numpy
  from scipy.linalg import solve_triangular
label_desc: Use image node_id 8 for calling a global function with example usage: get_salsa_estimator_from_data_and_hyperparams(X_tr, Y_tr, kernel_type, add_order, kernel_scale, bandwidths, l2_reg) and returns: salsa_obj, function