# NOT RUN {
# load example data:
data(dat)
# add obligatory columns Cues, Outcomes, and Frequency:
dat$Cues <- paste("BG", dat$Shape, dat$Color, sep="_")
dat$Outcomes <- dat$Category
dat$Frequency <- dat$Frequency1
head(dat)
dim(dat)
# now use createTrainingData to sample from the specified frequencies:
train <- createTrainingData(dat)
# this training data can actually be used train network:
wm <- RWlearningNoCueCompetition(train)
# in R markdown or knitr reports the progress bar should be turned off:
wm <- RWlearningNoCueCompetition(train, progress=FALSE)
# Learning in steps is also possible:
wm <- RWlearningNoCueCompetition(train[1:20,])
getWM(wm)
length(wm)
train[21,c("Cues", "Outcomes")]
wm <- RWlearningNoCueCompetition(train[21,], wm=wm)
getWM(wm)
length(wm)
# }
Run the code above in your browser using DataLab