Description Details Methods Author(s) Examples
R6 class representing an array dataset
R6 class representing an array dataset
It loads the data from an R array
new()
Initialisation method.
DataSet.Array$new(X, indexes, yi, si)
X
array
indexes
subset of indexes along the sliceing dimension
yi
subset of indexes to return as targets
si
index of slicing dimension
length()
Returns the length of the dataset
DataSet.Array$length()
X = matrix(rnorm(100), 20) ds = DataSet.Array$new(X, 1:20, 1, 1) ds$length() # 20
has.next()
Returns TRUE if the dataset has still data
DataSet.Array$has.next()
X = matrix(rnorm(100), 20) ds = DataSet.Array$new(X, 1:20, 1, 1) ds$has.next() # TRUE
reset()
Reset the dataset to its initial state
DataSet.Array$reset()
X = matrix(rnorm(100), 20) ds = DataSet.Array$new(X, 1:20, 1, 1) ds$..get.data..() ds$..get.data..() ds$reset() ds$..get.data..()
..pop.index..()
Auxiliary method not to be called directly. It pops an index from the dataset according to the given method
DataSet.Array$..pop.index..(mode = "head")
mode
popping mode
..get.data..()
Auxiliary method not to be called directly.
DataSet.Array$..get.data..(mode = "head")
mode
popping mode
feed()
Method to feed the bathces of data to 'numbers'.
DataSet.Array$feed(x, mode = "head")
x
number
mode
popping mode
modello.init(100, 100, 100, 100) X = matrix(rnorm(100), 20) ds = DataSet.Array$new(X, 1:20, 1, 1) x = number(rnorm(5)) print(x$v) ds$feed(x) print(x$v) modello.close()
clone()
The objects of this class are cloneable with this method.
DataSet.Array$clone(deep = FALSE)
deep
Whether to make a deep clone.
Filippo Monari
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ## ------------------------------------------------
## Method `DataSet.Array$length`
## ------------------------------------------------
X = matrix(rnorm(100), 20)
ds = DataSet.Array$new(X, 1:20, 1, 1)
ds$length() # 20
## ------------------------------------------------
## Method `DataSet.Array$has.next`
## ------------------------------------------------
X = matrix(rnorm(100), 20)
ds = DataSet.Array$new(X, 1:20, 1, 1)
ds$has.next() # TRUE
## ------------------------------------------------
## Method `DataSet.Array$reset`
## ------------------------------------------------
X = matrix(rnorm(100), 20)
ds = DataSet.Array$new(X, 1:20, 1, 1)
ds$..get.data..()
ds$..get.data..()
ds$reset()
ds$..get.data..()
## ------------------------------------------------
## Method `DataSet.Array$feed`
## ------------------------------------------------
modello.init(100, 100, 100, 100)
X = matrix(rnorm(100), 20)
ds = DataSet.Array$new(X, 1:20, 1, 1)
x = number(rnorm(5))
print(x$v)
ds$feed(x)
print(x$v)
modello.close()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.