scipsycho / mlpack

Self written packages for Machine learning algorithms like Linear Regression, KNN,ANN etc.
MIT License
2 stars 2 forks source link

Using scipy's genetic algorithm for initial parameter estimation in gradient descent #1

Open zunzun opened 7 years ago

zunzun commented 7 years ago

I see you are writing code for gradient descent regression, and in your code you start the gradient descent with random initial parameter values. This can be suboptimal and in more complex equations often results in the algorithm finding a local minimum. For this reason, the authors of scipy added a genetic algorithm for initial parameter estimation. The module is named scipy.optimize.differential_evolution.

I have used scipy's Differential Evolution genetic algorithm to determine initial parameters for fitting a double Lorentzian peak equation to Raman spectroscopy data and found that the results were excellent. The GitHub project, with a test spectroscopy data file, is:

https://github.com/zunzun/RamanSpectroscopyFit

If you have any questions, please let me know. I will be glad to help.

James Phillips

scipsycho commented 7 years ago

Yeah, that's a very good suggestion. I am still a learner in this field and just thought to make my own packages so to get a better understanding. I will definitely work on your suggestion.

Thanks