If you are developing a ML project on PHP, is it logical to use PHP itself for ML algorithms (I guess it'll be slow) or what is the correct way of implementation of ML in such project. Do I need to bridge another language like Java with Mahout? If it is the case how can I bridge?
-
possible duplicate of [How to make a PHP extension](http://stackoverflow.com/questions/3632160/how-to-make-a-php-extension) – hakre Sep 21 '12 at 09:19
-
If you can find the routines you need in Java, use the PHP-Java Bridge component. – halfer Sep 21 '12 at 09:22
-
1For interested: https://github.com/php-ai/php-ml – Arkadiusz Kondas Jul 19 '16 at 21:19
2 Answers
The machine learning can be done best in Java and Python, because of availability of excellent libraries. You can always use PHP as web front-end, because it does that best. You could expose Java/Python program on HTTP and use PHP-CURL or use one of bridges mentioned above. First off, determine the type of problem. From Wikipedia entry on Machine Learning:
- Neural Networks
- Expert Systems
- Genetic Algorithm
- Fuzzy Logic
- Bayesian network
For Python, I know of PyML, PyMC, Orage etc which are good.

- 89
- 5
Don't start off by developing your code in PHP.
Take a look at the data sets first using something like Matlab or Octave. You should be able to get a feel for the data in less than 1 day.
This will help you understand the algorithms to use.
Re language, most of the stuff I've seen has used Java. Not sure whether you'd find as many established ML libraries in PHP.
See also: Which langauge should i use for Artificial intelligence on web projects
-
+1 for not starting off in PHP, specific libraries are the way to go to develop algorithms. That being said, there *IS* a project to do ML in PHP https://github.com/gburtini/Learning-Library-for-PHP – Janis Peisenieks Sep 21 '12 at 09:23