public interface Instance extends Serializable
Modifier and Type | Method and Description |
---|---|
void |
addSparseValues(int[] indexValues,
double[] attributeValues,
int numberAttributes)
Adds the sparse values.
|
Attribute |
attribute(int instAttIndex)
Attribute.
|
Attribute |
classAttribute()
Class attribute.
|
int |
classIndex()
Class index.
|
boolean |
classIsMissing()
Class is missing.
|
double |
classValue()
Class value.
|
double |
classValue(int attributeIndex)
Gets the value of an output attribute.
|
Instance |
copy()
Copy.
|
Instances |
dataset()
Dataset.
|
void |
deleteAttributeAt(int i)
Delete attribute at.
|
int |
index(int arrayIndex)
Gets the index of the attribute given the index of the array in a sparse
representation.
|
int |
indexOfAttribute(Attribute attribute)
Index of an Attribute.
|
Attribute |
inputAttribute(int attributeIndex)
Gets an input attribute given its index.
|
void |
insertAttributeAt(int i)
Insert attribute at.
|
boolean |
isMissing(Attribute attribute)
Checks if an attribute is missing.
|
boolean |
isMissing(int instAttIndex)
Checks if an attribute is missing.
|
boolean |
isMissingSparse(int p1)
Checks if the attribute is missing sparse.
|
int |
numAttributes()
Gets the number of attributes.
|
int |
numberOutputTargets()
Gets the number of output attributes.
|
int |
numClasses()
Num classes.
|
int |
numInputAttributes()
Gets the number of input attributes.
|
int |
numOutputAttributes()
Gets the number of output attributes.
|
int |
numValues()
Gets the number of values, mainly for sparse instances.
|
Attribute |
outputAttribute(int attributeIndex)
Gets an output attribute given its index.
|
void |
setClassValue(double d)
Sets the class value.
|
void |
setClassValue(int indexClass,
double valueAttribute)
Sets the value of an output attribute.
|
void |
setDataset(Instances dataset)
Sets the dataset.
|
void |
setMissing(Attribute attribute)
Sets an attribute as missing
|
void |
setMissing(int instAttIndex)
Sets an attribute as missing
|
void |
setValue(Attribute attribute,
double value)
Sets the value of an attribute.
|
void |
setValue(int instAttIndex,
double value)
Sets the value of an attribute.
|
void |
setWeight(double weight)
Sets the weight.
|
String |
stringValue(int i)
Gets the value of a discrete attribute as a string.
|
double[] |
toDoubleArray()
To double array.
|
double |
value(Attribute attribute)
Gets the value of an attribute, given the attribute.
|
double |
value(int instAttIndex)
Gets the value of an attribute.
|
double |
valueInputAttribute(int attributeIndex)
Gets the value of an input attribute.
|
double |
valueOutputAttribute(int attributeIndex)
Gets the value of an output attribute.
|
double |
valueSparse(int i)
Gets the value of an attribute in a sparse representation of the
instance.
|
double |
weight()
Gets the weight of the instance.
|
double weight()
void setWeight(double weight)
weight
- the new weightAttribute attribute(int instAttIndex)
instAttIndex
- the inst att indexint indexOfAttribute(Attribute attribute)
Attribute,
- the attribute to be found.void deleteAttributeAt(int i)
i
- the indexvoid insertAttributeAt(int i)
i
- the indexint numAttributes()
void addSparseValues(int[] indexValues, double[] attributeValues, int numberAttributes)
indexValues
- the index valuesattributeValues
- the attribute valuesnumberAttributes
- the number attributesint numValues()
String stringValue(int i)
i
- the idouble value(int instAttIndex)
instAttIndex
- the inst att indexdouble value(Attribute attribute)
attribute
- the attributevoid setMissing(int instAttIndex)
instAttIndex,
- the attribute's indexvoid setMissing(Attribute attribute)
attribute,
- the Attributevoid setValue(int instAttIndex, double value)
instAttIndex
- the indexvalue
- the valuevoid setValue(Attribute attribute, double value)
attribute,
- the Attributevalue
- the valueboolean isMissing(int instAttIndex)
instAttIndex
- the inst att indexboolean isMissing(Attribute attribute)
attribute,
- the Attributeint index(int arrayIndex)
arrayIndex
- the index of the arraydouble valueSparse(int i)
i
- the iboolean isMissingSparse(int p1)
p1
- the p1double[] toDoubleArray()
Attribute classAttribute()
int classIndex()
boolean classIsMissing()
double classValue()
int numClasses()
void setClassValue(double d)
d
- the new class valueInstance copy()
void setDataset(Instances dataset)
dataset
- the new datasetInstances dataset()
int numInputAttributes()
int numOutputAttributes()
int numberOutputTargets()
double classValue(int attributeIndex)
attributeIndex
- the indexvoid setClassValue(int indexClass, double valueAttribute)
indexClass
- the output attribute indexvalueAttribute
- the value of the attributeAttribute outputAttribute(int attributeIndex)
attributeIndex
- the indexAttribute inputAttribute(int attributeIndex)
attributeIndex
- the indexdouble valueInputAttribute(int attributeIndex)
attributeIndex
- the indexdouble valueOutputAttribute(int attributeIndex)
attributeIndex
- the indexCopyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.