Hello,
I'm trying to fit a simple classification model using neuralnet
, but I encounter some problems. I want to examine how L2 vowels are classified in terms of L1 vowel categories based on F1, F2, F3, and duration. My code is the following:
fit_train <- neuralnet(vowel ~ F1 + F2 + F3 + duration, hidden= 10, linear.output = FALSE, data=train)
pred <- compute(fit_train, test[,2:5])
idx <- apply(pred$net.result, 1, which.max)
predicted <- c("i", "a", "e", "o", "u") [idx]
table(test$vowel, predicted)
predicted
a e i o u
had 13 0 1 0 6
hard 0 0 0 0 20
head 19 0 0 0 1
heed 0 20 0 0 0
herd 5 0 0 0 15
hid 9 9 0 1 1
hoard 0 0 0 0 20
hod 0 0 0 0 20
hood 5 0 0 0 15
hud 2 0 0 1 17
whod 6 2 0 2 10
The classification results I receive are far away from ideal and differ a lot from those I received from other types of analyses. I changed hidden
many times, but, still, the results are not accurate. Are there any errors in the code? Any suggestions?