weka-kt

wekakt / com.github.stevenlang.wekakt.extensions / weka.core.Instances / slice

slice

fun Instances.slice(rangeRows: IntRange, rangeAttributes: IntRange): Instances

Slice the given range of attributes out of the dataset.

val iris: Instances = getIris()

// Get rows from 5 to 50 and attributes from 2 to 3
val sliced: Instances = iris.slice(5..50, 2..3)

Parameters

rangeRows - Range of ints indicating the row slice interval

rangeAttributes - Range of ints indicating the attribute slice interval

Return Subset of this dataset, that is only the attributes and rows in the given ranges are in the result