# Functional Programming - Reduce - Reduction Operation (fold)

A (reduction|reduce) operation (also called a fold) is a functional programming function.

Reduction operations are terminal operations.

They takes a sequence of input elements and returns:

• a single summary result
• a collection
• or a map

Example:

• finding the sum or maximum of a set of numbers,
• finding the average of values
• grouping elements into categories
• accumulating elements into a list (collections) - group by, partitioningBy
• summarizing elements according to various criteria
• etc..

## Property

### Batch

A reduction operates on the stream as a whole rather than on individual elements. See Data Processing - Batch

### Parallel

A properly constructed reduce operation is inherently parallelizable. See Parallel Programming - (Function|Operation)

## Documentation / Reference

Discover More
Code - Functional programming (FP) - Collection Operations

Functional programming (FP) defines standard operations on collections. It is a declarative paradigm that treats computation as the evaluation of mathematical functions. Most of the operations, you perform...
Function - (Aggregate | Aggregation)

Aggregate functions return a single value calculated or selected from values that are in a aggregation relationship (ie a set) This values are also known as summary because they try to summarize...
Functional Programming - Group by

grouping by is a function that group elements with the same attribute in a apart collection. The output of a group by operations is normally a map where: the key is the elements to group by and the...
Functional Programming - Reduce - Reduction Operation (fold)

A (reduction|reduce) operation (also called a fold) is a functional programming function. Reduction operations are terminal operations. They takes a sequence of input elements and returns: a single...
Functional Programming - Terminal Operations

Terminal operations return one value by combining the contents of a stream. Type Example reduction operation average, sum, min, max, and count Collect collect the stream in a collection
Java - Stream Processing

Map objects to another value as specified by a Function object Perform an action as specified by a Consumer object void forEach(Consumer action) filter, map, forEach lambda expressionsiterators...
MapReduce - Reducer

Python - Reduce Function

The implementation in Python. Reduce operates on pairs of elements in a series. It applies a function that takes in two values and returns a single value. Using this function, reduce is able to, iteratively,...
Spark - (Reduce|Aggregate) function

Spark permits to reduce a data set through: a reduce function or The reduce function of the map reduce framework Reduce is a spark action that aggregates a data set (RDD) element using a function....
Statistics - (Data|Data Set) (Summary|Description) - Descriptive Statistics

Summary are a single value summarizing a array of data. They are: selected or calculated through reduction operations. They are an important element of descriptive analysis One of the most important...