# Transaction classification. Artificial intelligence

For a project, I have to classify a list of banking transactions based on their description.

Supose I have 2 categories: health and entertainment. Initially, the transactions will have basic information: date and time, ammount and a description given by the user. For example:

``````Transaction 1: 09/17/2012 12:23:02 pm - 45.32\$ - "medicine payments"
Transaction 2: 09/18/2012 1:56:54 pm - 8.99\$ - "movie ticket"
Transaction 3: 09/18/2012 7:46:37 pm - 299.45\$ - "dentist appointment"
Transaction 4: 09/19/2012 6:50:17 am - 45.32\$ - "videogame shopping"
``````

The idea is to use that description to classify the transaction. 1 and 3 would go to "health" category while 2 and 4 would go to "entertainment".

I want to use the google prediction API to do this. In reality, I have 7 different categories, and for each one, a lot of key words related to that category. I would use some for training and some for testing.

Is this even possible? I mean, to determine the category given a few words? Plus, the number of words is not necesarally the same on every transaction.

Thanks for any help or guidance! Very appreciated

-
"medicine payments health" has 160M Google hits, "medicine payments entertainment" only 51M. Crude but effective. – MSalters Sep 18 '12 at 13:35

I have 7 different categories, and for each one, a lot of key words related to that category. I would use some for training and some for testing.

Sounds like a simple Bayesian classification should work well. I'm sure there's libraries which implement that for all major programming languages.

-
I have some knoledge in machine learning because in college I worked on some projects in which we used neural networks to classify stuff. What I don't remember is working with a variable number of inputs. In the wikipedia entry you posted, they use weight, height and foot size to determine sex. In my case, I have a description, and that could be 1 word, or several words. So, how many neurons on the first layer? .. That's what I can't figure out how to handle – Alex Sep 17 '12 at 20:02
@Alex: Bayesian classification has nothing to do with neural networks. It basically works by first determining from the training input a bunch of data points of the form "input belonging to class N contained the word A in X% of all cases" and from that via Bayes' theorem derives results like "input that consists of the words A, B, and C belongs to class N with a likelihood of X%, to class M with a likelihood of Y%, etc. - the number of words in the input is not fixed. The most well-known application of Bayesian classification is spam filtering. – Michael Borgwardt Sep 17 '12 at 20:11

You can use Clustering and Natural Language processing.

Coursera have excellent courses on this subjects:

-