Description Usage Arguments Value Examples
Creates a model for AMR-ELM.
1 2 |
X |
training data, numerical with zero mean and unit variance and patterns in the lines, attributes in the columns |
y |
training data labels (binary, -1 and +1) |
hidden_neurons |
the number of hidden neurons |
affinity |
- only cosine implemented |
the amrElm model for supervised problems, with: Z: hidden layer weights H: hidden layer output weights: output layer weights affinity: the affinity used to generate the model (e.g.: cosine affinity) dataTrain: training data for generating affinity matrix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
library(amrElm)
data(heart)
data <- heart$data
labels <- heart$labels
n <- nrow(data)
split <- caTools::sample.split(labels, SplitRatio = 0.7)
train_data <- data[split == TRUE, ]
test_data <- data[split == FALSE, ]
train_labels <- labels[split == TRUE]
test_labels <- labels[split == FALSE]
model <- amrElm(train_data, train_labels, hidden_neurons = 500)
predicted_labels <- predict(model, test_data)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.