|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetkit.classifiers.io.PrintEstimateWriter
public class PrintEstimateWriter
This class prints label estimates in a user-defined output format. The output format is like a printf statement in c. This format string includes constant information as well as variable information such as value scores and attribute token strings.
The format string is broken up into a list of print segments, where each print segment is one of:
Node %ID is predicted to be %PREDICTLABEL with a score of %PREDICTSCORE. Full estimates are: %ESTIMATE!red %ESTIMATE!blue %ESTIMATE!greenIf the label estimates for node 'Ball903' are 0.2 for red, 0.7 for green and 0.1 for blue, then the resulting output string would be (variable segments boldfaced for clarity):
Node Ball903 is predicted to be green with a score of 0.7. Full estimates are: red:0.2 blue:0.1 green:0.7The default output format (if none are provided) is equivalent to:
%ID %ESTIMATE!class1 ... %ESTIMATE!classKWhere class1 through classK are the possible labels for the class attribute, in the order that they were specified in the schema file or the order in which they were observed in the data
Constructor Summary | |
---|---|
PrintEstimateWriter(java.io.PrintStream ps)
|
|
PrintEstimateWriter(java.io.PrintStream ps,
java.lang.String format)
|
|
PrintEstimateWriter(java.io.PrintWriter pw)
|
|
PrintEstimateWriter(java.io.PrintWriter pw,
java.lang.String format)
|
Method Summary | |
---|---|
java.lang.String |
getOutputFormat()
|
void |
print(Node node,
Estimate e)
Print an estimate of the given node using the given output format and the given current estimates. |
void |
print(Node node,
Estimate e,
Classification known)
Print an estimate of the given node using the given output format and the given current estimates and true labels. |
void |
println(Node node,
Estimate e)
Print an estimate line of the given node using the given output format and the given current estimates. |
void |
println(Node node,
Estimate e,
Classification known)
Print an estimate line of the given node using the given output format and the given current estimates and true labels. |
void |
setOutput(java.io.OutputStream os)
Reset the output to the given outputstream. |
void |
setOutput(java.io.PrintWriter pw)
Reset the output to the given printwriter. |
void |
setOutputFormat(java.lang.String f)
Reset the output format to the given format string. |
java.lang.String |
toString(Node node,
Estimate e)
The equivalent of a print, where the output has been set to a string to be returned. |
java.lang.String |
toString(Node node,
Estimate e,
Classification known)
The equivalent of a print, where the output has been set to a string to be returned. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrintEstimateWriter(java.io.PrintWriter pw, java.lang.String format)
public PrintEstimateWriter(java.io.PrintWriter pw)
public PrintEstimateWriter(java.io.PrintStream ps, java.lang.String format)
public PrintEstimateWriter(java.io.PrintStream ps)
Method Detail |
---|
public void setOutput(java.io.OutputStream os)
os
- New place to send outputpublic void setOutput(java.io.PrintWriter pw)
pw
- New place to send outputpublic void println(Node node, Estimate e)
node
- The node whose estimate to printe
- The current estimatesprint(netkit.graph.Node, netkit.classifiers.Estimate, netkit.classifiers.Classification)
public void println(Node node, Estimate e, Classification known)
node
- The node whose estimate to printe
- The current estimatesknown
- The true labelsprint(netkit.graph.Node, netkit.classifiers.Estimate, netkit.classifiers.Classification)
public void print(Node node, Estimate e)
node
- The node whose estimate to printe
- The current estimatesprint(netkit.graph.Node, netkit.classifiers.Estimate, netkit.classifiers.Classification)
public void print(Node node, Estimate e, Classification known)
If not output format has been specified, then output in the following format:
%ID %ESTIMATE!class1 ... %ESTIMATE!classKWhere class1 through classK are the possible labels for the class attribute, in the order that they were specified in the schema file or the order in which they were observed in the data
node
- The node whose estimate to printe
- The current estimatesknown
- The true labelspublic java.lang.String toString(Node node, Estimate e, Classification known)
node
- The node whose estimate needs to be writtene
- The current estimatesknown
- The known true labels
print(netkit.graph.Node, netkit.classifiers.Estimate, netkit.classifiers.Classification)
public java.lang.String toString(Node node, Estimate e)
node
- The node whose estimate needs to be writtene
- The current estimates
toString(netkit.graph.Node, netkit.classifiers.Estimate, netkit.classifiers.Classification)
public void setOutputFormat(java.lang.String f)
f
- The new output format stringpublic java.lang.String getOutputFormat()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |