Class CrossValidation

java.lang.Object
unifeat.classifier.evaluation.wekaClassifier.CrossValidation

public class CrossValidation extends Object
This java class is used to apply the classifiers for computing the performance of the feature selection methods. The classifiers have been implemented as the Weka software. The k-fold cross validation method is used for evaluating classifiers.
Author:
Sina Tabakhi
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Criteria
    dTree(String pathTrainData, double confidenceValue, int minNumSampleInLeaf, int kFold)
    This method builds and evaluates the decision tree(DT) classifier.
    static Criteria
    kNN(String pathTrainData, int kNNValue, int kFold)
    This method builds and evaluates the k-nearest neighbours(knn) classifier.
    static Criteria
    naiveBayes(String pathTrainData, int kFold)
    This method builds and evaluates the naiveBayes(NB) classifier.
    static Criteria
    SVM(String pathTrainData, SVMKernelType svmKernel, double c, int kFold)
    This method builds and evaluates the support vector machine(SVM) classifier.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CrossValidation

      public CrossValidation()
  • Method Details

    • SVM

      public static Criteria SVM(String pathTrainData, SVMKernelType svmKernel, double c, int kFold)
      This method builds and evaluates the support vector machine(SVM) classifier. The SMO is used as the SVM classifier implemented in the Weka software.
      Parameters:
      pathTrainData - the path of the train set
      svmKernel - the kernel to use
      c - the complexity parameter C
      kFold - the number of equal sized subsamples
      Returns:
      the different criteria values
      See Also:
    • naiveBayes

      public static Criteria naiveBayes(String pathTrainData, int kFold)
      This method builds and evaluates the naiveBayes(NB) classifier. The naiveBayes is used as the NB classifier implemented in the Weka software.
      Parameters:
      pathTrainData - the path of the train set
      kFold - the number of equal sized subsamples
      Returns:
      the different criteria values
      See Also:
    • dTree

      public static Criteria dTree(String pathTrainData, double confidenceValue, int minNumSampleInLeaf, int kFold)
      This method builds and evaluates the decision tree(DT) classifier. The j48 is used as the DT classifier implemented in the Weka software.
      Parameters:
      pathTrainData - the path of the train set
      confidenceValue - The confidence factor used for pruning
      minNumSampleInLeaf - The minimum number of instances per leaf
      kFold - the number of equal sized subsamples
      Returns:
      the different criteria values
      See Also:
    • kNN

      public static Criteria kNN(String pathTrainData, int kNNValue, int kFold)
      This method builds and evaluates the k-nearest neighbours(knn) classifier. The IBk is used as the knn classifier implemented in the Weka software.
      Parameters:
      pathTrainData - the path of the train set
      kNNValue - the number of neighbours to use
      kFold - the number of equal sized subsamples
      Returns:
      the different criteria values
      See Also: