added train model now function for deployed algo