net.sf.myra.datamining.io
Class C45Helper

java.lang.Object
  extended by net.sf.myra.datamining.io.Helper
      extended by net.sf.myra.datamining.io.C45Helper

public final class C45Helper
extends Helper

Helper class to manipulate files in C4.5 format.

Version:
$Revision$ $Date:: $
Author:
Fernando Esteban Barril Otero

Constructor Summary
C45Helper()
          No instances allowed (private constructor).
 
Method Summary
static void main(java.lang.String[] args)
           
 Dataset read(java.io.File file)
          Returns a Dataset instance that represents the data of the specified file.
 Dataset read(java.io.File directory, java.lang.String filestem)
           
 Dataset read(java.io.Reader names, java.io.Reader data)
          Returns a Dataset instance that represents the data of the specified files.
 void write(java.io.File directory, Dataset dataset)
          Writes the specified dataset in the C4.5 input file format (names/data).
 void write(java.io.Writer writer, Dataset dataset)
          Unsupported operation.
 
Methods inherited from class net.sf.myra.datamining.io.Helper
getHelper, getHelper, isCompressed, open, open, read, setCompressed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

C45Helper

public C45Helper()
No instances allowed (private constructor).

Method Detail

read

public Dataset read(java.io.File directory,
                    java.lang.String filestem)
             throws java.io.IOException
Throws:
java.io.IOException

read

public Dataset read(java.io.File file)
             throws java.io.IOException
Description copied from class: Helper
Returns a Dataset instance that represents the data of the specified file.

Specified by:
read in class Helper
Parameters:
file - the file to read the data from.
Returns:
a Dataset instance.
Throws:
java.io.IOException - if any file operation fails.

read

public Dataset read(java.io.Reader names,
                    java.io.Reader data)
             throws java.io.IOException
Returns a Dataset instance that represents the data of the specified files.

Parameters:
names - the input reader for the .names file.
data - the input reader for the .data file.
Returns:
a Dataset instance.
Throws:
java.io.IOException - if any file operation fails.

write

public void write(java.io.File directory,
                  Dataset dataset)
           throws java.io.IOException
Writes the specified dataset in the C4.5 input file format (names/data).

Specified by:
write in class Helper
Parameters:
directory - the output directory.
dataset - the dataset to be written.
Throws:
java.io.IOException

write

public void write(java.io.Writer writer,
                  Dataset dataset)
           throws java.io.IOException
Unsupported operation. C45Helper creates two files (.data and .names).

Specified by:
write in class Helper
Parameters:
writer - the output writer.
dataset - the dataset to be written.
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2013. All Rights Reserved.