OnHeapDataset

class OnHeapDataset : Dataset

Basic class to handle features x and labels y.

It loads the whole data from disk to the Heap Memory.

NOTE: Labels y should have shape and contain exactly one 1 and other 0-es per row to be result of one-hot-encoding.

Types

Companion
Link copied to clipboard
object Companion

Functions

batchIterator
Link copied to clipboard
fun batchIterator(batchSize: Int): Dataset.BatchIterator

Returns BatchIterator with fixed batchSize.

getX
Link copied to clipboard
open override fun getX(idx: Int): FloatArray

Returns row by index idx.

getY
Link copied to clipboard
open override fun getY(idx: Int): Float

Returns label as FloatArray by index idx.

shuffle
Link copied to clipboard
open override fun shuffle(): OnHeapDataset

Shuffles the dataset.

split
Link copied to clipboard
open override fun split(splitRatio: Double): Pair<OnHeapDataset, OnHeapDataset>

Splits datasets on two sub-datasets according splitRatio.

xSize
Link copied to clipboard
open override fun xSize(): Int

Returns amount of data rows.

Properties

x
Link copied to clipboard
val x: Array<FloatArray>

an array of feature vectors

y
Link copied to clipboard
val y: FloatArray

an array of labels

Extensions

buildStringRepr
Link copied to clipboard
fun OnHeapDataset.buildStringRepr(xString: String, yString: String): String

Builds intermediate OnHeapDataset string representation.

fullToString
Link copied to clipboard
fun OnHeapDataset.fullToString(): String

Creates OnHeapDataset string representation for full of data.

toString
Link copied to clipboard
fun OnHeapDataset.toString(): String

Creates OnHeapDataset string representation for part of data.