Description Usage Arguments Value Examples
Performs a multilayer perceptron classification
1 2 | MLP_classification(X_train, Y_train, X_test, n_neurons, weight_decay = 0,
max_iter = 1000)
|
X_train |
A Matrix of trainning observations. |
Y_train |
A numeric vector of classes or values of the trainning observations |
X_test |
A Matrix of testing observations. |
n_neurons |
Number of neurons in the hidden layer. |
weight_decay |
Weigth decay parameter for neural network. |
max_iter |
Maximun number of trainning iterations. |
predicted values
1 2 3 4 5 6 7 8 9 | X <- as.matrix(cbind(runif(n = 100), runif(n = 100)))
pos <- sample(100, 70)
X_train <- X[pos, ]
X_test <- X[-pos, ]
Y_train <- as.numeric( X_train[, 1] ** 2 - X_train[, 2] > 0)
Y_test <- as.numeric(X_test[, 1] ** 2 - X_test[, 2] > 0)
n_neurons <- 50
Y_predicted <- MLP_classification(X_train = X_train, Y_train = Y_train, X_test = X_test, n_neurons = n_neurons)
table(Y_test, Y_predicted)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.