20

I would like to begin experimenting with algorithms that recognize patterns in data. I deal with many types of sequences (image pixels, text input, user movement), and it would be fun to make use of Pattern Recognition to try to pull meaningful data out of different datasets. Like the majority of the web, my data is mostly text or integer-key based.

Are their any classes that give the basic framework for checking/creating patterns for PHP or Nodejs?

Xeoncross
  • 55,620
  • 80
  • 262
  • 364
  • 3
    Is PHP/JS the right tool for this? – webbiedave May 16 '12 at 16:58
  • 3
    @webbiedave, since I have PHP and node.js applications operating on this data already. It's the *right-enough* tool for lightweight work. Perhaps C would be better, but my applications aren't in C. – Xeoncross May 16 '12 at 17:01
  • I also think both languages would completely suck at that because of no thread model. I would use something like Java for example for this. Also I think this is a pretty hard problem and probably not solved yet..? – Alfred May 16 '12 at 18:11

3 Answers3

11

I've never found a single library that encapsulates different analysis patterns. You may find specific solutions easily though.

N-Gram analysis for example can be done with this PHP extension: http://pecl.php.net/package/TextCat

There are several bayes implementations as well, even tutorials.

I've never found Kohonen-nets or self-organizing maps implemented in PHP, but multi-layer perceptrons are trivial. IA can do pattern analysis fairily well.

There are projects that bind PHP to OpenCV (a library for realtime image/video analysis). Currently, the only implementation I know is for detecting human faces in pictures. The source is open https://github.com/infusion/PHP-Facedetect, so it should be easy to bind other OpenCV goodness (OpenCV can do a lot of stuff with images).

PHP itself is interpreted, most heavy solutions for pattern analysis won't perform well under this limitation. This is why most solutions for this in PHP are written in C as an extension.

alganet
  • 2,527
  • 13
  • 24
  • These two projects are a good start, but I'm looking for more advanced/complete examples including other forms of text processing besides a basic [bigram filter](https://gitorious.org/textus/php-language-detection) (textcat). – Xeoncross May 21 '12 at 18:33
  • I agree with the last statement. If you are trying to do some heavy computations with PHP, you might want to start investigating how to do it in C and then make an custom extension. – afuzzyllama May 24 '12 at 13:52
3

For machine learning you might consider using a language that is more 'at home' as it'd be easier to express the model..

For example the source code for the new 'Machine Learning for Hackers' book, written in R can be found in Github https://github.com/johnmyleswhite/ML_for_Hackers

And then, there's also the Google Prediction API, which is good for experimenting https://developers.google.com/prediction/docs/developer-guide

250R
  • 35,945
  • 7
  • 33
  • 25
0

I realise this is an old question, but since it came at the top of a Google query, it thought it ought to contain a reference to the Node bindings for opencv, node-opencv.

Lee Goddard
  • 10,680
  • 4
  • 46
  • 63