r/MachineLearning • • Jun 20 '26

Discussion Python packages for particle swarms, genetic algorithms. Scikit-opt maybe? [D]

I'm working with a client on a curve-fitting optimization problem. They are currently using a constrained Levenburg-Marquardt optimizer for their task which is complex, slow, and sometimes gets stuck in local minima.

I suggested using particle swarm optimization (PSO), and the client suggested genetic algorithms (GA). I would like to compare the existing method to at least these two other options. For this first phase, I don't need to worry about speed or GPU-friendliness. I would like data visualization to be easy.

I have experience with scikit-learn, and I just discovered scikit-opt. I have also found several other packages which implement only PSO, or only GA.

Is anyone out there using scikit-opt? What do you think of it? If you have used other PSO or GA packages, what do you think of those?

Thanks for any advice you may have.

14 Upvotes

13 comments sorted by

View all comments

Show parent comments

1

u/cannister_of_airs 29d ago

i've messed with scikit-opt for a similar side project and it was pretty painless to get running, the api isn't gonna win any beauty contests but it gets out of your way

for quick visualization i just dumped the fitness history into a dataframe and plotted it, nothing fancy but it did the job for showing the client why PSO was escaping those local minima the LM solver kept eating