MAP REDUCE ALGORITHM(Big Data)

What does map reduce algorithm mean ..??

  • As far as we know for the big data, we deal with the enormous data..!
  • What we need is the high efficiency and Scalability  in Data.
Let us take a simple example and use map reduce to solve a problem.

Say you are talking about the persons which are foody , But you have enormous Data which relates to many Items which are on going such as technical talks , talks about clothing ,or any other issue out of it you have to gather the data Which only relates to foody persons .


So our first thing is to identify the keyword lets take food .! food is the word which we are going to map from the data to conclude that its something related to foody people.

Next, we will write a mapping function to identify such patterns in our data. such as spicy ,sweet,sour ,vegetarian, non vegetarian  etc.

Let us take the following chunks in a big data set and see how to process it.

"Kishan loves to eat the food of South".
"hey Ravi Dont waste your Food..!!".
"There are the people who like spicy food and the one who cant bear it..!!
"There are two types of people one who are vegetarian and the other are non vegetarian."


Mapping Phase
So our map phase of our algorithm will be as follows:
1. Declare a function “Map”
2. Loop: For each words equal to “food(ignore of cases)”
3. Increment counter
4. Return key value “food”=>counter
In the same way, we can define n number of mapping functions for mapping various words words: “Spicy”, “Sour”, “vegetarian”, etc.

Reducing Phase

The reducing function will accept the input from all these mappers in form of key value pair and then processing it. So, input to the reduce function will look like the following:
  • reduce(“food”=>2)
  • reduce(“Vegetarian”=>3)
  • Our algorithm will continue with the following steps:
  • Declare a function reduce to accept the values from map function.
  • Where for each key-value pair, add value to counter.
  • Return “food”=> counter.

Comments

Popular posts from this blog

State space search / blocks world problem by heuristic approach /TIC TAC TOE

Navigation in Vaadin.

Drag and drop items from one Grid to another