|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.demo.FilterResult
public class FilterResult
Instances of this class contain detailed filtering results with
additional debugging information. This class supports only the
Winnow
classifier and subclasses.
Constructor Summary | |
---|---|
FilterResult(PredictionDistribution myPredDist,
String myText,
TokenizingExtractor extractor,
Map<String,List<Float>> myFeatureWeights)
Creates a new instance. |
Method Summary | |
---|---|
float |
getNonspamScore()
Returns the normalized score for the nonspam class. |
String |
getPredictedClass()
Returns the predicted class: "spam" or "nonspam". |
double |
getProbability()
Returns the probability of the most likely class. |
float |
getSpamScore()
Returns the normalized score for the spam class. |
String |
toString()
Returns a string representation of this object. |
void |
writeBodyAttribute(Writer writer)
Writes attribute name=value pairs that must be inserted into the opening <body ... |
void |
writeHTMLHead(Writer writer)
Writes HTML code that must be inserted into the contents of the <head> element of a HTML file containing the output
of the writeVizualization(Writer) method. |
void |
writeTestHTML(Writer writer)
Writes a simple but complete HTML file that combines the output of of the writeHTMLHead(Writer) ,
writeBodyAttribute(Writer) and
writeVizualization(Writer) methods. |
void |
writeVizualization(Writer writer)
Writes an HTML fragment that contains a vizualization of the classified mail (showing which features have been most important for classification etc.). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FilterResult(PredictionDistribution myPredDist, String myText, TokenizingExtractor extractor, Map<String,List<Float>> myFeatureWeights)
myPredDist
- the prediction distribution wrapped by this instancemyText
- the filtered textextractor
- the feature extractor used to tokenize text sequences
-- will be synchronized on itselfmyFeatureWeights
- a mapping from feature representation to weights
arrays, as returned by the
Winnow.showFeatureWeights(de.fu_berlin.ties.classify.feature.FeatureVector)
methodMethod Detail |
---|
public String getPredictedClass()
public double getProbability()
public float getNonspamScore()
]0, 1[
rande and 1.0 means "don't know".
public float getSpamScore()
]0, 1[
rande and 1.0 means "don't know".
public String toString()
toString
in class Object
public void writeBodyAttribute(Writer writer) throws IOException
<body ...>
tag of a HTML file containing the
output of the writeVizualization(Writer)
method. These attribute
("onload" and "onkeydown") are necessary for initialization the
JavaScript code used for vizualation.
writer
- writer to append the HTML code to; neither flushed nor
closed by this method
IOException
- if an I/O error occurs while writingpublic void writeHTMLHead(Writer writer) throws IOException
<head>
element of a HTML file containing the output
of the writeVizualization(Writer)
method.
writer
- writer to append the HTML code to; neither flushed nor
closed by this method
IOException
- if an I/O error occurs while writingpublic void writeTestHTML(Writer writer) throws IOException
writeHTMLHead(Writer)
,
writeBodyAttribute(Writer)
and
writeVizualization(Writer)
methods.
This method is implemented as followings:
writer.write("<html><head>"); writeHTMLHead(writer); writer.write("</head><body "); writeBodyAttribute(writer); writer.write(">"); writeVizualization(writer); writer.write("</body></html>\n"); writer.flush();
writer
- writer to writer the HTML file to; flushed but not
closed by this method
IOException
- if an I/O error occurs while writingpublic void writeVizualization(Writer writer) throws IOException
writeHTMLHead(Writer)
method into the contents of the
<head>
element and the output of the
writeBodyAttribute(Writer)
method into the opening
<body ...>
tag of the HTML file prior to calling this
method or the Dynamic HTML code generated by this method will not work at
all.
writer
- writer to append the HTML code to; neither flushed nor
closed by this method
IOException
- if an I/O error occurs while writing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |