public class BaseEntry
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable, java.util.Comparator, java.lang.Comparable
Constructor and Description |
---|
BaseEntry()
Create a blank entry
|
BaseEntry(java.lang.String input)
Generate an entry by parsing a text string
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(double attribute)
Adds attribute value to the end of the list of current attributes
|
void |
addAttributes(double[] attributes)
Adds several attributes to the end of the attribute list.
|
void |
clearAttributes()
Clear all currently-set attributes.
|
BaseEntry |
clone()
Generates a clone of an entry.
|
int |
compare(java.lang.Object A_obj,
java.lang.Object B_obj) |
int |
compareTo(java.lang.Object B) |
void |
deleteMeasuredClass()
Delete measured class variable.
|
void |
deletePredictedClass()
Delete predicted class variable.
|
boolean |
equals(java.lang.Object other) |
double |
getAttribute(int index)
Retrieve a certain attribute for this entry
|
double[] |
getAttributes()
Retrieve attributes for this entry
|
double[] |
getClassProbilities()
Get the probability of an entry existing in each class.
|
double |
getMeasuredClass()
Get the measured class variable
|
double |
getPredictedClass()
Get the predicted class variable
|
boolean |
hasClassProbabilities()
Whether this entry has predicted probabilities
|
int |
hashCode() |
boolean |
hasMeasurement() |
boolean |
hasPrediction() |
int |
NAttributes()
Get number of attributes currently set
|
void |
reduceMemoryFootprint()
Delete any cached information stored within this entry.
|
void |
setAttribute(int index,
double value)
Set a certain attribute for this entry
|
void |
setAttributes(double[] attributes)
Sets attributes for this entry
|
void |
setClassProbabilities(double[] probabilites)
Set the predicted probability of a entry existing in each class
|
void |
setMeasuredClass(double x)
Set the measured class variable
|
void |
setPredictedClass(double x)
Set the predicted class variable
|
java.lang.String |
toHTMLString()
Print entry in a HTML-friendly format.
|
org.json.JSONObject |
toJSON()
Print entry as a JSON object
|
java.lang.String |
toString() |
public BaseEntry()
public BaseEntry(java.lang.String input) throws java.lang.Exception
input
- String representing entryjava.lang.Exception
- If parse failspublic void reduceMemoryFootprint()
public int NAttributes()
public void clearAttributes()
public double[] getAttributes()
public void setAttributes(double[] attributes)
attributes
- List of attributes (same order as Dataset.AttributeName)public double getAttribute(int index)
index
- Index of attribute to retrievepublic void setAttribute(int index, double value)
index
- Index of attribute to setvalue
- Desired value of specified attributepublic void addAttribute(double attribute)
attribute
- Value of attribute to addpublic void addAttributes(double[] attributes)
Dev Note: This is faster than adding the individually.
attributes
- List of attribute values to be addedpublic BaseEntry clone()
clone
in class java.lang.Object
public int compare(java.lang.Object A_obj, java.lang.Object B_obj)
compare
in interface java.util.Comparator
public final int compareTo(java.lang.Object B)
compareTo
in interface java.lang.Comparable
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in interface java.util.Comparator
equals
in class java.lang.Object
public boolean hasMeasurement()
public boolean hasPrediction()
public boolean hasClassProbabilities()
public void deleteMeasuredClass()
public void deletePredictedClass()
public double getMeasuredClass()
public void setMeasuredClass(double x)
x
- Measured classpublic double getPredictedClass()
public void setPredictedClass(double x)
x
- Predicted classpublic void setClassProbabilities(double[] probabilites)
probabilites
- Probability of entry being in each classpublic double[] getClassProbilities()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toHTMLString()
public org.json.JSONObject toJSON()