Description Usage Arguments Value Examples
Creates a model for AMR-ELM.
1 | amrElmSSLTrain(l, nl, XTrain, YTrain, affinity = "cosine")
|
l |
the number of hidden neurons |
nl |
the number of labeled patterns |
XTrain |
training data, numerical with zero mean and unit variance and patterns in the lines, attributes in the columns - the unlabeled patterns must came after the labeled ones |
YTrain |
training data labels (only two classes, with labels equals to -1 or +1, and 0 for the unlabeled patterns) |
affinity |
- only cosine implemented |
The amrElm model for semissupervised problems - a list with: Z: hidden layer weights H: hidden layer output W: 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 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## Not run:
library(amrElm)
data(heart)
data <- heart$data
labels <- heart$labels
l <- 500
nl <- 50
N <- nrow(data)
randomPatterns <- seq(N)
data <- data[randomPatterns,]
labels <- labels[randomPatterns]
nTrain <- floor(2*N/3)
nTest <- N - nTrain
data <- data[randomPatterns,]
labels <- labels[randomPatterns]
XTrain <- data[1:nTrain,]
XTest <- data[(nTrain+1):N,]
YTrain <- labels[1:nTrain]
YTest[(nl+1):nTrain] <- 0
model <- amrElmSSLTrain(l,nl,XTrain,YTrain)
testOutput <- amrElmTest(XTest, model)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.