Thanks for the feedback. As someone just getting started in this area, I was having trouble finding clear examples. Using the R interface probably isn't the best way to get started with custom loss functions, because the error messages you get from nested python calls are usually not too descriptive.