weka-kt

wekakt / com.github.stevenlang.wekakt.extensions / weka.core.Instance / get

get

operator fun Instance.get(attributeIndex: Int): Double

Get the attribute value at attributeIndex.

val iris: Instances = getIris()
val row: Instance = iris[4]
val value: Double = row[2]

Parameters

attributeIndex - Attribute index

Return Value at attributeIndex

operator fun Instance.get(attribute: Attribute): Double

Get the attribute value for attribute.

val iris: Instances = getIris()
val sepalLengthAtt: Attribute = iris.attributes[0]
val row: Instance = iris[4]
val value: Double = row[sepalLengthAtt]

Parameters

attribute - Attribute

Return Value for attribute