Posts

Showing posts from June, 2014

Moving Hadoop Namenode out of safemode.

Hi There, people has been asking me to put some light on safemode of Hadoop. So lets see what is it. Many time when you start Hadoop, it gets stuck in Safemode. Now what exactly is this safemode? when Hadoop starts, Normally it puts itself in Safemode. In this mode, you cannot write any new data to hadoop. it is a read only mode. Hadoop says untill  i am going to get heartbeat from some fix number of datanodes, i will keep myself in Safemode. I have seen this happening even when you are in Pseudo distributed mode. So if your Hadoop is in safemode. you will not be able to write any new data or create any folder on Hadoop. So you have to bring Hadoop out of safemode. Following is the command for bringing hadoop out of safemode.       hadoop dfsadmin -safemode leave After this, you will be able to use Hadoop as normal. Enjoy, Keep Coding, keep facing issues, keep learning :)

Machine Learning : Naive Bayes Part 1

My Major area of  work is Text Analytic and Machine Learning. I always get excited to solve the problems in this area. So i thought i will share some of my knowledge on this also :). We will start with Naive Bayes algorithm. It is a supervised learning, classification algorithm. Supervised learning means, before running on actual data, we have to train this algorithm with some training set and explain it that which records are acceptable and which records are not acceptable. Eg. before trying my NB(Naive Bayes algo) on test data, I will  show some  examples to algo, that these how does a spam message look and how does a non-spam message look. once it is ready we can go ahead with trying it on real world data. Before Trying NB, we need to know some basics about Probability . Lets go through that. Lets assume. we have a dice. A dice have six faces, each face marks a distinct number between 1 to six. If the dice is not biased, what is the probability that we will get a