Open ashhadulislam opened 1 year ago
This happens in cases when, after multiplying by the weights, all the result values become more than the threshold. For example, say we have 30 columns, each column is normalized between 0 and 1 However, when we multiply them with the weights, it may so happen that the resulting values go more than 1. In case of the breast cancer dataset, the weights ~(0,1) the features ~(0,1), however after multiplying and ADDING, the result values become all more than 1. However, the threshold is randomly selected between 0 and 1. Thus while grouping into more than and less than threshold, all results are going into the class "more than threshold".
As can be seen in the figure, threshold is 0.037460517 while all the weights are more than 1.
Thus, solution is to normalize the results every time they are generated.
Also, this problem of same PSO threshold is seen in case of breast cancer dataset and not iris dataset. The reason is that as iris dataset has only 4 columns, after multiplication and addition the sum res is not more than 1.
Above solution works when we use only the train dataset. Now imagine you have only one row in your test dataset. You multiply it with the best weights and sum it up You get a value >1. Now, how are you going to normalize it?
One option is to use tanh function
pbest value for all particles are same.
Issue detected and opened by Sara