org.encog.ml.svm.training
Class SVMTrain

java.lang.Object
  extended by org.encog.ml.train.BasicTraining
      extended by org.encog.ml.svm.training.SVMTrain
All Implemented Interfaces:
MLTrain

public class SVMTrain
extends BasicTraining

Provides training for Support Vector Machine networks.


Field Summary
static double DEFAULT_CONST_BEGIN
          The default starting number for C.
static double DEFAULT_CONST_END
          The default ending number for C.
static double DEFAULT_CONST_STEP
          The default step for C.
static double DEFAULT_GAMMA_BEGIN
          The default gamma begin.
static double DEFAULT_GAMMA_END
          The default gamma end.
static double DEFAULT_GAMMA_STEP
          The default gamma step.
 
Constructor Summary
SVMTrain(SVM method, MLDataSet dataSet)
          Construct a trainer for an SVM network.
 
Method Summary
 boolean canContinue()
          
 double getC()
           
 int getFold()
           
 double getGamma()
           
 MLMethod getMethod()
          Get the current best machine learning method from the training.
 svm_problem getProblem()
           
 boolean isTrainingDone()
           
 void iteration()
          Perform either a train or a cross validation.
 TrainingContinuation pause()
          Pause the training to continue later.
 void resume(TrainingContinuation state)
          Resume training.
 void setC(double theC)
          Set the constant C.
 void setFold(int theFold)
          Set the number of folds.
 void setGamma(double theGamma)
          Set the gamma.
 
Methods inherited from class org.encog.ml.train.BasicTraining
addStrategy, finishTraining, getError, getImplementationType, getIteration, getStrategies, getTraining, iteration, postIteration, preIteration, setError, setIteration, setTraining
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONST_BEGIN

public static final double DEFAULT_CONST_BEGIN
The default starting number for C.

See Also:
Constant Field Values

DEFAULT_CONST_END

public static final double DEFAULT_CONST_END
The default ending number for C.

See Also:
Constant Field Values

DEFAULT_CONST_STEP

public static final double DEFAULT_CONST_STEP
The default step for C.

See Also:
Constant Field Values

DEFAULT_GAMMA_BEGIN

public static final double DEFAULT_GAMMA_BEGIN
The default gamma begin.

See Also:
Constant Field Values

DEFAULT_GAMMA_END

public static final double DEFAULT_GAMMA_END
The default gamma end.

See Also:
Constant Field Values

DEFAULT_GAMMA_STEP

public static final double DEFAULT_GAMMA_STEP
The default gamma step.

See Also:
Constant Field Values
Constructor Detail

SVMTrain

public SVMTrain(SVM method,
                MLDataSet dataSet)
Construct a trainer for an SVM network.

Parameters:
method - The network to train.
dataSet - The training data for this network.
Method Detail

canContinue

public final boolean canContinue()

Returns:
True if the training can be paused, and later continued.

getC

public final double getC()
Returns:
The constant C.

getFold

public final int getFold()
Returns:
the fold

getGamma

public final double getGamma()
Returns:
The gamma.

getMethod

public final MLMethod getMethod()
Get the current best machine learning method from the training.

Returns:
The best machine learningm method.

getProblem

public final svm_problem getProblem()
Returns:
The problem being trained.

isTrainingDone

public final boolean isTrainingDone()
Specified by:
isTrainingDone in interface MLTrain
Overrides:
isTrainingDone in class BasicTraining
Returns:
True if the training is done.

iteration

public final void iteration()
Perform either a train or a cross validation. If the folds property is greater than 1 then cross validation will be done. Cross validation does not produce a usable model, but it does set the error. If you are cross validating try C and Gamma values until you have a good error rate. Then use those values to train, producing the final model.


pause

public final TrainingContinuation pause()
Pause the training to continue later.

Returns:
A training continuation object.

resume

public void resume(TrainingContinuation state)
Resume training.

Parameters:
state - The training continuation object to use to continue.

setC

public final void setC(double theC)
Set the constant C.

Parameters:
theC - The constant C.

setFold

public final void setFold(int theFold)
Set the number of folds.

Parameters:
theFold - the fold to set.

setGamma

public final void setGamma(double theGamma)
Set the gamma.

Parameters:
theGamma - The new gamma.


Copyright © 2011. All Rights Reserved.