Running EBM model in a function

As usual, please provide a complete MWE, full stacktrace, and a proper description of your experienced issue and the expected behaviour.