public ModelReproduction<T> reproduceFromModel() throws ClassNotFoundException, JsonProcessingException {
        if(this.originalModel == null){
            throw new IllegalStateException("No model to reproduce was provided");
        }

        Model<T> newModel = reproduceFromProvenance();

        TreeSet<String> newFeatureKeys = new TreeSet<>(newModel.getFeatureIDMap().keySet());
        TreeSet<String> oldFeatureKeys = new TreeSet<>(originalModel.getFeatureIDMap().keySet());

        TreeSet<String> intersectionOfKeys = new TreeSet<>(newModel.getFeatureIDMap().keySet());
        intersectionOfKeys.retainAll(oldFeatureKeys);
        newFeatureKeys.removeAll(intersectionOfKeys);
        oldFeatureKeys.removeAll(intersectionOfKeys);

        Set<T> oldDomain = originalModel.getOutputIDInfo().generateMutableOutputInfo().getDomain();
        Set<T> newDomain = newModel.getOutputIDInfo().generateMutableOutputInfo().getDomain();
        Set<T> intersectionOfDomains = newModel.getOutputIDInfo().generateMutableOutputInfo().getDomain();
        intersectionOfDomains.retainAll(oldDomain);
        newDomain.removeAll(intersectionOfDomains);
        oldDomain.removeAll(intersectionOfDomains);

        ModelReproduction<T> modelReproduction = new ModelReproduction<>(
                newModel,
                new FeatureDiff(oldFeatureKeys, newFeatureKeys),
                new OutputDiff<>(oldDomain, newDomain),
                ReproUtil.diffProvenance(newModel.getProvenance(), originalModel.getProvenance()));

        return modelReproduction;
    }
@Test
    public void testReproduceFromModel() throws IOException, URISyntaxException, ClassNotFoundException {
        CSVDataSource<Label> csvSource = getCSVDataSource();
        MutableDataset<Label> datasetFromCSV = new MutableDataset<>(csvSource);

        LogisticRegressionTrainer trainer = new LogisticRegressionTrainer();
        LinearSGDModel model = (LinearSGDModel) trainer.train(datasetFromCSV);
        model = (LinearSGDModel) trainer.train(datasetFromCSV);
        model = (LinearSGDModel) trainer.train(datasetFromCSV);

        ReproUtil<Label> reproUtil = new ReproUtil<>(model);
        ReproUtil.ModelReproduction<Label> modelReproduction = reproUtil.reproduceFromModel();
        LinearSGDModel newModel = (LinearSGDModel) modelReproduction.model();

        assertEquals(0, modelReproduction.featureDiff().reproducedFeatures().size());
        assertEquals(0, modelReproduction.featureDiff().originalFeatures().size());

        assertEquals(0, modelReproduction.outputDiff().reproducedOutput().size());
        assertEquals(0, modelReproduction.outputDiff().originalOutput().size());

        assertEquals(newModel.getWeightsCopy(), model.getWeightsCopy());
    }