Add early termination to ensemble model training and serialization/deserialization