2

I'm trying to use the Binary Flower Pollination Algorithm (BFPA) for feature selection. In the BFPA, the sigmoid function is used to compute a binary vector that represents whether a feature is selected or not. Here are the relevant equations from the paper (page 4).

$$ S\left(x_{i}^{j}(t)\right)=\frac{1}{1+e^{-x_{i}^{j}(t)}} \tag{4}\label{4} $$

\begin{equation} x_{i}^{j}(t)=\left\{\begin{array}{ll} 1 & \text { if } S\left(x_{i}^{j}(t)\right)>\sigma \\ 0 & \text { otherwise } \end{array}\right. \tag{5}\label{5} \end{equation}

In my case, I noticed that my algorithm sometimes returns a zero vector (i.e. all elements are zeros, such as $[0,0,0,0,0,0,0,0,0]$), which means that no feature is selected (a feature would be selected when it is $1$), which makes the fitness function returns an error.

Is it correct that sigmoid returns result like that?

nbro
  • 39,006
  • 12
  • 98
  • 176
  • Which $\sigma$ are you using in your case? Clearly, if $\sigma$ is very big, then it's possible that most features will not be selected, according to formula 5. – nbro Jan 12 '21 at 18:37
  • σ is a random value between 0 and 1 .. – Adnan Hussein Jan 13 '21 at 06:09
  • If you have a link to a Github repository that contains your implementation of the BFPA algorithm, it may be a good idea to edit your answer and provide such a link. However, note that programming issues are off-topic here. I'm suggesting you to include the link in case someone wants to take a look at the source code for more info. – nbro Jan 13 '21 at 09:53
  • unfortunately, I didn't put it at Github yet,,, I am just asking about sigmoid function, Is it possible to return a zero vector like what I explained in my question? or it always returned at least one selected feature? – Adnan Hussein Jan 13 '21 at 13:23
  • It's not clear to me if you're getting a zero vector after the sigmoid or after the threshold operation (operation 5). Can you clarify this? – nbro Jan 13 '21 at 13:30
  • after sigmoid .. there is no threshold used with binary selection .. – Adnan Hussein Jan 14 '21 at 15:13
  • Are you following this paper https://repositorio.unesp.br/bitstream/handle/11449/177329/2-s2.0-84926656505.pdf?sequence=1? Check section 2.1.1. So, yes, there's a threshold operation after the sigmoid and I've also included it in your post above!!! – nbro Jan 14 '21 at 15:25
  • Please, provide a link to your source code. For example, create a **public** Github gist [here](https://gist.github.com/) to share your code. That may be helpful. – nbro Jan 15 '21 at 14:19

0 Answers0