Saturday, April 25, 2009

Classification

1. What is Classification ?
Classification is the technique of labelling new data with some specific class labels depending on some past observations (training data set). It is also called Supervised learning because you assist the machine learning process by training the system with some labelled data set

2. Motivation
Lets take this problem domain of spam emails. say, we want to automatically classify spam mails and send them to spam folders. How does the mail system know that a certain mail is spam ? Apply classification algorithms to teach the machines so it can identify spam mails.

3. Basic Idea
Classification is a two step process.

Step 1 - Model Construction:

Our goal is to train a system with training data set which has predefined classes. For example, our data has designation of faculties and their years of experience and specifies if they have a tenure or not. The classifier will learn a rule from the given data set to identify when a faculty can get a tenure. Once this training is done, we have a Trained Model that can be used for classification.


Step 2 - Model Usage:

We first test the constructed model for accuracy.

Once the accuracy is acceptable, we use the model to classify new data. So when a new faculty arrives, the Model would assign a class label ("Tenure" or "Not Tenured") depending on the rule that was learned during the Model Construction phase


4. Practical Applications
1. Spam Filtering
2. Anomaly Detection
3. Loan Approval

5. Important papers / Algorithms
1. Decision Tree - Ross Quinlan
2. Bayesian classifier
3. Support Vector Machines - seems to be the most preferred classifier
4. Neural Networks

6. Math concepts widely used
Probability and Linear Algebra are widely used

References:
Pictures are taken from Class notes of Prof. Han (UIUC)

Sunday, March 22, 2009

Association and Correlation Analysis

1. What is Association and Correlation Analysis ?
Association Analysis is closely related to frequent pattern analysis. Association rules are generated during Association analysis and they specify how items / objects are associated to each other. A simple example is {milk} -> {bread} is a association rule that specifies that people who buy milk also buys bread.
A frequent pattern mining could typically help discover thousands of association rules and many of them might not be interesting or useful rules. So a correlation measure helps to narrow down on the useful association rules.

2. Motivation
Suppose you are the VP of Marketing at a huge retail store like walmart and want to know how to personalize ads and marketing campaigns for your customers then simply do association and correlation analysis on your dataset. On doing an association analysis, you would get rules like {diapers, baby food} -> {baby toys} which translates as someone buying diapers and baby good are more likely to buy baby toys. Now you know who all buy diapers and baby food together from the little "discount card" your customer uses. So you can target them for baby toys. cool rite :)

3. Basic Idea
The general format of an association rule is
buys(X,"laptop") => buys(X,"printer") [support = 10%, confidence = 70%]
where support of 10% means that 10% of all transactions show that laptop and printer have been bought together. Confidence of 70% means that the possibility that someone buying a laptop will also buy a printer is 70%.
So why do we need correlation analysis ? The reason is that not all rules generated are valid in the real-world. For example, from a univ database, we get the association rule as play basketball => eat cereal [40%, 66.7%] is misleading since the overall % of students eating cereal is 75% > 66.7%. Hence we need to use different correlation measure to augment the support-confidence framework for association rules.

4. Applications
1. Analyse Market basket data
2. Bioinformatics
3. Web Mining
4. Scientific data analysis

5. Important papers / Algorithms
I guess frequent pattern mining techniques are the underlying framework that would help generate association rules.

6. Math concepts used
1. Statistics
Statistical correlation measures like All-Confidence, Cosine measure, Jaccard coefficient will help in correlation Analysis

Sunday, March 15, 2009

DM Series - Frequent Pattern Mining

I am planning to follow the below pattern for each of the DM functionalities / techniques I had mentioned in the preamble post of this series.

1. What is it
2. Motivation
3. Basic Idea
4. Applications
5. Important papers / Algorithms
6. Math concepts widely used

1. What is Frequent Pattern Mining ?
Frequent Patterns are those patterns that occur frequently in data. Depending on the data set, there are 3 main types of frequent patterns.
a. Frequent itemset - set of items that occur frequently generally in a transaction database like milk and bread
b. Frequent sequential pattern - It is a subsequence that occurs frequently. Eg: People who buy computers tend to buy printers.
c. Frequent structured pattern - when structures like graphs, trees etc occur frequently they form a frequent structured pattern. Eg: DNA structure analysis
The techniques used to mine / find knowledge in frequent patterns are called frequent pattern mining

2. Motivation:
Some of the motivating thoughts that leads to the need for FP mining are
- What items are generally bought together
- What is generally bought after buying say a PC
- What DNA is sensitive to this new drug

