Featured Post

Python map() and lambda() Use Cases and Examples

Image
 In Python, map() and lambda functions are often used together for functional programming. Here are some examples to illustrate how they work. Python map and lambda top use cases 1. Using map() with lambda The map() function applies a given function to all items in an iterable (like a list) and returns a map object (which can be converted to a list). Example: Doubling Numbers numbers = [ 1 , 2 , 3 , 4 , 5 ] doubled = list ( map ( lambda x: x * 2 , numbers)) print (doubled) # Output: [2, 4, 6, 8, 10] 2. Using map() to Convert Data Types Example: Converting Strings to Integers string_numbers = [ "1" , "2" , "3" , "4" , "5" ] integers = list ( map ( lambda x: int (x), string_numbers)) print (integers) # Output: [1, 2, 3, 4, 5] 3. Using map() with Multiple Iterables You can also use map() with more than one iterable. The lambda function can take multiple arguments. Example: Adding Two Lists Element-wise list1 = [ 1 , 2 , 3 ]

Advanced Oozie for Software developers (Part 1 of 3)

Introduction to Oozie Places or points of interest in specific locations that may be important to some people. Those locations are additionally associated with data that explains what is interesting or important about them.

How People Gather Data?

These are typically locations where people come for entertainment, interaction, services, education, and other types of social activities. Examples of places include restaurants, museums, theaters, stadiums, hotels, landmarks, and so on. Many companies gather data about places and use this data in their applications.

In the telecommunications industry, probes are small packages of information sent from mobile devices. The majority of "smartphones" send probes regularly when the device is active and is running a geographical application (such as maps, navigation, traffic reports, and so on).

The probe frequency varies for different providers (from 5 seconds to 30 seconds).

Probes are normally directed to phone carriers such as Verizon, Sprint, ATandT, and/or phone manufacturers such as Apple, Nokia, HTC, and so on.

Different steps in validating the location of customers

  1. Select probes data for a specified time interval, as well as a location from the probes repository.
  2. Extract probes strands. The idea here is to discover groups of probes from a particular device that belong to an individual who spent some time in one location. More precisely, a usual technique here includes classifying probes strands (such as pedestrians or traffic) and extracting "stay points" from pedestrian strands. 
  3. Distribute the strands into geotiles. In practice, it is convenient to use several geotile systems in parallel with different tile sizes (geohash levels).
  4. Geotiling is the partitioning of a space into a finite number of distinct shapes. This implementation uses equal-sized bounding boxes. A zoom level defines the size of the tiles. Typically, for the zoom level n, the number of tiles for the world is 2n.
  5. Distribute the places into geotiles.
  6. Calculate a location attendance index. The location attendance index captures the number of strands located in the proximity of a location, usually associated with a group of places. That enables you to estimate how many people attend places, how long people remain in places and the distribution of these parameters over time.
  7. Cluster stay points by geographical locations, and use clusters not associated with the currently known places for the discovery of new place candidates.

What is the role of Oozie?

Oozie does not require special programming for any of the Oozie actions. For example, any existing Pig script or any HQL script can be used as-is inside of Oozie's actions.

Comments

Popular posts from this blog

How to Fix datetime Import Error in Python Quickly

SQL Query: 3 Methods for Calculating Cumulative SUM

Python placeholder '_' Perfect Way to Use it