public class PerceptronTrainer extends AbstractEventTrainer
| Modifier and Type | Field and Description |
|---|---|
static String |
PERCEPTRON_VALUE |
static double |
TOLERANCE_DEFAULT |
DATA_INDEXER_ONE_PASS_REAL_VALUE, DATA_INDEXER_ONE_PASS_VALUE, DATA_INDEXER_PARAM, DATA_INDEXER_TWO_PASS_VALUEALGORITHM_PARAM, CUTOFF_DEFAULT, CUTOFF_PARAM, ITERATIONS_DEFAULT, ITERATIONS_PARAM, TRAINER_TYPE_PARAM, VERBOSE_DEFAULT, VERBOSE_PARAMEVENT_VALUE| Constructor and Description |
|---|
PerceptronTrainer() |
PerceptronTrainer(TrainingParameters parameters) |
| Modifier and Type | Method and Description |
|---|---|
AbstractModel |
doTrain(DataIndexer indexer) |
boolean |
isSortAndMerge() |
boolean |
isValid()
Deprecated.
|
void |
setSkippedAveraging(boolean averaging)
Enables skipped averaging, this flag changes the standard
averaging to special averaging instead.
|
void |
setStepSizeDecrease(double decrease)
Enables and sets step size decrease.
|
void |
setTolerance(double tolerance)
Specifies the tolerance.
|
AbstractModel |
trainModel(int iterations,
DataIndexer di,
int cutoff) |
AbstractModel |
trainModel(int iterations,
DataIndexer di,
int cutoff,
boolean useAverage) |
void |
validate()
Check parameters.
|
getDataIndexer, train, traingetAlgorithm, getCutoff, getIterations, init, initequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinit, initpublic static final String PERCEPTRON_VALUE
public static final double TOLERANCE_DEFAULT
public PerceptronTrainer()
public PerceptronTrainer(TrainingParameters parameters)
public void validate()
AbstractTrainervalidate in class AbstractEventTrainer@Deprecated public boolean isValid()
isValid in class AbstractEventTrainerpublic boolean isSortAndMerge()
isSortAndMerge in class AbstractEventTrainerpublic AbstractModel doTrain(DataIndexer indexer) throws IOException
doTrain in class AbstractEventTrainerIOExceptionpublic void setTolerance(double tolerance)
tolerance - public void setStepSizeDecrease(double decrease)
decrease - - step size decrease in percentpublic void setSkippedAveraging(boolean averaging)
If we are doing averaging, and the current iteration is one of the first 20 or it is a perfect square, then updated the summed parameters.
The reason we don't take all of them is that the parameters change less toward the end of training, so they drown out the contributions of the more volatile early iterations. The use of perfect squares allows us to sample from successively farther apart iterations.
averaging - averaging flagpublic AbstractModel trainModel(int iterations, DataIndexer di, int cutoff)
public AbstractModel trainModel(int iterations, DataIndexer di, int cutoff, boolean useAverage)
Copyright © 2017 The Apache Software Foundation. All rights reserved.