public Model<T> reproduceFromProvenance() throws ClassNotFoundException {

        // Until now the object only holds the configuration for these objects, the following
        // functions will actually re-instantiate them.
        Trainer<T> newTrainer = recoverTrainer();

        Dataset<T> newDataset = recoverDataset();

        // Exposing the configuration manager means there could be an edge case were
        // the invocation count is changed before the model is trained.
        // Pass through a desired invocation count to prevent this behavior
        // TODO: does not apply to inner trainers, figure out how to address this or if it needs to be addressed
        int trainedInvocationCount = (int) this.modelProvenance
                .getTrainerProvenance()
                .getInstanceValues()
                .get("train-invocation-count")
                .getValue();

        // This function actually re-trains a model rather than copy the original
        return newTrainer.train(newDataset);
    }
@Test
    public void testBaggingTrainer() throws IOException, ClassNotFoundException {
        //TODO: Will need more extensive testing here
        CARTRegressionTrainer subsamplingTree = new CARTRegressionTrainer(Integer.MAX_VALUE,
                MIN_EXAMPLES, 0.0f, 0.5f, false, new MeanSquaredError(), Trainer.DEFAULT_SEED);
        RandomForestTrainer<Regressor> rfT = new RandomForestTrainer<>(subsamplingTree,new AveragingCombiner(),10);
        Dataset<Regressor> trainData = new MutableDataset<>(getConfigurableRegressionDenseTrain());
        Model<Regressor> model = rfT.train(trainData);

        ReproUtil<Regressor> reproUtil = new ReproUtil<>(model.getProvenance(),Regressor.class);

        Model<Regressor> reproducedModel = reproUtil.reproduceFromProvenance();

        assertEquals(model.getProvenance().getTrainerProvenance().getInstanceValues().get("train-invocation-count"),
                reproducedModel.getProvenance().getTrainerProvenance().getInstanceValues().get("train-invocation-count"));

    }