3. Basic Idea:
For performing FP Mining, we need to find the frequent patterns. A k-itemset is frequent if it satisfies a minimum support(min_sup) threshold quantity ie if this k-itemset occurs more than the min_sup quantity then this itemset is a frequent item set. For eg, if min_sup is 1000 and we scan a walmart shopping database, then the itemset {bread,milk} would have occured more than 1000 and qualify as a frequent itemset.
The issue with identifying the frequent itemset is combinatorics. For example, if walmart as 10,000 products then imagine the number of combination of items that would be purchased

4. Applications:
1. It is the basis for many DM tasks like Association analysis, Classification, Clustering etc.
2. Market basket analysis
3. Web log analysis
4. DNA sequence Analysis

5. Important papers / Algorithms:
a. Apriori Algorithm
b. FP-Tree algorithm -> Mining Frequent Patterns without Candidate Generation by Jiawei Han, Jian Pei, Yiwen Yin.
On a personal note, FP-Tree is developed by Prof.Han who is my DM course professor. He is just too good and am proud to learn from him.

6. Math concepts widely used
Statistics, Probability and Combinatorics are pretty widely used.

Saturday, March 07, 2009

The Data Mining (DM) Series - Introduction

Since Data Mining is my primary specialization in masters, I am planning to blog a series on the basics of Data Mining.

What is data(Knowledge) mining (DM) ?
As I had mentioned earlier data mining actually refers to mining knowledge from large amounts of data. Example: You are an email service provider and want to filter out all spam mails. You can apply data mining to simply identify the pattern of spam mails and filter them out.

Why do we need data mining ?
To learn hidden knowledge that might be present in vast amounts of data. Example: If you own a big retail store and want to find the target customers for a specific product, just mine the buying patterns in your customer database to find out the list of potential buyers

When we talk about DM, we would most likely talk about the functionalities of data mining.They represent the methodology used to perform mining. They are
1. Frequent Pattern Mining, Associations and Correlations
2. Classification and Prediction
3. Cluster Analysis
4. Outlier Analysis
5. Stream Mining
6. Sequence, Trend and Evolution Analysis
7. Graph Mining
8. Information Network Analysis
9. Web Mining

I'll elaborate on each of the functionality in this series.

Applications of Data Mining:
There are several practical applications of data mining. The list would probably be too big. So let me just name a few with the DM technique it uses
1. Spam filtering - uses classification
2. Intrusion Detection System - uses Frequent Pattern Mining / Classification / Stream Mining
3. Fraud Detection - uses Outlier Analysis
4. Forecasting (weather / market etc) - uses Trend Analysis
5. Web search - Web Mining

Math background:
The math concepts that gets heavily used in data mining are
1. Statistics
2. Probability
3. Linear Algebra

Saturday, February 07, 2009

Math is truly elegant

Since 3 yrs, I have always been trying to keep in touch with some of the basic Math concepts. my interest in math grew after I started realizing itz proximity to computer science.
1. RDBMS uses relational Algebra which is based on set theory
2. AI / Machine Learning uses a whole lot of Probability and Linear Algebra
3. Computer Architectures uses Boolean Algebra
4. The Confidentiality goal of Security relies heavily on unsolvable Math problems.

Although Math forms the basics of several concepts and subjects in computer science, it is sometimes less exploited in the everyday life of a programmer.
One of the most important ideas that I am learning is to find a pattern of a math concept in every problem / natural event. For eg, most daisies have 34, 55 or 89 petals. Those numbers are fibonacci numbers. The more you see such patterns in normal regular events that happen around you, the more you appreciate math.
I was listening to discrete math lectures on ADU and the lecture on Combinations and Permutations was just too good. The explanation on how Combinations help find co-efficients in a polynomial eqn and thus leading to the name binomial coefficients is wonderful. Understanding how this concept of binomial co-efficients ties counting and algebra together was sweetly elegant. Adding to this was the relationship between pascals triangle and Binomial co-efficients. I guess once you unravel and look deep into these relationships, its just pure joy.

Tuesday, January 20, 2009

Top 25 Programming errors

A good list of top programming errors compiled by a group of professors, security researches, industry people et more. As always, the top issue is Improper Input Validation.

Thursday, December 25, 2008

Happy Christmas

