IMEN891K / IDSC501 / AXGS-501 · Data Engineering · Fall 2026

14. ML Systems

Sangwoo Mo · POSTECH
Industrial & Management Engineering

Where We Are

Collection and PreparationPart I · Lec 2–5StoragePart II · Lec 6–13ML SystemsPart III · Lec 14LLM SystemsPart III · Lec 15AgentsPart III · Lec 16–17
Part III connects stored data to predictions, answers, and actions

Outline: ML Systems

01Preparing Examplesuse what was known at predictiontime02Making Predictionskeep the input meaning the same03Checking Resultscompare predictions with observedoutcomes

01 · Preparing Examples

01Preparing Examplesuse what was known at predictiontime02Making Predictionskeep the input meaning the same03Checking Resultscompare predictions with observedoutcomes

Why ML SystemsA useful model also needs reliable data, predictions and feedback

2015 · Hidden Technical Debt in Machine Learning SystemsDataarrives late / changes unitsModellearned from past examplesPredictionsoutcomes arrive laterA good experiment still needs a dependable path to everyday predictions
The model is one component of a system that must keep working

From Data to a Checked ModelPrepare model inputs, learn from past outcomes, then check predictions

From Data to a Checked Model
The pipeline connects data preparation to training and evaluation

§ Prediction Rows

Preparing ExamplesPrediction RowsWhat the model learns fromFeatures and labelsOne row per predictionAvailable InputsWhat was known at that timeEvent and availability timeLeakage and SQL check

Failure Prediction ExampleAt 10:00, predict whether P-17 will fail during the next hour

prediction at 10:0031 °C / vibration 0.8available inputsWill P-17 fail before 11:00?label = 1 if failure occurs in (10:00, 11:00]failure at 10:48one example = machine + prediction time
The 10:48 failure becomes the label for the 10:00 prediction

Features and LabelsFeatures are model inputs and the label is the observed outcome

Features: model inputstemperature 31 °Cvibration 0.8Modellearned from past examplesPredictionfailure in the next hour: yesLabel: the observed outcome arrives later
The model predicts a label that has not arrived yet

The Next-Hour LabelA label answers a question about one future time interval

10:0011:0012:00p-42failure: label 1p-43no failure: label 0failure 10:48observed through 12:00
The 10:48 failure belongs to the earlier prediction window

Training ExamplesOne row combines past inputs with the outcome that followed

MachinePrediction timeTemperatureVibrationLabelP-17Sep 1 10:0031 °C0.81P-17Sep 1 11:0028 °C0.20P-17Sep 2 10:0034 °C0.91
Each row describes one P-17 prediction, rather than the whole machine

§ Available Inputs

Preparing ExamplesPrediction RowsWhat the model learns fromFeatures and labelsOne row per predictionAvailable InputsWhat was known at that timeEvent and availability timeLeakage and SQL check

Feature AvailabilityEvent: when it happened. Available: when the system could read it

FeatureEventAvailableValue
temperature09:5509:5631
alarm_count09:5810:123
vibration09:5009:510.8
The alarm happened before 10:00 but arrived at 10:12

Late Feature ArrivalAn earlier event can still be unknown when the model predicts

prediction 10:00temperature09:55available 09:56alarm_count09:58available 10:12vibration09:50available 09:51
Only temperature and vibration are available before the prediction line

Caveat: Future InformationUsing a late input during training gives the model information it would lack

Training input at 10:00ValuesAvailable then?temperature / vibration31 / 0.8yesalarm_count3no, arrived 10:12
The late alarm would make the training example unrealistically informative

Demo: Available InputsRun the join, then exclude inputs that arrived after 10:00

  1. Join Predictions and Features using machine_id; filter event_at ≤ predicted_at.
  2. Also filter available_at ≤ predicted_at. Which feature disappears?
Ctrl/⌘ + Enter
Query result
Write a query on the left, then Run.

Answer: Available InputsBoth time conditions must hold for the input to be usable

SELECT p.id, f.feature, f.value
FROM Predictions p JOIN Features f ON f.machine_id=p.machine_id
WHERE f.event_at <= p.predicted_at AND f.available_at <= p.predicted_at
ORDER BY p.id, f.feature;
idfeaturevalue
prediction_42temperature31.0
prediction_42vibration0.8
The late alarm report is excluded

Available Model InputsThe filtered result reconstructs what the predictor could actually read

PredictionUsable inputValueP-17 at 10:00temperature31P-17 at 10:00vibration0.8
The two remaining values are the inputs for the 10:00 prediction

02 · Making Predictions

01Preparing Examplesuse what was known at predictiontime02Making Predictionskeep the input meaning the same03Checking Resultscompare predictions with observedoutcomes

§ Learning from History

Making PredictionsLearning from HistoryHow past examples produce a modelTraining and predictionChecking later examplesShared Feature MeaningHow training inputs match real inputsSame calculationSame units

