SVMTrain
org.encog.ml.svm.training

Class SVMTrain

  • All Implemented Interfaces:
    MLTrain


    public class SVMTrainextends BasicTraining
    Provides training for Support Vector Machine networks.
    • 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.
      • evaluate

        public static double evaluate(svm_parameter param,              svm_problem prob,              double[] target)
        Evaluate the error for the specified model.
        Parameters:
        param - The params for the SVN.
        prob - The problem to evaluate.
        target - The output values from the SVN.
        Returns:
        The calculated error.
      • 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.
      • 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.

SCaVis 2.1 © jWork.ORG