amrElmSSL.default: Creates a model for AMR-ELM.

Description Usage Arguments Value Examples

Description

Creates a model for AMR-ELM.

Usage

1
2
## Default S3 method:
amrElmSSL(X, y, hidden_neurons, nl, affinity = "cosine")

Arguments

X

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

y

training data labels (only two classes, with labels equals to -1 or +1, and 0 for the unlabeled patterns)

hidden_neurons

the number of hidden neurons

nl

the number of labeled patterns

affinity

- only cosine implemented

Value

The amrElm model for semissupervised problems - a list 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) X: training data for generating affinity matrix.

Examples

 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

hidden_neurons <- 500
nl <- 50

N <- nrow(data)
randomPatterns <- seq(N)

data <- data[randomPatterns,]
labels <- labels[randomPatterns]

n <- floor(2*N/3)
nTest <- N - n

data <- data[randomPatterns,]
labels <- labels[randomPatterns]

X <- data[1:n,]
XTest <- data[(n+1):N,]

y <- labels[1:n]
y[(nl+1):n] <- 0

model <- amrElmSSLTrain(hidden_neurons,nl,X,y)
testOutput <- amrElmTest(XTest, model)

## End(Not run)

rladeira/amrElm documentation built on May 27, 2019, 9:17 a.m.