Learn R Programming

edl (version 1.1)

checkWM: Check whether cues and outcomes exist in a weight matrix and optionally add.

Description

Check whether cues and outcomes exist in a weight matrix and optionally add.

Usage

checkWM(cues, outcomes, wm)

Arguments

cues

A vector with cues.

outcomes

A vector with outcomes.

wm

A matrix with connection weights between cues and outcomes.

Value

A weightmatrix (matrix)

Examples

Run this code
# NOT RUN {
data(dat)
# create training data:
dat$Cues <- paste("BG", dat$Shape, dat$Color, sep="_")
dat$Outcomes <- dat$Category
dat$Frequency <- 1
train <- createTrainingData(dat)
# train network:
wm <- RWlearning(train)
# inspect weight matrix:
wm[[1]]
# retrieve cues and outcomes from data:
c <- getCues(wm)
o <- getOutcomes(wm)
# add missing cues to initial weight matrix:
checkWM(c, o, wm=wm[[1]])

# }

Run the code above in your browser using DataLab