Package unifeat.util

Class FileFunc

java.lang.Object
unifeat.util.FileFunc

public final class FileFunc extends Object
This java class is used to implement various utility methods for manipulating files and directories. The methods in this class is contained brief description of the applications.
Author:
Sina Tabakhi
  • Constructor Details

    • FileFunc

      public FileFunc()
  • Method Details

    • createDirectory

      public static void createDirectory(String pathname)
      This method creates a new directory denoted by pathname
      Parameters:
      pathname - path of the directory
    • deleteFilesInDirectory

      public static void deleteFilesInDirectory(String pathname)
      This method deletes all files in the directory denoted by pathname
      Parameters:
      pathname - path of the directory
    • deleteDirectoryWithAllFiles

      public static void deleteDirectoryWithAllFiles(String pathname)
      This method deletes the current directory with all files in the directory denoted by pathname
      Parameters:
      pathname - path of the directory
    • createCSVFile

      public static void createCSVFile(double[][] oldData, int[] selectedFeature, String name, String[] featureNames, String[] classNames)
      This method creates a CSV (Comma delimited) file of the input data
      Parameters:
      oldData - the input data
      selectedFeature - the list of selected Feature
      name - name of the path for created CSV file
      featureNames - a string array of features names
      classNames - a string array of class labels names
    • convertCSVtoARFF

      public static void convertCSVtoARFF(String nameCSV, String nameARFF, String pathProject, int sizeFeatureSubset, DatasetInfo ob)
      This method converts CSV file to ARFF file for the Weka Software
      Parameters:
      nameCSV - the path of the CSV file
      nameARFF - the path for the created ARFF file
      pathProject - the path of the project
      sizeFeatureSubset - the number of selected features
      ob - the object of the DatasetInfo
    • convertCSVtoARFF

      public static void convertCSVtoARFF(String nameCSV, String nameARFF, String pathProject, int sizeFeatureSubset, int numFeature, String[] nameFeatures, int numClass, String[] classLabel)
      This method converts CSV file to ARFF file for the Weka Software
      Parameters:
      nameCSV - the path of the CSV file
      nameARFF - the path for the created ARFF file
      pathProject - the path of the project
      sizeFeatureSubset - the number of selected features
      numFeature - the number of original features with class
      nameFeatures - the array of features' names
      numClass - the number of classes
      classLabel - the array of class labels' names