I am attempting to train a neural network but got this message. Can you tell me why? Is it because it should be numeric? I have a question mark if there is missing data. Should I change this?
> dataset <- read.csv("~/DATA630/ucidatasethouse-votes-84.data.csv")
> trainset <- dataset[1:305, ]
> testset <- dataset[306:435, ]
> polpartynet <- neuralnet(Party ~ HndcpInfants + WaterProject + AdoptBudget + DocFeeFreeze + ElSalvadorAid + ReligiousGroupsSchools + AntiSatellTestBan + AidNicaraguaContras + MXMissile + Immigration + SynCorpCutback + EducationSpending + SuperfundRighttoSue + Crime + DutyFreeExports + ExportAdminSouthAfrica, trainset, hidden = 4, lifesign = "minimal", linear.output = FALSE, threshold = 0.1)
hidden: 4 thresh: 0.1 rep: 1/1 steps:
Error in neurons[[i]] %*% weights[[i]] :
requires numeric/complex matrix/vector arguments
This is what some of my data looks like....Party is the first column(numeric) and ExportAdminSouthAfrica is the last column.
Party HndcpInfants WaterProject AdoptBudget DocFeeFreeze ElSalvadorAid ReligiousGroupsSchools AntiSatellTestBan AidNicaraguaContras MXMissile Immigration SynCorpCutback EducationSpending SuperfundRighttoSue Crime DutyFreeExports ExportAdminSouthAfrica
1 n y n y y y n n n y ? y y y n y
1 n y n y y y n n n n n y y y n ?
2 ? y y ? y y n n n n y n y y n n
2 n y y n ? y n n n n y n y n n y
2 y y y n y y n n n n y ? y y y y
2 n y y n y y n n n n n n y y y y
2 n y n y y y n n n n n n ? y y y
1 n y n y y y n n n n n n y y ? y
1 n y n y y y n n n n n y y y n y