Back to Glossary Index

Dagster Data Engineering Glossary:


Data Reduction

Convert a large set of data into a smaller, more manageable form without significant loss of information.

Data reduction definition:

Data Reduction in data engineering refers to the process of transforming, encoding, or otherwise converting a large set of data into a smaller, more manageable form without significant loss of information. This is usually done to increase efficiency, reduce data storage requirements, and improve the speed of subsequent data processing tasks.

Methods for data reduction can include dimensionality reduction techniques, data compression, data sampling, binning, feature selection, feature extraction, and aggregation, among others. The aim is to maintain the data's integrity and usefulness while making it more manageable.

Data reduction is especially crucial in big data applications, where the sheer volume of data can become a hindrance to data processing and analysis. By intelligently reducing data size, we can optimize storage, improve performance, and make the data more understandable.

Data reduction example in Python:

Please note that you need to have the necessary Python libraries installed in your Python environment to run this code.

Let's look at a simple data reduction method by applying a PCA (Principal Component Analysis) technique to a sample dataset. In a modern data pipeline, we often need to reduce the dimension of data, especially for high-dimensional data, to save storage and computational power.

We'll be using the famous Iris dataset from sklearn for the demonstration. This data set has four features, and we'll reduce it to two features using PCA.

Here's an example:

from sklearn.decomposition import PCA
from sklearn.datasets import load_iris
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

## Load the iris dataset
iris = load_iris()
X = iris.data
y = iris.target

## Original dataset dimensions
print(f"Original dataset shape: {X.shape}")

## Create the PCA object, specifying the number of components (or dimensions) to reduce to
pca = PCA(n_components=2)

## Fit and apply the PCA to the data (this is done in one step)
X_pca = pca.fit_transform(X)

## Reduced dataset dimensions
print(f"Reduced dataset shape: {X_pca.shape}")

## Convert numpy array to pandas dataframe
df = pd.DataFrame(data = X_pca, columns = ['Principal Component 1', 'Principal Component 2'])
df['target'] = y

## Visualize 2D Projection
plt.figure(figsize=(8,6))
sns.scatterplot(x='Principal Component 1', y='Principal Component 2', hue='target', data=df, palette='Set1')
plt.show()

In this script, we load the iris data set, which has 4 features. Then, we use PCA to reduce it to two features. We then plot these two features as a scatter plot to visualize the reduced data, which produces a graph as follows:

It will print out to the terminal:

Original dataset shape: (150, 4)
Reduced dataset shape: (150, 2)

This script demonstrates a fundamental data reduction technique that is commonly used in modern data pipelines, particularly when dealing with high-dimensional data.

Data reduction vs. data compaction vs. data compression

While related, reduction, compaction, and compression are slightly different techniques:

ReductionCompaction Compression
AimReduce the overall amount of data while retaining its critical information.Minimize storage space while preserving data contents and structure.Reduce data size by encoding it in a more space-efficient format, minimizing transfer or storage.
TechniquesAggregation, downsampling, encoding, filtering out less relevant data points, dimensionality reduction for feature selection.Data compression, merging smaller data segments into larger ones, and optimizing data structures like indexes to reduce fragmentation.Encoding data in a compressed forms to represent data in fewer bits.
Key benefitsImprove data manageability, simplify analytics, and speed up query performance.Improve storage efficiency and reduce costs.Reduce data transfer times, saving storage space, and improving data transmission efficiency.

Reduction, compression, and compaction are complimentary and often used together to achieve our data engineering objectives.


Other data engineering terms related to
Data Transformation:
Dagster Glossary code icon

Align

Aligning data can mean one of three things: aligning datasets, meeting business rules, or arranging data elements in memory.
An image representing the data engineering concept of 'Align'
Dagster Glossary code icon

Clean or Cleanse

Remove invalid or inconsistent data values, such as empty fields or outliers.
An image representing the data engineering concept of 'Clean or Cleanse'
Dagster Glossary code icon

Cluster

Group data points based on similarities or patterns to facilitate analysis and modeling.
An image representing the data engineering concept of 'Cluster'
Dagster Glossary code icon

Curate

Select, organize, and annotate data to make it more useful for analysis and modeling.
An image representing the data engineering concept of 'Curate'
Dagster Glossary code icon

Denoise

Remove noise or artifacts from data to improve its accuracy and quality.
An image representing the data engineering concept of 'Denoise'
Dagster Glossary code icon

Denormalize

Optimize data for faster read access by reducing the number of joins needed to retrieve related data.
An image representing the data engineering concept of 'Denormalize'
Dagster Glossary code icon

Derive

Extracting, transforming, and generating new data from existing datasets.
An image representing the data engineering concept of 'Derive'
Dagster Glossary code icon

Discretize

Transform continuous data into discrete categories or bins to simplify analysis.
An image representing the data engineering concept of 'Discretize'
Dagster Glossary code icon

ETL

Extract, transform, and load data between different systems.
An image representing the data engineering concept of 'ETL'
Dagster Glossary code icon

Encode

Convert categorical variables into numerical representations for ML algorithms.
An image representing the data engineering concept of 'Encode'
Dagster Glossary code icon

Filter

Extract a subset of data based on specific criteria or conditions.
An image representing the data engineering concept of 'Filter'
Dagster Glossary code icon

Fragment

Break data down into smaller chunks for storage and management purposes.
An image representing the data engineering concept of 'Fragment'
Dagster Glossary code icon

Homogenize

Make data uniform, consistent, and comparable.
An image representing the data engineering concept of 'Homogenize'
Dagster Glossary code icon

Impute

Fill in missing data values with estimated or imputed values to facilitate analysis.
An image representing the data engineering concept of 'Impute'
Dagster Glossary code icon

Linearize

Transforming the relationship between variables to make datasets approximately linear.
An image representing the data engineering concept of 'Linearize'

Munge

See 'wrangle'.
An image representing the data engineering concept of 'Munge'
Dagster Glossary code icon

Normalize

Standardize data values to facilitate comparison and analysis. Organize data into a consistent format.
Dagster Glossary code icon

Reshape

Change the structure of data to better fit specific analysis or modeling requirements.
An image representing the data engineering concept of 'Reshape'
Dagster Glossary code icon

Serialize

Convert data into a linear format for efficient storage and processing.
An image representing the data engineering concept of 'Serialize'
Dagster Glossary code icon

Shred

Break down large datasets into smaller, more manageable pieces for easier processing and analysis.
Dagster Glossary code icon

Skew

An imbalance in the distribution or representation of data.
Dagster Glossary code icon

Split

Divide a dataset into training, validation, and testing sets for machine learning model training.
Dagster Glossary code icon

Standardize

Transform data to a common unit or format to facilitate comparison and analysis.
Dagster Glossary code icon

Tokenize

Convert data into tokens or smaller units to simplify analysis or processing.
An image representing the data engineering concept of 'Tokenize'

Transform

Convert data from one format or structure to another.
An image representing the data engineering concept of 'Transform'
Dagster Glossary code icon

Wrangle

Convert unstructured data into a structured format.
An image representing the data engineering concept of 'Wrangle'