Body: <p>I'm trying to use the <a href="https://repositorio.unesp.br/bitstream/handle/11449/177329/2-s2.0-84926656505.pdf?sequence=1" rel="nofollow noreferrer">Binary Flower Pollination Algorithm (BFPA)</a> 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).</p>
  <p><span class="math-container">$$
  S\left(x_{i}^{j}(t)\right)=\frac{1}{1+e^{-x_{i}^{j}(t)}} \tag{4}\label{4}
  $$</span></p>
  <p><span class="math-container">\begin{equation}
  x_{i}^{j}(t)=\left\{\begin{array}{ll}
  1 &amp; \text { if } S\left(x_{i}^{j}(t)\right)&gt;\sigma \\
  0 &amp; \text { otherwise }
  \end{array}\right.
  \tag{5}\label{5}
  \end{equation}</span></p>
  <p>In my case, I noticed that my algorithm sometimes returns a zero vector (i.e. all elements are zeros, such as <span class="math-container">$[0,0,0,0,0,0,0,0,0]$</span>), which means that no feature is selected (a feature would be selected when it is <span class="math-container">$1$</span>), which makes the fitness function returns an error.</p>
  <p>Is it correct that sigmoid returns result like that?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-12T18:37:45.543Z
Comments.Text: 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.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-13T06:09:27.347Z
Comments.Text: σ is a random value between 0 and 1 ..
Comments.UserDisplayName: Adnan Hussein
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-13T09:53:36.647Z
Comments.Text: 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.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-13T13:23:44.677Z
Comments.Text: 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?
Comments.UserDisplayName: Adnan Hussein
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-13T13:30:44.207Z
Comments.Text: 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?
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-14T15:13:25.337Z
Comments.Text: after sigmoid .. there is no threshold used with binary selection ..
Comments.UserDisplayName: Adnan Hussein
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-14T15:25:10.833Z
Comments.Text: 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!!!
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-15T14:19:04.963Z
Comments.Text: 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.
Comments.UserDisplayName: nbro
Tags: <machine-learning><feature-selection><swarm-intelligence><sigmoid><binary-flower-pollination-algorithm>
Title: In the Binary Flower Pollination Algorithm (using the sigmoid function), is it possible that no feature is selected?
UserDisplayName: Adnan Hussein
ThreadText: # In the Binary Flower Pollination Algorithm (using the sigmoid function), is it possible that no feature is selected?
  
  (Asked by: username_0 on 2021-01-11)
  
  I'm trying to use the [Binary Flower Pollination Algorithm (BFPA)](https://repositorio.unesp.br/bitstream/handle/11449/177329/2-s2.0-84926656505.pdf?sequence=1) 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?
  
  **Tags:** machine-learning, feature-selection, swarm-intelligence, sigmoid, binary-flower-pollination-algorithm
  > **Comments:**
  > **username_1**: 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.  
  > **username_0**: σ is a random value between 0 and 1 ..  
  > **username_1**: 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.  
  > **username_0**: 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?  
  > **username_1**: 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?  
  > **username_0**: after sigmoid .. there is no threshold used with binary selection ..  
  > **username_1**: 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!!!  
  > **username_1**: 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.  
  
  ---
  
  ## 0 answers
  
  