|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclassification.PredictionSet
public class PredictionSet
This class represents a set of predictions for a particular dataset.
Constructor Summary | |
---|---|
PredictionSet(java.lang.String name,
int dsID,
java.lang.String username)
Creates an empty prediction set. |
|
PredictionSet(java.lang.String name,
int dsID,
java.lang.String username,
java.lang.String filename)
Creates a prediction set populated with predictions from the given file. |
Method Summary | |
---|---|
void |
add(Prediction p,
boolean isData)
Adds a prediction to this set. |
double |
compareToSet(PredictionSet otherSet,
java.lang.String attrName,
boolean forData)
Determines the percentage of predictions in this set that are identical to those in another set. |
void |
generateXML(java.lang.String filename)
Generates a predictions XML file representing the predictions in this set. |
java.lang.String |
generateXMLstring()
|
java.util.List<Prediction> |
getDataPredictions(java.lang.String attrName)
Retrieves all predictions for the specified attribute from the data section of the set. |
int |
getDatasetID()
The ID number of the data set these predictions are for. |
java.lang.String |
getName()
The name of the prediction set. |
Prediction |
getPrediction(int instance,
java.lang.String attrName,
boolean isData)
Retrieves a prediction for the specified instance and attribute from the indicated section of the set. |
java.util.List<Prediction> |
getTestPredictions(java.lang.String attrName)
Retrieves all predictions for the specified attribute from the test section of the set. |
java.lang.String |
getUserName()
The name of the user who submitted the set. |
void |
parseXML(java.lang.String filename)
This method parses an XML file containing prediction data, and adds the resulting Predictions to the PredictionSet. |
void |
setUserName(java.lang.String userName)
Sets the name of the user who submitted the set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PredictionSet(java.lang.String name, int dsID, java.lang.String username)
name
- The name for the prediction setdsID
- The ID number of the data set this set will contain predictions forusername
- The name of the user who submitted the setpublic PredictionSet(java.lang.String name, int dsID, java.lang.String username, java.lang.String filename) throws org.xml.sax.SAXException
name
- The name for the prediction setdsID
- The ID number of the data set this set will contain predictions forusername
- The name of the user who submitted the setfilename
- The name of the file to read from (must include .xml)
org.xml.sax.SAXException
Method Detail |
---|
public void add(Prediction p, boolean isData)
p
- The prediction to addisData
- true if p is a Data prediction, false if it is Test predictionpublic int getDatasetID()
public java.lang.String getName()
public Prediction getPrediction(int instance, java.lang.String attrName, boolean isData)
instance
- The instance number of the desired predictionattrName
- The attribute of the desired predictionisData
- Indicates whether to retrieve a Data prediction (true) or
a Test prediction (false)
public java.util.List<Prediction> getDataPredictions(java.lang.String attrName)
attrName
- The name of the attribute to retrieve predictions for.
public java.util.List<Prediction> getTestPredictions(java.lang.String attrName)
attrName
- The name of the attribute to retrieve predictions for.
public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
userName
- The user's namepublic double compareToSet(PredictionSet otherSet, java.lang.String attrName, boolean forData) throws java.lang.Exception
otherSet
- The other set to compare this set withattrName
- The data attribute to compare these sets for
java.lang.Exception
- if other set contains predictions for different datapublic void generateXML(java.lang.String filename) throws java.io.IOException
filename
- The path and name of the desired file (.xml extension is added automatically)
java.io.IOException
public java.lang.String generateXMLstring()
public final void parseXML(java.lang.String filename) throws org.xml.sax.SAXException
filename
- The name/path of the XML prediction file to parse
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |