net.sf.myra.datamining.io
Class Exporter

java.lang.Object
  extended by net.sf.myra.datamining.io.Exporter
Direct Known Subclasses:
HierarchicalExporter

public class Exporter
extends java.lang.Object

This class is used to output the individual predictions of each test instance.

Version:
$Revision: 2276 $ $Date:: 2010-04-15 12:37:24#$
Author:
Fernando Esteban Barril Otero

Field Summary
protected  ClassHierarchy hierarchy
          The class hierarchy reference.
protected  java.io.PrintWriter writer
          The output writer.
 
Constructor Summary
Exporter()
           
 
Method Summary
 void close()
          Closes the output file.
protected  void export(Instance instance, Label predicted)
          Writes the instance informations.
 void initialize(java.io.File file, Metadata metadata)
          Default constructor.
 void write(Dataset testSet, Model discovered)
          Writes the predictions to the file.
protected  void writeHeader(Metadata metadata)
          Writes the output file header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writer

protected java.io.PrintWriter writer
The output writer.


hierarchy

protected ClassHierarchy hierarchy
The class hierarchy reference.

Constructor Detail

Exporter

public Exporter()
Method Detail

initialize

public void initialize(java.io.File file,
                       Metadata metadata)
                throws java.io.IOException
Default constructor.

Parameters:
file - the output file.
metadata - the dataset metadata information.
Throws:
java.io.IOException

write

public void write(Dataset testSet,
                  Model discovered)
Writes the predictions to the file.

Parameters:
testSet - the set of test instances.
discovered - the discovered model.

writeHeader

protected void writeHeader(Metadata metadata)
Writes the output file header.

Parameters:
metadata - the dataset metadata information.

export

protected void export(Instance instance,
                      Label predicted)
Writes the instance informations.

Parameters:
instance - the instance reference.
predicted - the predicted label.

close

public void close()
Closes the output file.



Copyright © 2013. All Rights Reserved.