Documentation of 'ca.pfv.spmf.tools.dataset_converter.TransactionDatabaseConverter' Java class
TransactionDatabaseConverter
ca.pfv.spmf.tools.dataset_converter

Class TransactionDatabaseConverter



  • public class TransactionDatabaseConverter
    extends java.lang.Object
    This class is for converting transaction databases from various formats to the SPMF format.
    See Also:
    Formats
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void convert(java.lang.String input, java.lang.String output, Formats inputFileformat, int lineCount)
      This method converts a transaction database from a given format to the SPMF format.
      java.util.Map<java.lang.Integer,java.lang.String> convertARFFandReturnMap(java.lang.String inputFile, java.lang.String outputFile, int lineCount)
      This method convert a transaction database in ARFF format to SPMF format and return a map of key = item id value = corresponding attribute value.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TransactionDatabaseConverter

        public TransactionDatabaseConverter()
    • Method Detail

      • convert

        public void convert(java.lang.String input,
                            java.lang.String output,
                            Formats inputFileformat,
                            int lineCount)
                     throws java.io.IOException
        This method converts a transaction database from a given format to the SPMF format.
        Parameters:
        input - the path of the input file
        output - the path of the file to be written to disk in SPMF format
        inputFileformat - the format of the input file
        lineCount - the number of lines from the input file that should be converted
        Throws:
        java.io.IOException - an exception is thrown if there is an error reading/writing files Otherwise, null.
      • convertARFFandReturnMap

        public java.util.Map<java.lang.Integer,java.lang.String> convertARFFandReturnMap(java.lang.String inputFile,
                                                                                         java.lang.String outputFile,
                                                                                         int lineCount)
                                                                                  throws java.io.IOException
        This method convert a transaction database in ARFF format to SPMF format and return a map of key = item id value = corresponding attribute value. This method is to be used by the GUI version of SPMF that need to keep the mapping between item IDs and attribute value in memory to avoid an extra database scan.
        Parameters:
        inputFile - the path of the file to be converted
        outputFile - the path for saving the converted file
        lineCount - the number of lines of the input file to be converted
        Returns:
        a map of entry (key : itemID, value: attribute-value) if the input format is ARFF.
        Throws:
        java.io.IOException - if an error while reading/writing files

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.