net.sf.myra.datamining.io
Class HierarchicalExporter

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

public class HierarchicalExporter
extends Exporter

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

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

Field Summary
protected  ClassHierarchy hierarchy
          The class hierarchy reference.
protected  java.io.PrintWriter writer
          The output writer.
 
Constructor Summary
HierarchicalExporter()
           
 
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

HierarchicalExporter

public HierarchicalExporter()
Method Detail

initialize

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

Overrides:
initialize in class Exporter
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.

Overrides:
write in class Exporter
Parameters:
testSet - the set of test instances.
discovered - the discovered model.

writeHeader

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

Overrides:
writeHeader in class Exporter
Parameters:
metadata - the dataset metadata information.

export

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

Overrides:
export in class Exporter
Parameters:
instance - the instance reference.
predicted - the predicted label.

close

public void close()
Closes the output file.

Overrides:
close in class Exporter


Copyright © 2013. All Rights Reserved.