Refactor different classes into subpackages.

This commit is contained in:
Joel Therrien 2018-07-05 12:59:29 -07:00
parent 662a6cf761
commit 2cdcbe6cbf
17 changed files with 25 additions and 19 deletions

View file

@ -1,5 +1,6 @@
package ca.joeltherrien.randomforest; package ca.joeltherrien.randomforest;
import ca.joeltherrien.randomforest.covariates.Covariate;
import lombok.Getter; import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;

View file

@ -1,6 +1,8 @@
package ca.joeltherrien.randomforest; package ca.joeltherrien.randomforest;
import ca.joeltherrien.randomforest.covariates.Covariate;
import java.util.Map; import java.util.Map;
public class Row<Y> extends CovariateRow { public class Row<Y> extends CovariateRow {

View file

@ -1,4 +1,4 @@
package ca.joeltherrien.randomforest; package ca.joeltherrien.randomforest.covariates;
import lombok.Getter; import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;

View file

@ -1,4 +1,8 @@
package ca.joeltherrien.randomforest; package ca.joeltherrien.randomforest.covariates;
import ca.joeltherrien.randomforest.CovariateRow;
import ca.joeltherrien.randomforest.Row;
import ca.joeltherrien.randomforest.tree.Split;
import java.io.Serializable; import java.io.Serializable;
import java.util.*; import java.util.*;

View file

@ -1,4 +1,4 @@
package ca.joeltherrien.randomforest; package ca.joeltherrien.randomforest.covariates;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View file

@ -1,4 +1,4 @@
package ca.joeltherrien.randomforest; package ca.joeltherrien.randomforest.covariates;
import lombok.Getter; import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;

View file

@ -1,6 +1,6 @@
package ca.joeltherrien.randomforest.regression; package ca.joeltherrien.randomforest.regression;
import ca.joeltherrien.randomforest.ResponseCombiner; import ca.joeltherrien.randomforest.tree.ResponseCombiner;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;

View file

@ -1,11 +1,9 @@
package ca.joeltherrien.randomforest.tree; package ca.joeltherrien.randomforest.tree;
import ca.joeltherrien.randomforest.CovariateRow; import ca.joeltherrien.randomforest.CovariateRow;
import ca.joeltherrien.randomforest.ResponseCombiner;
import lombok.Builder; import lombok.Builder;
import java.util.Collection; import java.util.Collection;
import java.util.List;
@Builder @Builder
public class Forest<Y> { public class Forest<Y> {

View file

@ -1,8 +1,7 @@
package ca.joeltherrien.randomforest.tree; package ca.joeltherrien.randomforest.tree;
import ca.joeltherrien.randomforest.Bootstrapper; import ca.joeltherrien.randomforest.Bootstrapper;
import ca.joeltherrien.randomforest.Covariate; import ca.joeltherrien.randomforest.covariates.Covariate;
import ca.joeltherrien.randomforest.ResponseCombiner;
import ca.joeltherrien.randomforest.Row; import ca.joeltherrien.randomforest.Row;
import lombok.Builder; import lombok.Builder;

View file

@ -1,4 +1,4 @@
package ca.joeltherrien.randomforest; package ca.joeltherrien.randomforest.tree;
import java.util.List; import java.util.List;
import java.util.stream.Collector; import java.util.stream.Collector;

View file

@ -1,5 +1,6 @@
package ca.joeltherrien.randomforest; package ca.joeltherrien.randomforest.tree;
import ca.joeltherrien.randomforest.Row;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;

View file

@ -1,6 +1,6 @@
package ca.joeltherrien.randomforest.tree; package ca.joeltherrien.randomforest.tree;
import ca.joeltherrien.randomforest.Covariate; import ca.joeltherrien.randomforest.covariates.Covariate;
import ca.joeltherrien.randomforest.CovariateRow; import ca.joeltherrien.randomforest.CovariateRow;
import lombok.Builder; import lombok.Builder;

View file

@ -1,6 +1,7 @@
package ca.joeltherrien.randomforest.tree; package ca.joeltherrien.randomforest.tree;
import ca.joeltherrien.randomforest.*; import ca.joeltherrien.randomforest.*;
import ca.joeltherrien.randomforest.covariates.Covariate;
import lombok.Builder; import lombok.Builder;
import java.util.*; import java.util.*;

View file

@ -1,7 +1,6 @@
package ca.joeltherrien.randomforest.covariates; package ca.joeltherrien.randomforest.covariates;
import ca.joeltherrien.randomforest.FactorCovariate;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.Executable; import org.junit.jupiter.api.function.Executable;

View file

@ -1,15 +1,14 @@
package ca.joeltherrien.randomforest.workshop; package ca.joeltherrien.randomforest.workshop;
import ca.joeltherrien.randomforest.*; import ca.joeltherrien.randomforest.*;
import ca.joeltherrien.randomforest.covariates.Covariate;
import ca.joeltherrien.randomforest.covariates.NumericCovariate;
import ca.joeltherrien.randomforest.regression.MeanResponseCombiner; import ca.joeltherrien.randomforest.regression.MeanResponseCombiner;
import ca.joeltherrien.randomforest.regression.WeightedVarianceGroupDifferentiator; import ca.joeltherrien.randomforest.regression.WeightedVarianceGroupDifferentiator;
import ca.joeltherrien.randomforest.tree.Forest;
import ca.joeltherrien.randomforest.tree.ForestTrainer; import ca.joeltherrien.randomforest.tree.ForestTrainer;
import ca.joeltherrien.randomforest.tree.TreeTrainer; import ca.joeltherrien.randomforest.tree.TreeTrainer;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class TrainForest { public class TrainForest {

View file

@ -1,9 +1,9 @@
package ca.joeltherrien.randomforest.workshop; package ca.joeltherrien.randomforest.workshop;
import ca.joeltherrien.randomforest.Covariate; import ca.joeltherrien.randomforest.covariates.Covariate;
import ca.joeltherrien.randomforest.CovariateRow; import ca.joeltherrien.randomforest.CovariateRow;
import ca.joeltherrien.randomforest.NumericCovariate; import ca.joeltherrien.randomforest.covariates.NumericCovariate;
import ca.joeltherrien.randomforest.Row; import ca.joeltherrien.randomforest.Row;
import ca.joeltherrien.randomforest.regression.MeanResponseCombiner; import ca.joeltherrien.randomforest.regression.MeanResponseCombiner;
import ca.joeltherrien.randomforest.regression.WeightedVarianceGroupDifferentiator; import ca.joeltherrien.randomforest.regression.WeightedVarianceGroupDifferentiator;

View file

@ -2,6 +2,9 @@ package ca.joeltherrien.randomforest.workshop;
import ca.joeltherrien.randomforest.*; import ca.joeltherrien.randomforest.*;
import ca.joeltherrien.randomforest.covariates.Covariate;
import ca.joeltherrien.randomforest.covariates.FactorCovariate;
import ca.joeltherrien.randomforest.covariates.NumericCovariate;
import ca.joeltherrien.randomforest.regression.MeanResponseCombiner; import ca.joeltherrien.randomforest.regression.MeanResponseCombiner;
import ca.joeltherrien.randomforest.regression.WeightedVarianceGroupDifferentiator; import ca.joeltherrien.randomforest.regression.WeightedVarianceGroupDifferentiator;
import ca.joeltherrien.randomforest.tree.Node; import ca.joeltherrien.randomforest.tree.Node;
@ -13,7 +16,6 @@ import java.util.Map;
import java.util.Random; import java.util.Random;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.DoubleStream; import java.util.stream.DoubleStream;
import java.util.stream.Stream;
public class TrainSingleTreeFactor { public class TrainSingleTreeFactor {