Happy Christmas everyone.
I just thought of sharing what I learnt this Christmas season. The thought or message that really striked me this season is the idea of God planning to proclaim the news of the birth of Jesus to the shepherds. Imagine a prince being born in a royal family. Who would get the news first ? Probably the immediate royal family, maybe nobles and high-profile courtsmen. But when Jesus was born, God chose to share this news with the lowly shepherds. I mean who are these shepherds ? What are their strengths ? what degree do they have ? what office do they hold ? How influential are they in the society ? How impressive are they ? Are they cool people ? The answer to all these are Negative. Who gives a s*** about shepherds ? or put it other way, who gives a s*** about me ? God does. God surely does. He came for the meek and lowly sinner and not for the noble and esteemed people. How fortunate am I to know this savior who loves me just the way I am. I am baffled by the faithfulness of Jesus every single time. I have never stood a chance in many life situations and just by His Grace, He helps me sail through.
The song that touched me a lot this season is "O Holy Night"
O Holy Night! The stars are brightly shining,
It is the night of the dear Saviour's birth.
Long lay the world in sin and error pining.
Till He appeared and the Spirit felt its worth.
A thrill of hope the weary world rejoices,
For yonder breaks a new and glorious morn.
Fall on your knees! Oh, hear the angel voices!
O night divine, the night when Christ was born;
O night, O Holy Night , O night divine!
O night, O Holy Night , O night divine!

Led by the light of faith serenely beaming,
With glowing hearts by His cradle we stand.
O'er the world a star is sweetly gleaming,
Now come the wisemen from out of the Orient land.
The King of kings lay thus lowly manger;
In all our trials born to be our friends.
He knows our need, our weakness is no stranger,
Behold your King! Before him lowly bend!
Behold your King! Before him lowly bend!

Truly He taught us to love one another,
His law is love and His gospel is peace.

Chains he shall break, for the slave is our brother.
And in his name all oppression shall cease.
Sweet hymns of joy in grateful chorus raise we,
With all our hearts we praise His holy name.
Christ is the Lord! Then ever, ever praise we,
His power and glory ever more proclaim!
His power and glory ever more proclaim!


Saturday, December 06, 2008

Information overload

Just read this good post by Jeff Atwood on why email has become such a pain in this information age. I totally agree. I have been in situations at work where I would spend like over an hour reading all my mails and another hour or so to respond to them. It is crazy at times. I sometimes feel that email has led to an information overload. You have so many mails in your box and sieving through them all consumes precious time and doesnt really help much in making effective decisions. sometimes, you have to read through that mail to realize that it has been a waste of time. I m not referring to spammers spam to a "genuine spam". So how do we solve this problem ? I may be wrong but I look at it as a classification problem. From all the mails, the system should auto classify and show me what I really want for that day / moment. Sounds pretty challenging but I guess using proper ML techniques, we "might" be able to nail it.

Tuesday, December 02, 2008

Smart pen

I saw an ad about a smart pen the other day and I think the idea is really cool. Itz a pen with a built-in computer. You have a special dot paper notebook that you should use it with. The pen has a mic that records the class lecture and maps the notes you take to the lecture. For example, if you are listening to a lecture on Bayesian classifiers and you make notes when the prof talks about Bayes rule. Now at home, you want to know what the prof told about Bayes rule, just click on the relevant notes you took on Bayes rule and voila! the pen starts playing the lecture at the point where Bayes rule was explained. You can import your notes into your computer and even share it online with classmates. I tried to see if they have the facility to convert all the audio lecture into text but they dont seem to have :(. If they had, then my AMM would have become a reality. Oh yeah, they have an SDK for this pen. so there is a good possibility that AMM can become a reality :) I am very much tempted to buy this pen but he only pain part is the cost - $149 for pen with 1GB and $199 for a 2GB model.

Tuesday, November 18, 2008

Voice powered Google search in iPhone

Google has just released a new version of its app in iPhone with voice capabilities. You can open the app, lift the phone to your ear and talk to search. This is a really cool feature and is something that integrates voice to search to vision (as results are displayed in the screen). This should hopefully kick start the generation of voice based apps .
I just upgraded to this new version of Google mobile app and it was good. It is not perfect, atleast the app didnt really recognize my accent correctly. But the idea of integrating voice with search is very impressive and hopefully the app should learn my accent and voice soon.

Friday, November 14, 2008

Learn from the Best

I play ping pong quite a bit and I started to play better after I watched some of the games of the best player at work. I kind of learnt some of the game strategies by observing his game. I applied those in my game and it worked pretty good. So that brought me to my utopian land again. How about having a machine learning algorithm that learns from the "best player" data set instead of a huge training data set. That would be just great - Learn the best strategies and moves from the best player. For eg, We try to get into the best schools so that we can learn from the best professors, rite. Why not adopt this idea to machine learning ? I searched a little bit but couldnt really find a place where this idea is being used. Now the problem is, "How to know whatz the 'best player' data" ? well, I thought of having some ranking algorithm that would point us to the "best player" data. Now how will this ranking algo operate or work ?? hm.. thatz a black box for me now.. still need to dig deep and see how to construct it, i guess. If you have any thots, plz ping :)

