grid.predict function

Helper function for applying predict methods to stacks of grids.