in reply to Perk/Tk error..
You mean to ask why some variable is not defined when some code tries to call ->predict on it? This question cannot be answered without code to examine.