Wednesday, November 05, 2008

Automated Minutes of Meeting

I hate documenting stuff.
So I was wondering if there is someway of automating the process of writing Minutes of Meeting(MOM). I guess an AMM (Automated Minutes of Meeting)would do the trick. AMM exists in my utopian world and hypothetically will work like this..
1. Voice record the meeting
2. Use a speech recognition system to convert the speech to text
3. Use a learning algorithm to automatically classify the text and give you the Minutes of the Meeting.
wow. 3 steps and I will be able to enjoy meetings :)
So trying to hunt down if there is an integrated system that would help me out, it was disappointing to see that there is currently no good speech to text translation programs available. The ones available give varying accuracy depending on several parameters like background noise, too many voices etc etc. So step 2 is not currently promising and would need some work
Now for step 3, there are quite a few text classification algorithms and models that can be used. I would be interested in using a Bayesian classifier (my fall project involves writing a survey paper on Bayesian classifier)
Oh yeah, AMM not only helps me but journalists, students and many more..

Tuesday, October 28, 2008

Faithfulness in little things

So far as I know, there have been 3 good / great inventions transpired through class assignments / papers.
1. Huffman coding - One of the most widely used loseless encoding algorithm.
2. Star Cubing - This is a data cube computation algorithm developed by a student of our Datamining professor, Prof. Jiawei Han. During one of the lectures, the student got this idea of Star cubing.
3. Decision Tree Induction - In the field of supervised machine learning and specifically in Classification, the decision tree algorithm seems to be one of the most widely adopted algos. This was developed by Robert Quinlan during one of his class assignments.
What I really learn from all these is that when we are faithful in the small things that God wants us to do, large rewards are in store for us. So even if it is a class assignment or term paper or class project, if we put our heart to it faithfully, we can hear "Well done, good and faithful servant! You have been faithful with a few things; I will put you in charge of many things. Come and share your master's happiness!"

Netbooks

The concept of netbooks seems pretty good. A lot of people I know of use their computers for mailing, photos and browsing. Netbooks are the best bet for them. It is cheap (like $350 or so) and is handy and light. Though their specs are not great, they surely serve the purpose of keeping you connected. I think it would be a good option for those planning to buy a system for their parents. News is that Linux is going to dominate the netbooks market. Time will tell i guess

Tuesday, October 07, 2008

Voice based apps

Yesterday, I was discussing with one of my closest amis, Prasath about voice based apps. This is the idea. Mobile devices are the next gen computing platforms. The big issue that I see is "people cant see" ie the screen size is small that people really dont like to use it like a computer. So herez the great idea - change all viewable apps to voice based apps. Change the interface from seeing to speaking. The reason that 3 billion humans carry a cell phone is to talk. so why not develop apps tat literally talk to you and interact with you ? One of the big problem in that is voice recognition sometimes is not very user friendly. Also very specifically we were thinking that sometimes voice interface might not be all that great. For eg, say you call to a voice based Google (Voogle) and search for something, it would be annoying if Voogle talks back all the top ten results. we wud feel more comfortable viewing the top ten results and choose wat to do. So we thot that probably voice shud blend with vision and create a new interface or something. so with that we kind of concluded and moved on. Later in the eve, I saw a blogpost at Google about "Google Tech roundtable". Looked interesting and so listened to this talk on Human Language tech and people talked more or less about this idea that i mentioned above. Interesting huh ? There are quite a few challenges to it and would be a gud area to do a research i guess.

OWASP AppSec NY 2008

During the last week of September, I attended the OWASP AppSec NY 2008 conference @ NYC. It was for 2 days and had several sessions running in parallel. Some of those that impressed me were

1. WAF - Web Application Firewall. This is like a hardware appliance that you plug in front of your web server. It intercepts all traffic to your webservers and analyzes for attack patterns (for eg : check for a 'and 1 = 1' pattern to narrow on a SQL injection attack). Security is not a layer / tier in your application stack / model but should be inherent in every part of it. So I was quite skeptical if this WAF is just a hype or myth or some marketing.. but I guess you can use WAF when things look really bad. For eg, if you are aware that your web app is under attack and dont have time to analyze and fix it, just plug in a WAF. Also I am planning to work on a survey paper on IDS for this sem. so I am kind of looking at analyzing how IDS in WAF works and their pros and cons.

