protected class AbstractDataset.Instance extends java.lang.Object implements IDataset.IInstance
Implementation of the IInstance interface
Modifier and Type | Field and Description |
---|---|
protected double[] |
values
Attribute values
|
protected double |
weight
weight of this instance
|
Modifier | Constructor and Description |
---|---|
protected |
Instance()
Empty constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
getValue(IAttribute attribute)
Returns value at specified attribute
|
double |
getValue(int attributeIndex)
Returns vector's attribute value in internal format
|
double |
getValue(java.lang.String attributeName)
Returns value at specified attribute name
|
double[] |
getValues()
Get value array of the this instance
|
double |
getWeight()
Returns the weight of this instance
|
void |
setValue(int attributeIndex,
double attributeValue)
Sets a double value in the specified attribute index
|
void |
setValue(int attributeIndex,
java.lang.String attributeString)
Sets a string value in the specified attribute index
|
void |
setWeight(double weight)
Sets the weigth of this instance
|
protected double[] values
protected double weight
protected Instance()
Empty constructor. Allocates space for internal values
public final void setValue(int attributeIndex, double attributeValue)
Sets a double value in the specified attribute index
attributeIndex
- Index to set the valueattributeValue
- Value to setpublic final void setValue(int attributeIndex, java.lang.String attributeString)
Sets a string value in the specified attribute index
attributeIndex
- Index to set the valueattributeString
- Value to setpublic final void setWeight(double weight)
Sets the weigth of this instance
weight
- Weight to setpublic double[] getValues()
Get value array of the this instance
getValues
in interface IDataset.IInstance
public double getWeight()
Returns the weight of this instance
getWeight
in interface IDataset.IInstance
public double getValue(int attributeIndex)
Returns vector's attribute value in internal format
getValue
in interface IDataset.IInstance
attributeIndex
- attribute index for value to readpublic double getValue(IAttribute attribute)
Returns value at specified attribute
getValue
in interface IDataset.IInstance
attribute
- mining attributepublic double getValue(java.lang.String attributeName)
Returns value at specified attribute name
getValue
in interface IDataset.IInstance
attributeName
- mining attribute name