When calling setK(), the models need to exist. This isn't true until after training. That's probably not an intuitive workflow.