ca.pfv.spmf.tools.dataset_converter
Class TransactionDatabaseConverter
- java.lang.Object
-
- ca.pfv.spmf.tools.dataset_converter.TransactionDatabaseConverter
-
public class TransactionDatabaseConverter extends java.lang.ObjectThis class is for converting transaction databases from various formats to the SPMF format.- See Also:
Formats
-
-
Constructor Summary
Constructors Constructor and Description TransactionDatabaseConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidconvert(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.
-
-
-
Method Detail
-
convert
public void convert(java.lang.String input, java.lang.String output, Formats inputFileformat, int lineCount) throws java.io.IOExceptionThis method converts a transaction database from a given format to the SPMF format.- Parameters:
input- the path of the input fileoutput- the path of the file to be written to disk in SPMF formatinputFileformat- the format of the input filelineCount- 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.IOExceptionThis 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 convertedoutputFile- the path for saving the converted filelineCount- 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