# In the Binary Flower Pollination Algorithm (using the sigmoid function), is it possible that no feature is selected?

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}$$

$$$$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}$$$$

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?

• 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 at 18:37
• σ is a random value between 0 and 1 .. – Adnan Hussein Jan 13 at 6: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 at 9: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 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 at 13:30