Package ai.libs.jaicore.ml.core.dataset
Interface IInstance
-
- All Superinterfaces:
org.apache.commons.math3.ml.clustering.Clusterable
public interface IInstance extends org.apache.commons.math3.ml.clustering.ClusterableInterface of an instance which consists of attributes and a target value.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description double[]getAsDoubleVector()Turns the instance into a double vector.<T> IAttributeValue<T>getAttributeValue(int position, java.lang.Class<T> type)Getter for the value of an attribute for the given position.default double[]getPoint()<T> IAttributeValue<T>getTargetValue(java.lang.Class<T> type)Getter for the value of the target attribute.
-
-
-
Method Detail
-
getAttributeValue
<T> IAttributeValue<T> getAttributeValue(int position, java.lang.Class<T> type)
Getter for the value of an attribute for the given position.- 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
<T> IAttributeValue<T> getTargetValue(java.lang.Class<T> type)
Getter for the value of the target attribute.- Parameters:
type- The type to bind the value of the target attribute.- Returns:
- The value of the traget attribute.
-
getAsDoubleVector
double[] getAsDoubleVector() throws ContainsNonNumericAttributesExceptionTurns the instance into a double vector.- 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.
-
getPoint
default double[] getPoint()
- Specified by:
getPointin interfaceorg.apache.commons.math3.ml.clustering.Clusterable
-
-