InputType
- The type of the input for the categorizer to learn. This is the type
passed to the internal batch learner to learn each ensemble member.CategoryType
- The type of the category that is the output for the categorizer to
learn. It is also passed to the internal batch learner to learn each
ensemble member. It must have a valid equals and hashCode method.public class CategoryBalancedIVotingLearner<InputType,CategoryType> extends IVotingCategorizerLearner<InputType,CategoryType>
IVotingCategorizerLearner.OutOfBagErrorStoppingCriteria<InputType,CategoryType>
counterFactory, currentBag, currentCorrectIndices, currentEnsembleCorrect, currentIncorrectIndices, currentMember, currentMemberEstimates, dataFullEstimates, dataInBag, dataList, dataOutOfBagEstimates, DEFAULT_MAX_ITERATIONS, DEFAULT_PERCENT_TO_SAMPLE, DEFAULT_PROPORTION_INCORRECT_IN_SAMPLE, DEFAULT_VOTE_OUT_OF_BAG_ONLY, ensemble, learner, numCorrectToSample, numIncorrectToSample, percentToSample, proportionIncorrectInSample, random, sampleSize, voteOutOfBagOnly
data, keepGoing
maxIterations
DEFAULT_ITERATION, iteration
Constructor and Description |
---|
CategoryBalancedIVotingLearner()
Creates a new
CategoryBalancedIVotingLearner . |
CategoryBalancedIVotingLearner(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> learner,
int maxIterations,
double percentToSample,
double proportionIncorrectInSample,
boolean voteOutOfBagOnly,
Factory<? extends DataDistribution<CategoryType>> counterFactory,
java.util.Random random)
Creates a new
CategoryBalancedIVotingLearner . |
CategoryBalancedIVotingLearner(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> learner,
int maxIterations,
double percentToSample,
java.util.Random random)
Creates a new
CategoryBalancedIVotingLearner . |
Modifier and Type | Method and Description |
---|---|
protected void |
createBag(java.util.ArrayList<java.lang.Integer> correctIndices,
java.util.ArrayList<java.lang.Integer> incorrectIndices)
Create the next sample (bag) of examples to learn the next ensemble
member from.
|
cleanupAlgorithm, getCounterFactory, getCurrentEnsembleCorrect, getDataFullEstimates, getDataInBag, getDataOutOfBagEstimates, getExample, getLearner, getPercentToSample, getProportionIncorrectInSample, getRandom, getResult, initializeAlgorithm, isVoteOutOfBagOnly, sampleIndicesWithReplacementInto, setCounterFactory, setLearner, setPercentToSample, setProportionIncorrectInSample, setRandom, setVoteOutOfBagOnly, step
clone, getData, getKeepGoing, learn, setData, setKeepGoing, stop
getMaxIterations, isResultValid, setMaxIterations
addIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getIteration, getListeners, removeIterativeAlgorithmListener, setIteration, setListeners
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getData, getKeepGoing
getMaxIterations, setMaxIterations
addIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListener
isResultValid, stop
learn
clone
public CategoryBalancedIVotingLearner()
CategoryBalancedIVotingLearner
.public CategoryBalancedIVotingLearner(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> learner, int maxIterations, double percentToSample, java.util.Random random)
CategoryBalancedIVotingLearner
.learner
- The learner to use to create the categorizer on each iteration.maxIterations
- The maximum number of iterations to run for, which is also the
number of learners to create.percentToSample
- The percentage of the total size of the data to sample on each
iteration. Must be positive.random
- The random number generator to use.public CategoryBalancedIVotingLearner(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> learner, int maxIterations, double percentToSample, double proportionIncorrectInSample, boolean voteOutOfBagOnly, Factory<? extends DataDistribution<CategoryType>> counterFactory, java.util.Random random)
CategoryBalancedIVotingLearner
.learner
- The learner to use to create the categorizer on each iteration.maxIterations
- The maximum number of iterations to run for, which is also the
number of learners to create.percentToSample
- The percentage of the total size of the data to sample on each
iteration. Must be positive.proportionIncorrectInSample
- The percentage of incorrect examples to put in each sample. Must
be between 0.0 and 1.0 (inclusive).voteOutOfBagOnly
- Controls whether or not in-bag or out-of-bag votes are used to
determine accuracy.counterFactory
- The factory for counting votes.random
- The random number generator to use.protected void createBag(java.util.ArrayList<java.lang.Integer> correctIndices, java.util.ArrayList<java.lang.Integer> incorrectIndices)
IVotingCategorizerLearner
createBag
in class IVotingCategorizerLearner<InputType,CategoryType>
correctIndices
- The list of indices the ensemble is currently getting correct.incorrectIndices
- The list of indices the ensemble is currently getting incorrect.