I am new to neural networks and I have a question about classification with the nnet package.
I have data which is a mixture of numeric and categoric variables. I wanted to make a win lose prediction by using nnet and a function call such as
nnet(WL~., data=training, size=10)
but this gives a different result than if I use a dataframe with only numeric versions of the variables (i.e. convert all the factors to numeric (except my prediction WL)).
Can someone explain to me what is happening here? I guess nnet is interpreting the variables different but I would like to understand what is happening. I appreciate its difficult without any data to recreate the problem but I am just looking at a high level explanation of how neural networks are fitted using nnet. I cant find this anywhere. Many thanks.
str(training)
'data.frame': 1346 obs. of 9 variables:
$ WL : Factor w/ 2 levels "win","lose": 2 2 1 1 NA 1 1 2 2 2 ...
$ team.rank : int 17 19 19 18 17 16 15 14 14 16 ...
$ opponent.rank : int 14 12 36 16 12 30 11 38 27 31 ...
$ HA : Factor w/ 2 levels "A","H": 1 1 2 2 2 2 2 1 1 2 ...
$ comp.stage : Factor w/ 3 levels "final","KO","league": 3 3 3 3 3 3 3 3 3 3 ...
$ days.since.last.match: num 132 9 5 7 14 7 7 7 14 7 ...
$ days.to.next.match : num 9 5 7 14 7 9 7 9 7 8 ...
$ comp.last.match : Factor w/ 5 levels "Anglo-Welsh Cup",..: 5 5 5 5 5 5 3 5 3 5 ...
$ comp.next.match : Factor w/ 4 levels "Anglo-Welsh Cup",..: 4 4 4 4 4 3 4 3 4 3 ...
vs
str(training.nnet)
'data.frame': 1346 obs. of 9 variables:
$ WL : Factor w/ 2 levels "win","lose": 2 2 1 1 NA 1 1 2 2 2 ...
$ team.rank : int 17 19 19 18 17 16 15 14 14 16 ...
$ opponent.rank : int 14 12 36 16 12 30 11 38 27 31 ...
$ HA : num 1 1 2 2 2 2 2 1 1 2 ...
$ comp.stage : num 3 3 3 3 3 3 3 3 3 3 ...
$ days.since.last.match: num 132 9 5 7 14 7 7 7 14 7 ...
$ days.to.next.match : num 9 5 7 14 7 9 7 9 7 8 ...
$ comp.last.match : num 5 5 5 5 5 5 3 5 3 5 ...
$ comp.next.match : num 4 4 4 4 4 3 4 3 4 3 ...