Description Usage Arguments Value Examples
View source: R/simulate_regression_data.R
Simulate data for a Neural Network Structure.
1 2 | simulate_regression_data(rows = 1000L, N = 5L, U = 5L, C = 0L,
matrices, activations, noise = 0)
|
rows |
An integer scaler. The number of rows in simulated data. |
N |
An integer scaler. The number of normal random variables in X. |
U |
An integer scaler. The number of uniform random variables in X. |
C |
An integer scaler. The number of binary random variables in X. |
matrices |
A list. Each element is a matrix defining the structure the layer. |
activations |
A list. Each element is a activation function. |
noise |
A positive numeric scaler. The standard deviation of a normal random variable added to response. 0 is no noise. |
A matrix containing predictor variables and a response variable.
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 40 41 42 43 44 45 46 47 48 | library(NeuralNetworkSimulatoR)
# Network with no hidden layers.
# Linear regression with weights 1, 2, and 3
M <- list(matrix(1:3, nrow = 3, ncol = 1))
A <- list(linear_R)
simData <- simulate_regression_data(
rows = 1000L,
N = 3L, U = 0L, C = 0L,
matrices = M, activations = A,
noise = 0
)
rm(A, M, simData)
# Network with 1 hidden layer.
# 10 nodes in first layer. Activation relu
# 5 nodes in second layer. Activation elu_R (hidden layer)
M <- list(
matrix(1:10, nrow = 10, ncol = 5),
matrix(1:5, nrow = 5, ncol = 1)
)
A <- list(relu_R, elu_R)
simData <- simulate_regression_data(
rows = 1000L,
N = 5L, U = 5L, C = 0L,
matrices = M, activations = A,
noise = 0
)
rm(A, M, simData)
# Network with 2 hidden layers.
# 10 nodes in first layer. Activation relu
# 5 nodes in second layer. Activation linear_R (hidden layer)
# 3 nodes in third layer. Activation relu_R (hidden layer)
M <- list(
matrix(1:10, nrow = 10, ncol = 5),
matrix(1:5, nrow = 5, ncol = 3),
matrix(1:3, nrow = 3, ncol = 1)
)
A <- list(relu_R, linear_R, relu_R)
simData <- simulate_regression_data(
rows = 1000L,
N = 5L, U = 5L, C = 0L,
matrices = M, activations = A,
noise = 0
)
rm(A, M, simData)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.