$12.50
Write a Python program to use “Binary Particle Swarm Optimization” (BPSO) scheme to predict a linear model for an HIV inhibitor (Pill). You can either choose a linear model such as “Multiple Linear Regression”, “Support Vector Machine”, or “Partial Least Square Regression”, or a none-linear model such “Artificial Neural Network”. The architecture of the BPSO is:
How to find the initial velocity:
for (i=0; i<50; i++)
for (j=0; j<385; j++)
{
V[i, j] = random number between 0 and 1; // this is not binary. It is between 0 and 1
}
How to find the new population:
Updating the new local best Matrix:
For each row “i” of the current population
If the fitness of the population[i] < fitness of local-best[i]
Local-best[i] = population[i]
Updating the Global best row:
Global-best row = the row of the local-matrix with the lowest fitness
Updating the velocity: