Class WekaInstance<L>
- java.lang.Object
-
- ai.libs.jaicore.basic.sets.ElementDecorator<weka.core.Instance>
-
- ai.libs.jaicore.ml.core.dataset.weka.WekaInstance<L>
-
- All Implemented Interfaces:
IAttributeArrayInstance,ILabeledAttributeArrayInstance<L>,ILabeledInstance<L>,INumericArrayInstance,INumericLabeledAttributeArrayInstance<L>,org.apache.commons.math3.ml.clustering.Clusterable
public class WekaInstance<L> extends ai.libs.jaicore.basic.sets.ElementDecorator<weka.core.Instance> implements INumericLabeledAttributeArrayInstance<L>
-
-
Constructor Summary
Constructors Constructor Description WekaInstance(weka.core.Instance instance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)IAttributeValue<?>[]getAllAttributeValues()double[]getAsDoubleVector()Turns the instance into a double vector.IAttributeValue<java.lang.Double>getAttributeValue(int position)<T> IAttributeValue<T>getAttributeValueAtPosition(int position, java.lang.Class<T> type)Getter for the value of an attribute for the given position.intgetNumberOfAttributes()Getter for the number of attributes for the instance.InstanceSchema<L>getSchema()LgetTargetValue()Getter for the value of the target attribute.inthashCode()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ai.libs.jaicore.ml.core.dataset.INumericArrayInstance
getPoint
-
-
-
-
Method Detail
-
getAttributeValueAtPosition
public <T> IAttributeValue<T> getAttributeValueAtPosition(int position, java.lang.Class<T> type)
Description copied from interface:IAttributeArrayInstanceGetter for the value of an attribute for the given position.- Specified by:
getAttributeValueAtPositionin interfaceIAttributeArrayInstance- Parameters:
position- The position of the attribute within the instance.type- The type for which the attribute value shall be returned.- Returns:
- The attribute value for the position.
-
getTargetValue
public L getTargetValue()
Description copied from interface:ILabeledInstanceGetter for the value of the target attribute.- Specified by:
getTargetValuein interfaceILabeledInstance<L>- Returns:
- The value of the traget attribute.
-
getAsDoubleVector
public double[] getAsDoubleVector() throws ContainsNonNumericAttributesExceptionDescription copied from interface:INumericArrayInstanceTurns the instance into a double vector.- Specified by:
getAsDoubleVectorin interfaceINumericArrayInstance- Returns:
- The instance as a double vector.
- Throws:
ContainsNonNumericAttributesException- Thrown if the instance is to be converted into a double vector and still contains non-numeric attributes.
-
getAttributeValue
public IAttributeValue<java.lang.Double> getAttributeValue(int position)
- Specified by:
getAttributeValuein interfaceINumericArrayInstance
-
getSchema
public InstanceSchema<L> getSchema()
-
getAllAttributeValues
public IAttributeValue<?>[] getAllAttributeValues()
- Specified by:
getAllAttributeValuesin interfaceIAttributeArrayInstance
-
getNumberOfAttributes
public int getNumberOfAttributes()
Description copied from interface:IAttributeArrayInstanceGetter for the number of attributes for the instance.- Specified by:
getNumberOfAttributesin interfaceIAttributeArrayInstance- Returns:
- Number of attributes
-
hashCode
public int hashCode()
- Overrides:
hashCodein classai.libs.jaicore.basic.sets.ElementDecorator<weka.core.Instance>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classai.libs.jaicore.basic.sets.ElementDecorator<weka.core.Instance>
-
-