|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclassification.DataSet
public class DataSet
This class represents a set of data
Constructor Summary | |
---|---|
DataSet(int id,
java.lang.String name,
java.lang.String filename)
Creates a new data set with contents loaded from an XML file. |
Method Summary | |
---|---|
double |
comparePredictionSets(PredictionSet set1,
PredictionSet set2,
java.lang.String attrName,
boolean forData)
Compares two sets of predictions to determine how similar they are, also giving an indication of which is more accurate. |
int |
getId()
|
java.lang.String |
getName()
|
boolean |
judgePrediction(Prediction p,
boolean forData)
Checks if a given prediction matches its corresponding value in the data set. |
double |
judgePredictionSet(PredictionSet pSet,
java.lang.String attrName,
boolean forData)
Judges the accuracy of a set of predictions for this data set. |
void |
parseXML(java.lang.String filename)
This method parses an XML file containing a data set, and adds the data to this DataSet. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSet(int id, java.lang.String name, java.lang.String filename) throws org.xml.sax.SAXException
id
- The id number for the data setname
- The set's namefilename
- The name of the file to read from (must include .xml)
org.xml.sax.SAXException
Method Detail |
---|
public boolean judgePrediction(Prediction p, boolean forData)
p
- The prediction to checkforData
- Should be true if p is a Data prediction, false if p is a Test prediction
public double judgePredictionSet(PredictionSet pSet, java.lang.String attrName, boolean forData) throws java.lang.Exception
pSet
- A set of predictions to judgeattrName
- The data attribute to judge the predictions forforData
- Should be true if pSet contains Data predictions, false for Test predictions
java.lang.Exception
- if the prediction set is the wrong size or for different datapublic double comparePredictionSets(PredictionSet set1, PredictionSet set2, java.lang.String attrName, boolean forData) throws java.lang.Exception
set1
- A set of predictions for this data setset2
- Another set of predictions for this data setattrName
- The data attribute to compare the sets forforData
- Should be true to compare Data predictions, false for Test predictions
java.lang.Exception
- If the predictions are not compatible with the data or each otherpublic int getId()
public java.lang.String getName()
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 |