Working with neuralnet in R for the first time: get “requires numeric/complex matrix/vector arguments”

前端 未结 2 1989
刺人心
刺人心 2020-11-30 03:17

I\'m in the process of attempting to learn to work with neural networks in R. As a learning problem, I\'ve been using the following problem over at Kaggle:

Don\'t wo

2条回答
  •  独厮守ぢ
    2020-11-30 04:04

    Error Message "requires numeric/complex matrix/vector arguments" occur when you have factor or character variables in your data.

    There are three ways to solve this problem:

    1. Delete the variable
    2. If the variable is an ordered factor, use integer instead.
    3. If the variable is character,transform it into factor and then into dummy variable.

    You can use model.matrix() mentioned above or class.ind() function from nnet package to transfer factor into dummy variable.

提交回复
热议问题