Closed TommyJones closed 4 years ago
@TommyJones Thanks for the reprex. The documentation for the nnet package is a bit sparse.
Looks like you are using a multinomial model, via nnet. I haven't tested the package with these models at all, so the order of the weights might be incorrect. Have you checked the order without using a classification model? Could just be that I need to add a disclaimer that the functions don't work for multinomial models.
I have not tried it with a non-multinomial classification model. But thank you for the tool. I was quite stuck and this package got me unstuck, even if the weights weren't in the right place.
On Mon, Apr 6, 2020 at 8:17 AM Marcus W Beck notifications@github.com wrote:
@TommyJones https://github.com/TommyJones Thanks for the reprex. The documentation for the nnet package is a bit sparse.
Looks like you are using a multinomial model, via nnet. I haven't tested the package with these models at all, so the order of the weights might be incorrect. Have you checked the order without using a classification model? Could just be that I need to add a disclaimer that the functions don't work for multinomial models.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fawda123/NeuralNetTools/issues/22#issuecomment-609758233, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGCQAXI3BUHIUQ327OSTK3RLHB4DANCNFSM4LPKRYAQ .
If it helps, you can see how the weights are extracted here: https://github.com/fawda123/NeuralNetTools/blob/eb2f60ab7c16bb57a2a7bf006279f4a4bf6c4e4b/R/NeuralNetTools_utils.R#L104
It's super hacky, but it gives the correct order needed for the rest of the functions in the package. Model predictions are another question...
Hi. It seems to me that using
neuralweights
to extract weights from a network from thennet
package results in the weights being placed in the wrong order. The result is that if you use these weights for manual prediction, the predictions will be wrong. (Note that I believe this issue is exacerbated by poor documentation onnnet
's part.)I've included a reproducible example below.