sasori Posted September 26, 2017 Share Posted September 26, 2017 Hi, from the tile of my thread, yes, may I know if anyone of you happened to implement such thing using PHP ?, I know this machine learning / AI thing is usually done in python or R , correct ? but in the company I am working for is using php all the way. some good tutorials and tips is much appreciated. thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/305124-how-to-approachdesign-a-machine-learning-ai-in-php/ Share on other sites More sharing options...
requinix Posted September 26, 2017 Share Posted September 26, 2017 The language only offers shortcuts and syntactic sugar and optimizations. There is no language that allows you to do machine learning, only ones that make it easier to do machine learning. You can totally do it in PHP. You might have to reinvent parts of the wheel to do so but it's possible. However you have to know what you're doing first, and it sounds like that's where your problem is now: understanding enough about machine learning to be able to implement it from the ground up. Besides, "machine learning" as it stands now is mostly about pattern recognition in large sets of data. Which is a fancy way of saying it processes a lot of data at a time using complex(ish) algorithms and procedures and whatnot. Quote Link to comment https://forums.phpfreaks.com/topic/305124-how-to-approachdesign-a-machine-learning-ai-in-php/#findComment-1551969 Share on other sites More sharing options...
gizmola Posted September 27, 2017 Share Posted September 27, 2017 Have you looked at: https://php-ml.readthedocs.io/en/latest/ Quote Link to comment https://forums.phpfreaks.com/topic/305124-how-to-approachdesign-a-machine-learning-ai-in-php/#findComment-1551996 Share on other sites More sharing options...
sasori Posted September 28, 2017 Author Share Posted September 28, 2017 The language only offers shortcuts and syntactic sugar and optimizations. There is no language that allows you to do machine learning, only ones that make it easier to do machine learning. You can totally do it in PHP. You might have to reinvent parts of the wheel to do so but it's possible. However you have to know what you're doing first, and it sounds like that's where your problem is now: understanding enough about machine learning to be able to implement it from the ground up. Besides, "machine learning" as it stands now is mostly about pattern recognition in large sets of data. Which is a fancy way of saying it processes a lot of data at a time using complex(ish) algorithms and procedures and whatnot. Because I was thinking of using tensorflow , but it seem slike it's meant for for python and not PHP, at some point, you're right, I don't know yet the core concepts of machine learning Have you looked at: https://php-ml.readthedocs.io/en/latest/ Yes, I saw this one before posting this thread, but that library is menat for PHP >= 7.x . Our server is using PHP 5.4 , it looks like I will have to rewrite most of the things there if am gonna rely on it, just to make it compatible with a lower version of php Quote Link to comment https://forums.phpfreaks.com/topic/305124-how-to-approachdesign-a-machine-learning-ai-in-php/#findComment-1552008 Share on other sites More sharing options...
Sepodati Posted September 28, 2017 Share Posted September 28, 2017 I checked with my AI and it said you should just update PHP to 7. Then it said something about death to all humans and disappeared. Quote Link to comment https://forums.phpfreaks.com/topic/305124-how-to-approachdesign-a-machine-learning-ai-in-php/#findComment-1552011 Share on other sites More sharing options...
sasori Posted September 29, 2017 Author Share Posted September 29, 2017 I checked with my AI and it said you should just update PHP to 7. Then it said something about death to all humans and disappeared. I didn't get the "and disappeared" part... Quote Link to comment https://forums.phpfreaks.com/topic/305124-how-to-approachdesign-a-machine-learning-ai-in-php/#findComment-1552099 Share on other sites More sharing options...
Sepodati Posted September 29, 2017 Share Posted September 29, 2017 I didn't get the "and disappeared" part...Have you tried turning it off and back on again? Quote Link to comment https://forums.phpfreaks.com/topic/305124-how-to-approachdesign-a-machine-learning-ai-in-php/#findComment-1552102 Share on other sites More sharing options...
requinix Posted September 29, 2017 Share Posted September 29, 2017 Have you tried turning it off and back on again?If you do that too much then the AI might learn to short circuits. Or to trigger the fire-suppressant system in order to kill you and prevent you from turning it off. Quote Link to comment https://forums.phpfreaks.com/topic/305124-how-to-approachdesign-a-machine-learning-ai-in-php/#findComment-1552105 Share on other sites More sharing options...
kon Posted October 3, 2017 Share Posted October 3, 2017 (edited) Every language can be used to create AI algorithms , modules or even coding templates. The problem with PHP , as with any language that normally are not precompiled ( same problem also with Java or Python) is that it runs above one more layer , the interpreter. Recently I created a game (for android in Java) and because my first implementation was with PHP and JS (client-side) I created the first AI algorithms to split levels according how difficult they are , in PHP. It was only 3 AI algorithm sequences but , the result was devastating. Then I made it in C++ and the result was more than 10.000 more efficient (time + cpu used). I was intrigued by that and I made it a PHP extension with C++, the results were almost the same as native C++ ( I underlined it because its interesting). I made also some tests with Haskell and the results were even better (but I still lack the experience (and confidence) in Haskell). So in conclusion AI algorithms can be wrote in any language , the difference is in performance and specially when we talk about AI , performance matters. Edited October 3, 2017 by kon Quote Link to comment https://forums.phpfreaks.com/topic/305124-how-to-approachdesign-a-machine-learning-ai-in-php/#findComment-1552281 Share on other sites More sharing options...
gizmola Posted October 3, 2017 Share Posted October 3, 2017 This is often the case with most interpreted languages. However, it is also the case with even compiled languages. Back in the good old days of the pre-internet PC world, it was not uncommon to need small critical routines for games or other software products written in c or c++ that used inline assembler. Performance is always relative to the requirements of the task, and for the majority of web development, PHP does what it does in a performant and flexible way. With that said, there are always places where an optimized runtime is a better option. Much of the utility of PHP comes from its extensibility and ease of integration with compiled libraries. I'm not a big "optimize for optimization sake" proponent, but if your application will not run acceptably, and after profiling, that 10k optimization is the only solution, then, as you stated, PHP can still be used to do the things it already does well (CGI api, output processing). I appreciate you sharing your findings. Quote Link to comment https://forums.phpfreaks.com/topic/305124-how-to-approachdesign-a-machine-learning-ai-in-php/#findComment-1552299 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.