2. Clickjacking - Although security researchers Jeremiah Grossman and Robert Hansen decided not to "zero-day" on this, they had a great presentation on some of the most common and interesting attacks that happen due to business logic flaws and coding flaws.

3. ESAPI - This is the Enterprise Security API. It is build on top of the various security functionality libraries like javax.crypto, JAAS etc. It looks really neat and makes sense. It is pioneered by Jeff Williams who is the chair of OWASP. I was really impressed with his simplicity

4. Security issues while Offshoring - This was presented by Rohyt Belani and he gave a great case study. I thoroughly enjoyed his theme that Offshore ITES companies should sell security as their differentiator.

All the presentations are made online. You can watch them here . Enjoy

Saturday, September 20, 2008

Vision 2019

Google is posting a series in itz blog about the visions for 2019 shared by many of its experts. Quite interesting stuff. Something I liked about Marissa Mayer's vision is that of a search-powered device that would have a microphone on it. It would listen to conversations and search for relevant facts in the background. say you go fishing and talk about a specific kind of fish or something, the complete facts about this fish is ready for you. The recent post is by Andy Rubin on the future of mobile. he talks about a scenario where you drive past a shop and look at a puppy, the compass and GPS would determine what you are looking at and get details about the price of the puppy and the food that needs to be bought for it etc. This looks like stripped down version of Jini technology which pushed for an impromptu community, where every device talks to every other device and gets their job done. For eg, a washing machine in the Jini community would scan your shirt tag and talk to the manufacturer to download instructions for washing it.

Thursday, September 18, 2008

Free CS course from Stanford

This is amazing. Stanford has made basic CS and Robotic courses online for free. Sometime ago I was just browsing on the fee structure @ Stanford and saw that it was like $5500 for 4 credits. Giving it away for free is a great move :). I am sure many people around the world will get benefited from this. Oh also, I recently read about many Prof's coming together against the book publishers who charge a lot for school text books. So that kicked off a project called connexions where Prof's and other industry experienced people share their knowledge and notes and references on subjects. Glanced through it and it looks good.

Tuesday, September 09, 2008

Drupal CMS

I got involved in a project for building a web application to do some data management and was looking at a framework for it. Having heard about drupal at several places, I thot of trying it out. It was really good and simple. Installation didnt take much time on Linux or Mac. You just need the base framework of Apache, PHP and mysql. After downloading the drupal project files, copy them to Apache root directory and access drupal from Apache. Now when you access for the first time, you'll be guided through a web-based installation process which is like 4 steps or so.
I was amazed at the modules and themes that have been written for drupal. There are atleast 1000 modules (modules are nothing but small applns or components) and themes. A forum, blog, polling application and many more modules comes in by default. so if you want to a forum on your drupal based site, you just have to enable it.
IBM developerworks has some good articles on writing custom modules for drupal. I havent played much with it but at a glance from this article, it looks a bit overwhelming. I guess once we get a hang of the jargons and concepts, it might look simple. But overall, it was good to know abt a CMS which provides built-in support for many common functionalities of a web application (like login, menus, blog etc..)

Tuesday, September 02, 2008

Google Chrome - Start of World (Browser) War II

I never expected this move from Google. Since they were funding Firefox and it was all good, it was not obvious to me. Anywayz, Google elaborates on why they have developed a new browser. They claim that we use browsers to work on applications than browse through mere webpages, which is true in a sense. Chrome is to support these next generation web applications which will push us more towards the cloud.

I am currently writing this post from chrome on my XP VM. It looks simple and I really like the memory statistics they provide for each tab (processes). If one of your tabs is hogging your system memory, you can kill that tab and save the rest. This is kind of neat. They seem to have taken a multi-process approach than the existing multi-threaded approach. I was reading the Google chrome comic that throws light on the thoughts behind chrome and I somehow felt that this browser has been thought out like integrating an OS to the browser. For example this feature of killing a specific tab seems new to me. They have used webkit rendering engine which Apple uses in Safari and yeah by Google's Android too.

I havent fully explored Chrome but I think for Chrome to move forward strongly, they should bring in some solid security features. I havent seen any highlight on security features of Chrome. If they could innovate some good web security in terms of phishing, malwares etc, that would make a good mark. Fortunately or unfortunately, they dont have a mac / linux version yet, so I'll be staying with Firefox and probably use it as a secondary browser once the mac version is released.