IMEN891K / IDSC501 / AXGS-501 · Data Engineering · Fall 2026
Review Session
Sangwoo Mo · POSTECH Industrial & Management Engineering
Outline: Review Session
01
Collection and Exploration
Lec 2–3 · records, labels and patterns
02
Data Preparation
Lec 4–5 · changes to values and representation
03
SQL
Lec 6–8 · read, match and summarize rows
04
NoSQL
Lec 9–10 · models, documents and updates
01 · Collection and Exploration
01
Collection and Exploration
Lec 2–3 · records, labels and patterns
02
Data Preparation
Lec 4–5 · changes to values and representation
03
SQL
Lec 6–8 · read, match and summarize rows
04
NoSQL
Lec 9–10 · models, documents and updates
Outline: Data Collection
Online and Offline Data
Locate the observation source before choosing the collection method
API or CrawlerPrefer an explicit interface; page extraction also depends on the page layout
An explicit interface can be checked; page extraction also depends on layout
Sensors as Encoders
Measurement turns a physical event into a recorded observation
Record Meaning and Context
A value becomes usable when its meaning and context are recorded
Generating Training Examples
Generated inputs and candidate labels still require validation
Sources of LabelsA label can come from deliberate annotation or from an observed outcome
Source
Example
Main collection problem
Human annotation
An inspector judges a part
Make the guideline reproducible
Natural label
A delivered shipment has an arrival time
Record and link the outcome
Model-generated labels remain candidates until checked
Both sources need a definition and a quality check
Checking Label Quality
A label needs a clear definition, reproducible judgment and independent checks
Missing OutcomesKeep pending, unobserved and negative outcomes distinct
Not inspected is different from an observed pass
Selected OutcomesThe inspection policy controls which outcomes become labels
100 produced parts
20 selected for inspection Labels will be observed
→
80 shipped without inspection
Outcomes unknown They are not recorded as pass
→
Random audit of 5
25 labels in total 75 outcomes remain unobserved
Audit outside the model-selected sample to observe what it missed
Collection Boundaries
Collect only what the purpose needs, with permission and protection
Outline: Data Exploration
Recap: Mean, Median, ModeThree answers to “the typical value”
From 9, 3, 1, 8, 3, 6: mean 5, median 4.5, mode 3
Extreme Values and the Median
An extreme value pulls the mean; the median is less sensitive
Variability and Robust Summaries
Report spread as well as center, and inspect the tails
Histogram as Empirical DistributionBins summarize how many observations fall in each interval
Bin counts show distribution shape while hiding within-bin detail
Clustering with k-meansIt always returns groups: the same points after asking k-means for three
Choosing k asks for that many clusters; it does not establish the true group count
PCA and t-SNE
A projection is a view of the data, with method-specific limits
Time Series Views
Preserve time order and check whether the process changes
Anscombe’s QuartetSimilar summary statistics, different scatter plots
The same summaries can hide different relationships
Pearson and Spearman Correlation
Choose a relationship summary, then check the scatter plot
Causal GraphsThe same correlation can reflect either causal direction or a shared cause
Three structures give one correlation; the correlation alone cannot tell them apart
02 · Data Preparation
01
Collection and Exploration
Lec 2–3 · records, labels and patterns
02
Data Preparation
Lec 4–5 · changes to values and representation
03
SQL
Lec 6–8 · read, match and summarize rows
04
NoSQL
Lec 9–10 · models, documents and updates
Outline: Four Stages of Preprocessing
Data Imputation
Imputation estimates a missing value using observed data.
An imputed value is an estimate, not a new observation
Observed and Filled ValuesUse other observed columns to find comparable rows
Observed measurements
part
helper
target
P1
10
20
P2
12
24
P3
11
NULL
Estimate for P3
Neighbors in helper: P1 and P2 (20 + 24) / 2 = 22
Stored with provenance
part
target
estimated
P3
22
Yes
The filled number is an estimate; keep its origin distinguishable
Caveat: Mean ImputationEvery hole gets the same value, and the spread of the column collapses
Mean stays 2.08; standard deviation falls to 1.76 and a spike appears
Caveat: Why is it missing?
Below, no young IQ was ever observed. No imputer fixes this. The question is not which method to use but why those rows are missing, and that answer lives in how the data was collected
Noise vs OutliersSmooth measurement noise; investigate outliers before changing them
Smoothing changes values; removal drops rows
Moving Averages for StreamsSimple (SMA) and exponential (EMA) moving averages use only current and past samples
Both use past samples; here EMA crosses four samples before SMA
Consistency Checks
A failed check identifies a problem, not its correct replacement
One Customer, Three Systems
Different source IDs and spellings do not establish a shared identity
Three Questions of Integration
Matching columns and matching entities solve different problems
Resolving Conflicting Values
Entity matching and value reconciliation are separate decisions
Recap: Four Stages of Preprocessing
Why Scale at AllDistance-based models add up raw units, so the widest column decides
In raw Euclidean distance, the rpm difference dominates the cycle-time difference
Choosing a Numeric Transformation
Choose a transformation for the comparison the model needs
Encoding, Embeddings and Binning
Encoding changes representation; binning also loses within-bin detail
Nominal and Ordinal CategoriesA numeric code can introduce order and spacing into the model
Nominal: no known order
Color
Arbitrary code
red
1
green
2
blue
3
Ordinal: a known order
Size
Ordered code
small
1
medium
2
large
3
Color codes invent an order; size codes express an existing order
One-Hot Encoding
One-hot represents membership; an ordinal encoding must preserve the intended order
Constructing Features
A useful feature represents information available when the decision is made
Extraction or SelectionKeep some original columns, or mix all of them into new ones
Selection keeps original columns; extraction creates new combinations
Sampling vs Curation
Both select rows; their criteria and resulting biases can differ
Sampling DesignThe selection rule determines which parts of the population survive
Method
How rows are chosen
Failure to check
Simple random
Draw rows at random
Small groups may be missed
Systematic
Every kth record
A periodic list can align with k
Stratified
Randomly sample at least one per group
Keep the intended group proportions
Cluster
Select whole groups
One factory may not represent the rest
Check the population structure before choosing the sampling rule
Lossless or Lossy
A smaller file is useful only if the retained information still serves the task
The Evaluation Must Match DeploymentDefine what will be new at prediction time before splitting the records
Deployment question
Useful split
What a random row split can hide
Predict future events
Earlier train; later test
Future information reaches training
Predict new machines
Hold out whole machines
Same-machine patterns occur on both sides
Predict new customers
Hold out whole customers
Repeated identity makes the test easier
A held-out row can still share an entity or future information with training
Fitting Preprocessing Steps
Fit on training data, then apply the learned transformation consistently
03 · SQL
01
Collection and Exploration
Lec 2–3 · records, labels and patterns
02
Data Preparation
Lec 4–5 · changes to values and representation
03
SQL
Lec 6–8 · read, match and summarize rows
04
NoSQL
Lec 9–10 · models, documents and updates
Outline: SQL I
01
Read a Table
find rows and choose columns
02
Refine a Result
remove repeats, sort and keep top rows
03
Handle Missing Values
choose how absent prices affect the result
04
Write Safely
keep constraints and related changes together
Schema and RowsA schema defines the columns; rows supply their values
Schema: the definition
Product
pname TEXT, primary key
price REAL
category TEXT
manufacturer TEXT
Rows: the stored values
pname
price
category
Gizmo
19.99
Gadgets
PowerGizmo
29.99
Gadgets
SingleTouch
149.99
Photography
MultiTouch
203.99
Household
One definition, many product rows
Keys and References
cname
stockprice
country
GizmoWorks
25.0
USA
Canon
65.0
Japan
Hitachi
15.0
Japan
pname
manufacturer
Gizmo
GizmoWorks
PowerGizmo
GizmoWorks
SingleTouch
Canon
MultiTouch
Hitachi
A primary key identifies a row; a foreign key requires an existing referenced key
Company facts are stored once; product rows refer to them by key
SELECT, FROM and WHEREThe question names one input table, a row condition and output columns
FROM
Read Product
→
WHERE
Keep Gadgets
→
SELECT
Show name and price
SELECT pname, price
FROM Product
WHERE category = 'Gadgets';
Read the table, keep matching rows, then choose columns
Refining a Query Result
Rows, distinct values and a ranked list answer different questions
Missing Values in a Table
Missing is a state of knowledge, not an ordinary numeric value
Safe Changes to Related Facts
Preserve constraints and change related facts as one unit
Outline: SQL II
01
Match Rows
return one row per matching pair
02
Keep Unmatched Rows
keep the left row when no match exists
03
Test for Matches
keep each outer row if a match exists
04
Stack Results
append compatible result rows
Matching a Product to Its CompanyThe shared company name lets one result contain product and country
Product
pname
manufacturer
Gizmo
GizmoWorks
→
Match the keys
manufacturer = cname
→
Company
cname
country
GizmoWorks
USA
Gizmo and USA meet through the same company key
JOIN on Related Keys
SELECT P.pname,P.price,C.country
FROM Product P JOIN Company C
ON P.manufacturer=C.cname;
↑ match a product to its maker
pname
price
country
Gizmo
19.99
USA
PowerGizmo
29.99
USA
SingleTouch
149.99
Japan
MultiTouch
203.99
Japan
Each product matches its company; the result has four product rows
Pairs, Required Records and Match Existence
Choose the output entity before deciding how records are combined
Matching and Stacking Results
Matching connects related facts; stacking combines compatible lists
Outline: SQL III
01
Calculate Measures
calculate a quantity from detail rows
02
Summarize Groups
choose the key and keep one row per group
03
Reuse Summaries
use a computed result as another input
04
Keep Detail Rows
add group context without merging rows
Aggregate Functions
Function
Question
COUNT(*)
How many purchase rows?
SUM(quantity)
How many units?
SUM(price*quantity)
How much revenue?
AVG(price)
What is the average recorded unit price?
MIN(price), MAX(price)
What are the smallest and largest prices?
Choose the expression that measures the quantity named in the question
Quantities and Weights
The denominator defines which units receive equal weight
Analytical Result Shapes
Detail input
product
price
bagel
1.0
bagel
1.5
banana
0.5
banana
1.0
GROUP BY
product
mean
bagel
1.25
banana
0.75
Grouping turns detail records into one summary row per group
Grouping and Average
One row per product group
SELECT product, AVG(price) AS mean
FROM Purchase
GROUP BY product;
Result
product
mean
bagel
1.25
banana
0.75
The grouping key defines each result row; AVG defines its measure
A Query Produces a Table
A query returns a table that another query can use as input
Detail, Summary and Group Context
Group information can summarize rows or accompany the original detail rows
04 · NoSQL
01
Collection and Exploration
Lec 2–3 · records, labels and patterns
02
Data Preparation
Lec 4–5 · changes to values and representation
03
SQL
Lec 6–8 · read, match and summarize rows
04
NoSQL
Lec 9–10 · models, documents and updates
Outline: NoSQL I
01
Four Families of NoSQL
choose a model by its access pattern
02
JSON and Semi-Structured Data
read named fields and ordered arrays
03
Between Trees and Tables
convert nesting and repeated values
04
Why NoSQL
check flexibility, scale and guarantees
Four NoSQL FamiliesThe four NoSQL families
NoSQL is not one thing: four alternative storage models
Key-Value Records
Request
get("user:1")
→
Stored pair
key: "user:1"
value: {
name: "John",
age: 28
}
→
Answer
{ name: "John", age: 28 }
A key retrieves its associated value
Sparse Cells Under a Row KeyIn a Bigtable-style model, rows can hold different column qualifiers
user:1
Family: activity
Value
page:home
09:01
page:product
09:03
purchase:1
Laptop
user:2
Family: activity
Value
page:home
09:02
purchase:2
TV
Same column family, different populated cells
Property Graphs
Graph models make relationships and paths explicit