org.encog.ml.svm.training
Class SVMTrain
- java.lang.Object
-
- org.encog.ml.train.BasicTraining
-
- org.encog.ml.svm.training.SVMTrain
-
- All Implemented Interfaces:
- MLTrain
public class SVMTrain extends BasicTraining
Provides training for Support Vector Machine networks.
-
-
Constructor Summary
Constructors Constructor and Description SVMTrain(SVM method, MLDataSet dataSet)Construct a trainer for an SVM network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanContinue()doublegetC()intgetFold()doublegetGamma()MLMethodgetMethod()Get the current best machine learning method from the training.svm_problemgetProblem()booleanisTrainingDone()voiditeration()Perform either a train or a cross validation.TrainingContinuationpause()Pause the training to continue later.voidresume(TrainingContinuation state)Resume training.voidsetC(double theC)Set the constant C.voidsetFold(int theFold)Set the number of folds.voidsetGamma(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
-
-
-
-
Method Detail
-
canContinue
public boolean canContinue()
- Returns:
- True if the training can be paused, and later continued.
-
getC
public double getC()
- Returns:
- The constant C.
-
getFold
public int getFold()
- Returns:
- the fold
-
getGamma
public double getGamma()
- Returns:
- The gamma.
-
getMethod
public MLMethod getMethod()
Get the current best machine learning method from the training.- Returns:
- The best machine learning method.
-
getProblem
public svm_problem getProblem()
- Returns:
- The problem being trained.
-
isTrainingDone
public boolean isTrainingDone()
- Specified by:
isTrainingDonein interfaceMLTrain- Overrides:
isTrainingDonein classBasicTraining- Returns:
- True if the training is done.
-
iteration
public 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 void setC(double theC)
Set the constant C.- Parameters:
theC- The constant C.
-
setFold
public void setFold(int theFold)
Set the number of folds.- Parameters:
theFold- the fold to set.
-
setGamma
public void setGamma(double theGamma)
Set the gamma.- Parameters:
theGamma- The new gamma.
-
-
DMelt 3.0 © DataMelt by jWork.ORG