"Neural Networks NaN Error"

mksaadmksaad MemberPosts:42Guru
edited May 2019 inHelp
Hello,

I am try to train my Neural Network on the data set athttp://sites.google.com/site/motazsite/teaching/data-mining-discussion/trndataCSV.csv

But I got the error below.
Process failed: operator cannot be executed (Trying to assign invalud number to matrix: NaN)

I trained many NN without any problem. What is wrong with this dataset?


Thanks,
Motaz

Answers

  • haddockhaddock MemberPosts:849Maven
    Greetings Motaz,

    I don't think there is much wrong with the data, as the following works for me..





















    So it has more to do with the learner not liking the data, in particular not finding a number where it wants one; so changing the learner, as above, looks like the way to go. Hope that helps.


  • mksaadmksaad MemberPosts:42Guru
    Thanks for reply,

    It worked with me now after I changed the format from csv to xls
























    But the Model Has no Weights !!! ???
    image
    NeuralNet
    Layer 'Input [linear]' (14 nodes) --------------------------------- [age, workclass, fnlwgt, education, education-num, marital-status, occupation, relationship, race, sex, capital-gain, capital-loss, hours-per-week, native-country] Layer 'Hidden-1 [sigmoid]' (8 nodes) ------------------------------------ Input Weights: Node 1 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN Node 2 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN Node 3 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN Node 4 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN Node 5 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN Node 6 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN Node 7 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN Node 8 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN Layer 'Output [sigmoid]' (1 node) --------------------------------- Input Weights: Node 1 NaN NaN NaN NaN NaN NaN NaN NaN
    And the Model Has been evaluated !

    PerformanceVector:
    accuracy: 68.84%
    ConfusionMatrix:
    True: <=50K >50K
    < = 50 k: 411 186
    >50K: 0 0

    Thanks in advance,
    Motaz
  • TobiasMalbrechtTobiasMalbrecht Moderator, Employee, MemberPosts:294RM Product Management
    Hi,

    首先,在数值inpu神经网络的工作原理ts. If you have nominal attributes as in your data set, the internal representation will be used, which assigns numerical values to the nominal ones depending on the order in which values appear in the data set. Hence, it is in no way advisable to directly work on such nominal values when learning a neural net. Unfortunately, the old implementation [tt]NeuralNet[/tt] still allows that. Anyway, the operator [tt]NeuralNet[/tt] is deprecated. You should use the operator [tt]NeuralNetImproved[/tt] instead. This one also forces you to change the value types of the nominal attributes beforehand, as it does not work on nominal attributes.

    Kind regards,
    Tobias
  • mksaadmksaad MemberPosts:42Guru
    Hello Tobias,

    I am using Rapid Miner 4.4
    Where can find NeuralNetImproved operator?. I have only NeuralNetSimple and NeuralNet at Learner.Supervised.Functions



    Thanks,
    Motaz
  • haddockhaddock MemberPosts:849Maven
    Greetings Motaz,

    4.4 has the new NN in the area you mentioned, mine has the other two faded to show they are to be phased out. When I looked at the data I noticed quite a few attributes that were nominal, like country. It is difficult to see a sensible way of making them numerical. So my advice again is to look at learners that handle both numeric and nominal values, and to bin the NN approach because that is for numerics.

    Just my two cents;)
  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:2,531Unicorn
    Hi,
    one way of making them numerical would be to use the nominal2binomial operator and then convert these binominal values to 0s and 1s.

    Another hint is, that you should check if there are missing values in your dataset. These might confuse the neural net during adapting its nodes weights.

    Greetings,
    Sebastian
  • mksaadmksaad MemberPosts:42Guru
    I would like to thank all of you.



    Warm Greetings,
    Motaz
Sign InorRegisterto comment.