Dataset

Dataset for holding training data

Constructors

ConstructorDescription
new(s)
Signature: (s:seq<DV * DV>) -> Dataset

Construct a dataset from the given sequence of input-output vector pairs

new(xi, y)
Signature: (xi:seq<int> * y:DM) -> Dataset

Construct a dataset with one-hot input elements and given output matrix y. xi are the input indices, input dimensions is max(xi) + 1.

new(x, yi)
Signature: (x:DM * yi:seq<int>) -> Dataset

Construct a dataset with given input matrix x and one-hot output elements. yi are the output indices, output dimensions is max(yi) + 1.

new(xi, onehotdimsx, y)
Signature: (xi:seq<int> * onehotdimsx:int * y:DM) -> Dataset

Construct a dataset with one-hot input elements and given output matrix y. xi are the input indices, onehotdimsx is the input dimensions.

new(x, yi, onehotdimsy)
Signature: (x:DM * yi:seq<int> * onehotdimsy:int) -> Dataset

Construct a dataset with given input matrix x and one-hot output elements. yi are the output indices, onehotdimsy is the output dimensions.

new(xi, yi)
Signature: (xi:seq<int> * yi:seq<int>) -> Dataset

Construct a dataset of one-hot input and output elements. xi are the input indices, input dimensions is max(xi) + 1, yi are the output indices, output dimensions is max(yi) + 1.

new(xi, onehotdimsx, yi, onehotdimsy)
Signature: (xi:seq<int> * onehotdimsx:int * yi:seq<int> * onehotdimsy:int) -> Dataset

Construct a dataset of one-hot input and output elements. xi are the input indices, onehotdimsx is the input dimensions, yi are the output indices, onehotdimsy is the output dimensions.

new(x, y)
Signature: (x:DM * y:DM) -> Dataset

Construct a dataset with given input matrix x and output matrix y. Columns of x and y are the individual inputs and corresponding outputs.

Instance members

Instance memberDescription
AppendBiasRowX()
Signature: unit -> Dataset

Append a row of all ones to the input matrix X

AppendRowX(v)
Signature: v:DV -> Dataset

Append a new row v to the input matrix X

AppendRowY(v)
Signature: v:DV -> Dataset

Append a new row v to the output matrix Y

Filter(predicate)
Signature: (predicate:(DV * DV -> bool)) -> Dataset

Get a new dataset of the entries for which the predicate is true

GetSlice(lower, upper)
Signature: (lower:int option * upper:int option) -> Dataset

Get a slice of the dataset between lower and upper indices

[i]
Signature: i:int -> DV * DV

Get element i

Length
Signature: int

The length of the dataset, i.e., the number of columns in input matrix X and output matrix Y

Normalize()
Signature: unit -> Dataset

Normalize the values in the input matrix X and output matrix Y to be in the range [0,1]

NormalizeX()
Signature: unit -> Dataset

Normalize the values in the input matrix X to be in the range [0,1]

NormalizeY()
Signature: unit -> Dataset

Normalize the values in the output matrix Y to be in the range [0,1]

RandomSubset(n)
Signature: n:int -> Dataset

Sample a random subset of length n from this dataset

Shuffle()
Signature: unit -> Dataset

Shuffle the order of elements in the dataset

Standardize()
Signature: unit -> Dataset

Standardize the values in the input matrix X and output matrix Y to have zero mean and unit variance

StandardizeX()
Signature: unit -> Dataset

Standardize the values in the input matrix X to have zero mean and unit variance

StandardizeY()
Signature: unit -> Dataset

Standardize the values in the output matrix Y to have zero mean and unit variance

ToSeq()
Signature: unit -> seq<DV * DV>

Get the input-output pairs as a sequence

ToStringFull()
Signature: unit -> string

Get a string representation of this dataset showing all values

Visualize()
Signature: unit -> string

Get a string visualization of this dataset

VisualizeXColsAsImageGrid(imagerows)
Signature: imagerows:int -> string

Visualize the values of the input matrix X where each column will be reshaped to an image with imagerows rows

VisualizeYColsAsImageGrid(imagerows)
Signature: imagerows:int -> string

Visualize the values of the output matrix Y where each column will be reshaped to an image with imagerows rows

X
Signature: DM

The matrix X of input values, where columns are the individual inputs Xi

Xi
Signature: int []

The index of the maximum elements of individual inputs Xi, used for one-hot representations

Y
Signature: DM

The matrix Y of output values, where columns are the individual outputs Yi

Yi
Signature: int []

The index of the maximum elements of individual outputs Yi, used for one-hot reprsentations

Static members

Static memberDescription
appendBiasRowX(d)
Signature: d:Dataset -> Dataset

Append a row of ones to the input matrix X of dataset d

appendRowX(v d)
Signature: v:DV -> d:Dataset -> Dataset

Append a new row v to the input matrix X of dataset d

appendRowY(v d)
Signature: v:DV -> d:Dataset -> Dataset

Append a new tow v to the output matrix Y of dataset d

empty
Signature: Dataset

The empty dataset

isEmpty(d)
Signature: d:Dataset -> bool

Check whether dataset d is empty

item(i d)
Signature: i:int -> d:Dataset -> DV * DV

Get the input-output pair with index i from dataset d

length(d)
Signature: d:Dataset -> int

The length of dataset d, i.e., the number of columns in input matrix X and output matrix Y

normalize(d)
Signature: d:Dataset -> Dataset

Normalize the values in the input matrix X and output matrix Y of dataset d to be in the range [0,1]

normalizeX(d)
Signature: d:Dataset -> Dataset

Normalize the values in the input matrix X of dataset d to be in the range [0,1]

normalizeY(d)
Signature: d:Dataset -> Dataset

Normalize the values in the output matrix Y of dataset d to be in the range [0,1]

randomSubset(n d)
Signature: n:int -> d:Dataset -> Dataset

Sample a random subset of length n from dataset d

shuffle(d)
Signature: d:Dataset -> Dataset

Shuffle the order of elements in dataset d

standardize(d)
Signature: d:Dataset -> Dataset

Standardize the values in the input matrix X and output matrix Y of dataset d to have zero mean and unit variance

standardizeX(d)
Signature: d:Dataset -> Dataset

Standardize the values in the input matrix X of dataset d to have zero mean and unit variance

standardizeY(d)
Signature: d:Dataset -> Dataset

Standardize the values in the output matrix Y of dataset d to have zero mean and unit variance

toSeq(d)
Signature: d:Dataset -> seq<DV * DV>

Get the input-output pairs of dataset d as a sequence

toString(d)
Signature: d:Dataset -> string

Get a summary string of dataset d

toStringFull(d)
Signature: d:Dataset -> string

Get a string representation of dataset d showing all values