Description Usage Arguments Value Examples
Function to train an Artificial Hydrocarbon Network (AHN).
1 | fit(Sigma, n, eta, maxIter = 2000)
|
Sigma |
a list with two data frames. One for the inputs X, and one for the outputs Y. |
n |
number of particles to use. |
eta |
learning rate of the algorithm. Default is |
maxIter |
maximum number of iterations. |
an object of class "ahn
" with the following components:
network: structure of the AHN trained.
Yo: original output variable.
Ym: predicted output variable.
eta: learning rate.
minOverallError: minimum error achieved.
variableNames: names of the input variables.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Create data
x <- 2 * runif(1000) - 1;
x <- sort(x)
y <- (x < 0.1) * (0.05 * runif(100) + atan(pi*x)) +
(x >= 0.1 & x < 0.6) * (0.05 * runif(1000) + sin(pi*x)) +
(x >= 0.6) * (0.05 * runif(1000) + cos(pi*x))
# Create Sigma list
Sigma <- list(X = data.frame(x = x), Y = data.frame(y = y))
# Train AHN
ahn <- fit(Sigma, 5, 0.01, 500)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.