Documentation of 'Catalano.MachineLearning.Performance.KFoldCrossValidation' Java class
KFoldCrossValidation
Catalano.MachineLearning.Performance

Class KFoldCrossValidation

  • All Implemented Interfaces:
    IValidation


    public class KFoldCrossValidation
    extends java.lang.Object
    implements IValidation
    KFold Cross Validation.
    • Constructor Summary

      Constructors 
      Constructor and Description
      KFoldCrossValidation()
      Initializes a new instance of the KFoldCrossValidation class.
      KFoldCrossValidation(int nFolds)
      Initializes a new instance of the KFoldCrossValidation class.
      KFoldCrossValidation(int nFolds, boolean shuffle)
      Initializes a new instance of the KFoldCrossValidation class.
      KFoldCrossValidation(int nFolds, boolean shuffle, long seed)
      Initializes a new instance of the KFoldCrossValidation class.
    • Constructor Detail

      • KFoldCrossValidation

        public KFoldCrossValidation()
        Initializes a new instance of the KFoldCrossValidation class.
      • KFoldCrossValidation

        public KFoldCrossValidation(int nFolds)
        Initializes a new instance of the KFoldCrossValidation class.
        Parameters:
        nFolds - Number of folds.
      • KFoldCrossValidation

        public KFoldCrossValidation(int nFolds,
                                    boolean shuffle)
        Initializes a new instance of the KFoldCrossValidation class.
        Parameters:
        nFolds - Number of folds.
        shuffle - Shuffle the indexes.
      • KFoldCrossValidation

        public KFoldCrossValidation(int nFolds,
                                    boolean shuffle,
                                    long seed)
        Initializes a new instance of the KFoldCrossValidation class.
        Parameters:
        nFolds - Number of folds.
        shuffle - Shuffle the indexes.
        seed - Random seed generator.
    • Method Detail

      • getNumberOfFolds

        public int getNumberOfFolds()
        Get number of the folds.
        Returns:
        Number of the folds.
      • setNumberOfFolds

        public void setNumberOfFolds(int folds)
        Set number of the folds.
        Parameters:
        folds - Folds.
      • isShuffle

        public boolean isShuffle()
        Checks if the indexes are going to be shuffled.
        Returns:
        True if the indexes are going to be shuffled, othwerwise return false.
      • setShuffle

        public void setShuffle(boolean shuffle)
        Set true if the indexes are going to be shuffled.
        Parameters:
        shuffle - Indexes are going to be shuffled.
      • Run

        public double Run(IClassifier classifier,
                          DatasetClassification dataset)
        Description copied from interface: IValidation
        Compute validation.
        Specified by:
        Run in interface IValidation
        Parameters:
        classifier - Classifier.
        dataset - Dataset.
        Returns:
        Correctly classified rate.
      • Run

        public double Run(IClassifier classifier,
                          double[][] data,
                          int[] labels)
        Description copied from interface: IValidation
        Compute validation.
        Specified by:
        Run in interface IValidation
        Parameters:
        classifier - Classifier.
        data - Data.
        labels - Labels.
        Returns:
        Correctly classified rate.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.