Training and PredictionTraining learns from known outcomes and prediction uses the saved model

Past examplesfeatures + known labelsTrainingfind a predictive patternSaved modelreuse the learned patternPrediction uses features while the future label is unknown
The model learns from past labels and predicts a future label

Batch and Request-Time PredictionsThe same model can score many rows together or answer one request

Batchmany machines each morningThe same saved modelinputs → predictionsScheduled resultmaintenance planningOne requestcheck P-17 nowThe same saved modelinputs → predictionOne responseP-17 failure risk
Choose when predictions are needed before choosing the execution mode

Checking Later ExamplesCheck the model on later examples that it did not learn from

Learn from earlier daysfeatures + labels already observedCheck on later dayskeep these labels out of trainingP-17: train before Sep 8, check predictions from Sep 8 onward
Past training data and later checking data serve different purposes

Predictions and OutcomesA prediction is correct only when it matches the observed label

P-17 predictionPredicted failureObserved labelCorrect?Sep 8 10:00yes1yesSep 8 11:00no0yesSep 9 10:00no1noSep 9 11:00no0yes
Three of the four predictions match their observed outcomes

§ Shared Feature Meaning

Making PredictionsLearning from HistoryHow past examples produce a modelTraining and predictionChecking later examplesShared Feature MeaningHow training inputs match real inputsSame calculationSame units

A Temperature FeatureA feature definition tells us how source readings become one input

P-17 temperature readings: 30 °C at 09:59:10, 32 °C at 09:59:50Trainingmean of the last 60 s(30 + 32) / 2 = 31Predictionmean of the last 60 s(30 + 32) / 2 = 31
Both paths turn the same readings into the value 31

Caveat: Different CalculationsA last reading and a mean can share a name while carrying different meanings

P-17 temperature readings: 30 °C at 09:59:10, 32 °C at 09:59:50Trainingmean of the last 60 s(30 + 32) / 2 = 31Predictionlast reading32
Training receives 31 while prediction receives 32 from the same readings

Shared Feature MeaningKeep the calculation and the unit the same in both paths

PathCalculationUnitInputTrainingmean of last 60 s°C31Predictionmean of last 60 s°C31
The model receives the same kind of input during training and prediction

03 · Checking Results

01Preparing Examplesuse what was known at predictiontime02Making Predictionskeep the input meaning the same03Checking Resultscompare predictions with observedoutcomes

§ Prediction Records

Checking ResultsPrediction RecordsWhat happened after a predictionInputs and predictionObserved outcomesModel UpdatesWhat evidence supports a changeQuality before changesCandidate comparison

Prediction RecordKeep the input and prediction so the later outcome can be matched

Prediction IDMachine / TimeModel inputsPredictionObserved labelp-42P-17 / 10:0031 °C / 0.8failure: yes?
The 10:00 prediction is recorded before its outcome is known

Observed OutcomeAttach the observed failure to the prediction it answers

Prediction IDMachine / TimeModel inputsPredictionObserved labelp-42P-17 / 10:0031 °C / 0.8failure: yes1: failure
The 10:48 failure confirms the recorded prediction p-42

Delayed OutcomesRecent predictions may still have missing outcomes

Ten P-17 predictions from the same day12345678910Day 1: 4 labels, 4 correctOnly 4 outcomes are knownDay 3: 10 labels, 6 correctAll 10 outcomes are known
The same ten predictions score differently as more labels arrive

§ Model Updates

Checking ResultsPrediction RecordsWhat happened after a predictionInputs and predictionObserved outcomesModel UpdatesWhat evidence supports a changeQuality before changesCandidate comparison

Input Changes and QualityCheck what changed before deciding to train a new model

CheckEarlierNowMeaningTemperature unit°C°Ffix input conversionCorrect predictions6 / 106 / 10quality unchanged
A unit change needs an input fix before any model update

Candidate ComparisonCompare the current model and a candidate on the same later examples

The same ten later predictions, with all labels observedCurrent model v1✓✓×✓×✓×✓×✓6/10Candidate model v2✓✓✓✓✓✓×✓×✓8/10Each mark compares one prediction with its observed label
The candidate matches eight outcomes while the current model matches six

MLOps: A Repeating CycleDevelop a model, use it, observe outcomes and improve the next candidate

MLOps: A Repeating Cycle
Operating the model continues after the first deployment

Model UpdateUse observed examples to train and check a candidate before replacing the model

New past exampleskeep the same feature meaningTrain a candidatecompare on later examplesUse the better modelkeep v1 available to restore
A checked candidate can replace v1 while v1 remains available

Takeaway: Operate with available data

1Use only inputs available when the prediction was made
2Compute the same feature meaning during training and prediction
3Record predictions and observed outcomes before deciding to update
← → / Space · S notes · O overview · F fullscreen · number + Enter
Speaker notes