public class MultiPropertyEntry extends BaseEntry
Users of entries that extend this class can designate a property as the class
variable using setTargetProperty(int)
. Often, this is performed through various
commands from the MultiPropertyDataset
. You may notice that names of
properties are not stored in this class, and they are actually stored in MultiPropertyDataset.
This is to reminder users that they should access properties through the Dataset.
If the "target" property is set to "-1", this class functions as a normal BaseEntry.
MultiPropertyDataset
,
Serialized FormConstructor and Description |
---|
MultiPropertyEntry() |
Modifier and Type | Method and Description |
---|---|
void |
addProperty()
Add a new property to this entry.
|
void |
addProperty(double measuredValue)
Add a new property and define measured property.
|
void |
addProperty(double measuredValue,
double predictedValue)
Add a new property to this entry, set measured and predicted values
|
void |
clearPropertyData()
Remove all information about properties
|
MultiPropertyEntry |
clone()
Generates a clone of an entry.
|
void |
deleteMeasuredClass()
Delete measured class variable.
|
double[] |
getClassProbilities()
Get the probability of an entry existing in each class.
|
double |
getMeasuredClass()
Get the measured class variable
|
double[] |
getMeasuredProperties()
Get copy all measured properties.
|
double |
getMeasuredProperty(int index)
Get a single measured property.
|
double |
getPredictedClass()
Get the predicted class variable
|
double |
getPredictedProperty(int index)
Get the predicted properties for an instance.
|
double[] |
getPropertyClassProbabilties(int index)
Get the predicted class probabilities for a certain property.
|
int |
getTargetProperty()
Look up which property is being used as the class variable.
|
boolean |
hasMeasuredProperty(int index)
Whether a specific property of this entry has been measured
|
boolean |
hasMeasurement() |
boolean |
hasPredictedProperty(int index)
Whether an specific property has any predicted value
|
boolean |
hasPrediction() |
int |
NProperties() |
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 |
setMeasuredProperties(double[] newValues)
Define the values of all measured properties of this entry.
|
void |
setMeasuredProperty(int index,
double newValue)
Set the measured value of a specific property of this entry.
|
void |
setNProperties(int N)
Define the number of properties this entry can support.
|
void |
setPredictedClass(double x)
Set the predicted class variable
|
void |
setPredictedProperty(int index,
double newValue)
Directly set the predicted value of a property.
|
void |
setPredictedProperty(int index,
double[] newValues)
Directly set the probabilities of an entry existing in multiple classes.
|
void |
setTargetProperty(int index)
Define which property to use as the class variable.
|
boolean |
usingPropertyAsClass() |
addAttribute, addAttributes, clearAttributes, compare, compareTo, deletePredictedClass, equals, getAttribute, getAttributes, hashCode, NAttributes, setAttribute, setAttributes, toHTMLString, toString
public MultiPropertyEntry clone()
BaseEntry
public void clearPropertyData()
public void setNProperties(int N)
N
- Number of properties this entry should be able to storepublic void addProperty()
public void addProperty(double measuredValue)
measuredValue
- Measured value of new propertyMultiPropertyDataset.addProperty(java.lang.String, java.lang.String[])
public void addProperty(double measuredValue, double predictedValue)
measuredValue
- Measured value of this property. Set to Double.NaN if unknown.predictedValue
- Predicted value of this property. Set to Double.NaN if unknown.MultiPropertyDataset.addProperty(java.lang.String, java.lang.String[]);
public double getMeasuredClass()
BaseEntry
getMeasuredClass
in class BaseEntry
public double[] getMeasuredProperties()
public double getMeasuredProperty(int index)
index
- Index of measured property to retrievepublic double getPredictedClass()
BaseEntry
getPredictedClass
in class BaseEntry
public double[] getClassProbilities()
BaseEntry
getClassProbilities
in class BaseEntry
public double getPredictedProperty(int index)
index
- Index of property to retrievepublic double[] getPropertyClassProbabilties(int index)
index
- Index of property to retrievepublic int getTargetProperty()
public boolean usingPropertyAsClass()
public boolean hasMeasuredProperty(int index)
index
- Index of property to testpublic boolean hasPredictedProperty(int index)
index
- Index of property to testpublic boolean hasMeasurement()
hasMeasurement
in class BaseEntry
public boolean hasPrediction()
hasPrediction
in class BaseEntry
public void deleteMeasuredClass()
BaseEntry
deleteMeasuredClass
in class BaseEntry
public void setClassProbabilities(double[] probabilites)
BaseEntry
setClassProbabilities
in class BaseEntry
probabilites
- Probability of entry being in each classpublic void setMeasuredClass(double x)
BaseEntry
setMeasuredClass
in class BaseEntry
x
- Measured classpublic void setMeasuredProperties(double[] newValues)
This command will automatically reset the predicted properties, so use with caution.
newValues
- Values of all measured propertiespublic void setMeasuredProperty(int index, double newValue)
index
- Index of property to setnewValue
- New measured valuepublic void setPredictedClass(double x)
BaseEntry
setPredictedClass
in class BaseEntry
x
- Predicted classpublic void setPredictedProperty(int index, double newValue)
index
- Index of propertynewValue
- Its new value.public void setPredictedProperty(int index, double[] newValues)
index
- Index of propertynewValues
- Class probabilitiespublic void setTargetProperty(int index)
index
- Index of property to usepublic int NProperties()