def gmse_factory(gamma): def gamma_mse(y_true, y_pred): return gamma * mean_squared_error(y_true, y_pred) return gamma_mse