| |

Medallion Architecture in Practice

Medallion architecture in practice: six stages from raw source files to a model-ready dataset

Version 29 | Created: 2026-06-23 | Updated: 2026-11-07 13:46 UTC

1. Overview

This report describes a pipeline that carries data from raw source files to a model-ready dataset for Artificial Intelligence and Machine Learning (AI/ML) workloads, organized by data maturity. The layering is the Databricks' Medallion architecture (Bronze β†’ Silver β†’ Gold), an industry standard, and the six stages of this pipeline fill its three layers. Each stage has a single responsibility and reads only the stage or stages before it, which keeps the pipeline reproducible and auditable.

Databricks defines the architecture as a data design pattern for organizing data in a lakehouse, whose aim is to improve the structure and quality of the data incrementally as it passes through the three layers [1]. The layers are named for what the data has become, not for where it is kept.

  • Bronze holds the records from the source systems β€” an RDBMS (Relational Database Management System), IoT (Internet of Things) devices, logs, or an API (Application Programming Interface) β€” almost exactly as they arrive.
  • Silver holds those same records cleansed, enriched, and conformed to one specification, an intermediate state between the source and the consumer.
  • Gold holds the aggregated and modeled result, shaped for the consumer that reads it: a star schema for BI (Business Intelligence) reporting, a feature table for model training.

Fig 1 states the guarantee each layer makes.

           BRONZE                         SILVER                          GOLD
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚        keep it        β”‚      β”‚        make it        β”‚      β”‚        make it        β”‚
  β”‚      as it landed     β”‚ ───> β”‚      trustworthy      β”‚ ───> β”‚      model-ready      β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      written once and              nulls, outliers and            features built and
      never edited, the             clocks resolved, so            reduced, and pinned
       only safety net                the data can be             to a version so that
     if a parse is wrong            queried with trust            train and serve agree
                                    and fed to a model

Fig 1. What each Medallion layer guarantees and what its data can be used for

Bronze guarantees that the record is what arrived, Silver that the values can be trusted, and Gold that the columns are the ones a model consumes. Section 2 places the six stages of the pipeline inside these layers, and section 3 takes each stage in turn.

2. Medallion Architecture Mapping

The six stages fall into the three layers of the Medallion architecture, the de facto standard for sorting data by quality and maturity.

Fig 2 names the transform between the stages and shows the two paths into Transformed Data.

           BRONZE                                      SILVER                                 GOLD
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚  Original β”‚    Raw    β”‚ ──> β”‚   Clean   β”‚ ──> β”‚   Reshaped  β”‚ ──> β”‚ Transformed β”‚ ──> β”‚  Feature  β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        └── parse β”€β”€β”˜      clean      β”‚     reshape              scale       ^     features
                                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Fig 2. The six stages, the transform between them, and the layers they fall into

Transformed Data reads Reshaped Data, and reads Clean Data directly when the table needs no reshape. Feature Data reads Transformed Data alone.

Table 1. Medallion layers and the stages they hold

Layer Stages State Purpose
Bronze Original + Raw Landed as-is; format mismatch and unstructured content included Preserve the historical record
Silver Clean + Reshaped + Transformed Cleaned and conformed, then reshaped to a model-input form and re-expressed on the scale a model reads Trusted, query-ready data, and model-ready when no new feature is needed
Gold Feature Fully engineered, highest maturity Drop straight into a model

Reshaped Data and Transformed Data are transitional. Model-agnostic work β€” plain reshape, standard windowing, standard scaling β€” stays in Silver because many models can share it, while model-specific shaping or encoding leans toward Gold. When several models reuse the same output, it is best pinned to Silver. A model that needs no engineered feature can be trained on the Silver output directly, because Transformed Data already carries both the input shape a model reads and its scale.

3. Pipeline Stages

3.1 Original Data (Bronze)

The untouched files exactly as they arrive from each source. Every source and version brings its own format β€” CSV (Comma-Separated Values), JSON (JavaScript Object Notation), or XML (Extensible Markup Language) β€” its own column names, and its own header conventions. These files are stored exactly as received and are never edited in place; they are the historical record and the only safety net if a parsing bug surfaces later.

3.2 Raw Data (Bronze)

The same data conformed to one schema. Originals are parsed into standardized column names, units, and timestamps. The shape is now consistent, but the content is still raw: nulls, outliers, and duplicates remain. Parsing is kept idempotent so that Raw can always be regenerated from Original.

3.3 Clean Data (Silver)

Trustworthy data. Missing values are handled, noise and outliers are removed, and timestamps are aligned across sources. This is the first stage that can be queried with confidence. One caution: a transient spike and a genuine distribution change β€” dataset shift [2] β€” can look statistically similar, so removal rules should be set with domain review to avoid discarding real signal.

3.4 Reshaped Data (Silver)

The same values laid out on the axes a model reads. The two-dimensional (2D) form is a [samples, features] table for classical models such as XGBoost (eXtreme Gradient Boosting). The three-dimensional (3D) tensor form applies a time-series window for deep models β€” a Convolutional Neural Network (CNN) or Long Short-Term Memory (LSTM) β€” giving [samples, timesteps, features]. Group keys are carried through so the model can later be validated against unseen groups.

3.5 Transformed Data (Silver)

The same values re-expressed on the scale a model reads. Numeric columns are scaled, categorical columns are encoded, and a skewed column is put through a monotone transform. The arrangement of the table is untouched, which is what separates this stage from Reshaped Data: one changes how the values are laid out, the other changes the values themselves. The parameters they fit β€” a scaler's mean and variance, an encoder's category list β€” are taken from training rows only and stored with the dataset, because refitting them at serving time is a known route to train/serve skew [3].

3.6 Feature Data (Gold)

The optimized dataset. Domain knowledge converts the Transformed Data columns into the variables a model learns from β€” moving averages, frequency components, embeddings β€” alongside dimensionality reduction. When features outnumber samples ($p \gg n$), feature reduction is essential rather than optional [4]. Feature definitions are versioned to prevent train/serve skew [3].

4. Key Principles

The value of the pipeline is not the six labels but the discipline behind them:

  • Immutability β€” each layer is written once and never edited in place.
  • Reproducibility β€” each transform is deterministic, so the same input yields the same output.
  • Lineage β€” every column can be traced back to the source record that produced it.

Together they make a bad prediction diagnosable: the column that carried it can be re-derived, and the record behind that column can be opened.

References

[1] Databricks. What is Medallion Architecture?. Databricks.
[2] QuiΓ±onero-Candela, J., Sugiyama, M., Schwaighofer, A., & Lawrence, N. D. (Eds.) (2009). Dataset Shift in Machine Learning. MIT Press. ISBN 978-0-262-17005-8.
[3] Sculley, D., Holt, G., Golovin, D., Davydov, E., Phillips, T., Ebner, D., Chaudhary, V., Young, M., Crespo, J.-F., & Dennison, D. (2015). Hidden Technical Debt in Machine Learning Systems. Advances in Neural Information Processing Systems, 28.
[4] BΓΌhlmann, P., & van de Geer, S. (2011). Statistics for High-Dimensional Data: Methods, Theory and Applications. Springer.


Appendix A. Terminology

  • Bronze: The Medallion layer that keeps data as it landed, with no cleaning or validation.
  • dataset shift: A change in the joint distribution of inputs and outputs between the training stage and the serving stage.
  • Gold: The Medallion layer that holds fully engineered, model-ready data.
  • idempotent: A property of a transform whose repeated application gives the same result as a single application.
  • lineage: The recorded chain of transforms that connects a column to its origin.
  • Medallion architecture: A layering of a data lakehouse into Bronze, Silver, and Gold by data quality and maturity.
  • Silver: The Medallion layer that holds cleaned and conformed data, reshaped and re-expressed for a model.
  • star schema: A table layout that puts the measures in one fact table and their descriptive attributes in the dimension tables around it.
  • train/serve skew: A mismatch between the feature values computed at training time and those computed at serving time.

Medallion architecture in practice: six stages from raw source files to a model-ready dataset

Version 14 | Created: 2026-09-08 | Updated: 2026-11-07 13:46 UTC

1. Overview

이 λ¬Έμ„œλŠ” raw source file μ—μ„œ model-ready dataset κΉŒμ§€ 데이터λ₯Ό λ‚˜λ₯΄λŠ” pipeline 을 데이터 μ„±μˆ™λ„ 순으둜 μ •λ¦¬ν•œλ‹€. 계측 κ΅¬μ‘°λŠ” 업계 ν‘œμ€€μΈ Databricks 의 Medallion architecture (Bronze β†’ Silver β†’ Gold) 이며, 이 pipeline 의 μ—¬μ„― stage κ°€ κ·Έ μ„Έ layer λ₯Ό μ±„μš΄λ‹€. 각 stage λŠ” ν•œ κ°€μ§€ μ±…μž„λ§Œ μ§€κ³  자기 μ•žμ˜ stage 만 μ½μœΌλ―€λ‘œ, pipeline 이 μž¬ν˜„ κ°€λŠ₯ν•˜κ³  좔적 κ°€λŠ₯ν•˜κ²Œ μœ μ§€λœλ‹€.

Databricks λŠ” 이 architecture λ₯Ό lakehouse μ•ˆμ˜ 데이터λ₯Ό μ‘°μ§ν•˜λŠ” data design pattern 으둜 μ •μ˜ν•˜λ©°, κ·Έ λͺ©μ μ€ 데이터가 μ„Έ layer λ₯Ό μ§€λ‚˜λŠ” λ™μ•ˆ ꡬ쑰와 ν’ˆμ§ˆμ„ μ μ§„μ μœΌλ‘œ λŒμ–΄μ˜¬λ¦¬λŠ” 데 μžˆλ‹€ [1]. layer 의 이름은 데이터가 놓인 μžλ¦¬κ°€ μ•„λ‹ˆλΌ 데이터가 무엇이 λ˜μ—ˆλŠ”μ§€λ₯Ό 가리킨닀.

  • Bronze λŠ” source system β€” RDBMS (Relational Database Management System), IoT (Internet of Things) κΈ°κΈ°, log, API (Application Programming Interface) β€” 의 기둝을 λ„μ°©ν•œ κ·ΈλŒ€λ‘œ λ‹΄λŠ”λ‹€.
  • Silver λŠ” κ·Έ 기둝을 μ •μ œν•˜κ³  κ²°ν•©ν•˜κ³  ν•˜λ‚˜μ˜ κ·œκ²©μ— 맞좘, source 와 μ†ŒλΉ„μž μ‚¬μ΄μ˜ 쀑간 μƒνƒœλ‘œ λ‹΄λŠ”λ‹€.
  • Gold λŠ” 집계와 modeling 을 마친 κ²°κ³Όλ₯Ό 그것을 μ½λŠ” μͺ½μ— 맞좰 λ‹΄λŠ”λ‹€. BI (Business Intelligence) 보고λ₯Ό μœ„ν•œ star schema, model ν›ˆλ ¨μ„ μœ„ν•œ feature ν‘œκ°€ 그것이닀.

Fig 1 은 layer λ§ˆλ‹€ κ·Έ 보증을 μ λŠ”λ‹€.

           BRONZE                         SILVER                          GOLD
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚        keep it        β”‚      β”‚        make it        β”‚      β”‚        make it        β”‚
  β”‚      as it landed     β”‚ ───> β”‚      trustworthy      β”‚ ───> β”‚      model-ready      β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      written once and              nulls, outliers and            features built and
      never edited, the             clocks resolved, so            reduced, and pinned
       only safety net                the data can be             to a version so that
     if a parse is wrong            queried with trust            train and serve agree
                                    and fed to a model

Fig 1. What each Medallion layer guarantees and what its data can be used for

Bronze λŠ” 기둝이 λ„μ°©ν•œ κ·ΈλŒ€λ‘œμž„μ„, Silver λŠ” 값을 믿을 수 μžˆμŒμ„, Gold λŠ” 열이 model 이 κ·ΈλŒ€λ‘œ μ“°λŠ” κ²ƒμž„μ„ λ³΄μ¦ν•œλ‹€. κΌ­μ§€ 2 λŠ” pipeline 의 μ—¬μ„― stage λ₯Ό 이 layer μ•ˆμ— λ°°μΉ˜ν•˜κ³ , κΌ­μ§€ 3 은 각 stage λ₯Ό μ°¨λ‘€λ‘œ 닀룬닀.

2. Medallion Architecture Mapping

μ—¬μ„― stage λŠ” 데이터λ₯Ό ν’ˆμ§ˆκ³Ό μ„±μˆ™λ„λ‘œ κ°€λ₯΄λŠ” μ‚¬μ‹€μƒμ˜ ν‘œμ€€μΈ Medallion architecture 의 μ„Έ layer 에 λ‚˜λ‰˜μ–΄ λ“€μ–΄κ°„λ‹€.

Fig 2 λŠ” stage 사이 transform 의 이름과 Transformed Data 둜 λ“€μ–΄κ°€λŠ” 두 길을 보인닀.

           BRONZE                                      SILVER                                 GOLD
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚  Original β”‚    Raw    β”‚ ──> β”‚   Clean   β”‚ ──> β”‚   Reshaped  β”‚ ──> β”‚ Transformed β”‚ ──> β”‚  Feature  β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        └── parse β”€β”€β”˜      clean      β”‚     reshape              scale       ^     features
                                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Fig 2. The six stages, the transform between them, and the layers they fall into

Transformed Data λŠ” Reshaped Data λ₯Ό 읽고, ν‘œλ₯Ό λ‹€μ‹œ λ°°μΉ˜ν•  ν•„μš”κ°€ μ—†μœΌλ©΄ Clean Data λ₯Ό λ°”λ‘œ μ½λŠ”λ‹€. Feature Data λŠ” Transformed Data 만 μ½λŠ”λ‹€.

Table 1. Medallion layers and the stages they hold

Layer Stages State Purpose
Bronze Original + Raw λ„μ°©ν•œ κ·ΈλŒ€λ‘œ. ν˜•μ‹ λΆˆμΌμΉ˜μ™€ λΉ„μ •ν˜• λ‚΄μš© 포함 원본 기둝 보쑴
Silver Clean + Reshaped + Transformed μ •μ œΒ·μ •κ·œν™” ν›„ model μž…λ ₯ ν˜•νƒœλ‘œ μž¬λ°°μΉ˜ν•˜κ³  model 이 μ½λŠ” μ²™λ„λ‘œ λ‹€μ‹œ ν‘œν˜„ μ‹ λ’°ν•  수 있고 쑰회 κ°€λŠ₯ν•œ 데이터. μƒˆ feature κ°€ ν•„μš” μ—†μœΌλ©΄ model 에도 κ·ΈλŒ€λ‘œ νˆ¬μž…
Gold Feature μ™„μ „νžˆ κ°€κ³΅λœ 졜고 μ„±μˆ™λ„ model 에 κ·ΈλŒ€λ‘œ νˆ¬μž…

Reshaped Data 와 Transformed Data λŠ” 과도기적이닀. model 에 λ¬΄κ΄€ν•œ μž‘μ—… β€” λ‹¨μˆœ 재배치, ν‘œμ€€ windowing, ν‘œμ€€ scaling β€” 은 μ—¬λŸ¬ model 이 ν•¨κ»˜ μ“Έ 수 μžˆμœΌλ―€λ‘œ Silver 에 남고, νŠΉμ • model μ—λ§Œ 맞좘 μž¬λ°°μΉ˜λ‚˜ encoding 은 Gold μͺ½μœΌλ‘œ κΈ°μš΄λ‹€. μ—¬λŸ¬ model 이 같은 μ‚°μΆœλ¬Όμ„ μž¬μ‚¬μš©ν•œλ‹€λ©΄ Silver 에 κ³ μ •ν•˜λŠ” 것이 λ‚«λ‹€. μƒˆλ‘œ λ§Œλ“€ feature κ°€ ν•„μš” μ—†λŠ” model 은 Silver μ‚°μΆœλ¬Όλ‘œ λ°”λ‘œ ν›ˆλ ¨ν•  수 μžˆλ‹€. Transformed Data κ°€ κ·Έ model 이 μ½λŠ” μž…λ ₯ ν˜•νƒœμ™€ 척도λ₯Ό ν•¨κ»˜ κ°–μΆ”κ³  있기 λ•Œλ¬Έμ΄λ‹€.

3. Pipeline Stages

3.1 Original Data (Bronze)

각 source μ—μ„œ λ„μ°©ν•œ κ·ΈλŒ€λ‘œμ˜ μ†λŒ€μ§€ μ•Šμ€ file 이닀. source 와 version λ§ˆλ‹€ κ³ μœ ν•œ ν˜•μ‹ β€” CSV (Comma-Separated Values), JSON (JavaScript Object Notation), XML (Extensible Markup Language) β€” κ³Ό κ³ μœ ν•œ μ—΄ 이름, κ³ μœ ν•œ header κ΄€λ‘€λ₯Ό κ°€μ§„λ‹€. 이 file 은 받은 κ·ΈλŒ€λ‘œ λ³΄κ΄€ν•˜λ©° μ œμžλ¦¬μ—μ„œ κ³ μΉ˜μ§€ μ•ŠλŠ”λ‹€. 원본 기둝이자, λ‚˜μ€‘μ— parsing 결함이 λ“œλŸ¬λ‚¬μ„ λ•Œμ˜ μœ μΌν•œ μ•ˆμ „λ§μ΄κΈ° λ•Œλ¬Έμ΄λ‹€.

3.2 Raw Data (Bronze)

같은 데이터λ₯Ό ν•˜λ‚˜μ˜ schema 둜 맞좘 것이닀. Original 을 parsing ν•˜μ—¬ μ—΄ 이름과 λ‹¨μœ„μ™€ timestamp λ₯Ό ν‘œμ€€ν™”ν•œλ‹€. ν˜•νƒœλŠ” μΌκ΄€ν•΄μ‘Œμ§€λ§Œ λ‚΄μš©μ€ 아직 κ±°μΉ μ–΄μ„œ null κ³Ό μ΄μƒμΉ˜μ™€ 쀑볡이 κ·ΈλŒ€λ‘œ 남아 μžˆλ‹€. parsing 은 idempotent ν•˜κ²Œ μœ μ§€ν•˜μ—¬ Raw λ₯Ό μ–Έμ œλ“  Original μ—μ„œ λ‹€μ‹œ λ§Œλ“€ 수 있게 ν•œλ‹€.

3.3 Clean Data (Silver)

믿을 수 μžˆλŠ” 데이터이닀. 결츑값을 μ²˜λ¦¬ν•˜κ³  작음과 μ΄μƒμΉ˜λ₯Ό μ œκ±°ν•˜λ©° source κ°„ timestamp λ₯Ό μ •λ ¬ν•œλ‹€. 확신을 κ°–κ³  μ‘°νšŒν•  수 μžˆλŠ” 첫 stage 이닀. ν•œ κ°€μ§€ μ£Όμ˜ν•  점이 μžˆλ‹€. μΌμ‹œμ μΈ spike 와 μ‹€μ œ 뢄포 λ³€ν™” β€” dataset shift [2] β€” λŠ” ν†΅κ³„μ μœΌλ‘œ λΉ„μŠ·ν•΄ 보일 수 μžˆμœΌλ―€λ‘œ, 제거 κ·œμΉ™μ€ 도메인 κ²€ν† λ₯Ό 거쳐 μ •ν•΄μ•Ό μ‹€μ œ μ‹ ν˜Έλ₯Ό 버리지 μ•ŠλŠ”λ‹€.

3.4 Reshaped Data (Silver)

같은 값을 model 이 μ½λŠ” 좕에 맞좰 λŠ˜μ–΄λ†“μ€ 것이닀. 이차원 (2D) ν˜•νƒœλŠ” XGBoost (eXtreme Gradient Boosting) 같은 κ³ μ „ model 을 μœ„ν•œ [samples, features] ν‘œμ΄λ‹€. 삼차원 (3D) tensor ν˜•νƒœλŠ” Convolutional Neural Network (CNN) μ΄λ‚˜ Long Short-Term Memory (LSTM) 같은 deep model 을 μœ„ν•΄ μ‹œκ³„μ—΄ window λ₯Ό μ μš©ν•˜μ—¬ [samples, timesteps, features] λ₯Ό λ§Œλ“ λ‹€. group key λ₯Ό ν•¨κ»˜ λ„˜κ²¨μ„œ λ‚˜μ€‘μ— 보지 μ•Šμ€ group 으둜 model 을 검증할 수 있게 ν•œλ‹€.

3.5 Transformed Data (Silver)

같은 값을 model 이 μ½λŠ” μ²™λ„λ‘œ λ‹€μ‹œ ν‘œν˜„ν•œ 것이닀. Numeric 열은 scaling ν•˜κ³  λ²”μ£Ό 열은 encoding ν•˜λ©° 치우친 열은 단쑰 λ³€ν™˜μ„ κ±°μΉœλ‹€. ν‘œμ˜ λ°°μΉ˜λŠ” κ±΄λ“œλ¦¬μ§€ μ•ŠμœΌλ©°, 이것이 Reshaped Data 와 κ°ˆλ¦¬λŠ” 지점이닀. ν•œμͺ½μ€ 값이 λ†“μ΄λŠ” 방식을 λ°”κΎΈκ³  λ‹€λ₯Έ μͺ½μ€ κ°’ 자체λ₯Ό λ°”κΎΌλ‹€. μ—¬κΈ°μ„œ μ ν•©ν•˜λŠ” parameter β€” scaler 의 평균과 λΆ„μ‚°, encoder 의 λ²”μ£Ό λͺ©λ‘ β€” λŠ” ν›ˆλ ¨ ν–‰μ—μ„œλ§Œ μ–»μ–΄ dataset κ³Ό ν•¨κ»˜ μ €μž₯ν•œλ‹€. serving μ‹œμ μ— λ‹€μ‹œ μ ν•©ν•˜λŠ” 것은 train/serve skew [3] 둜 κ°€λŠ” μ•Œλ €μ§„ 길이기 λ•Œλ¬Έμ΄λ‹€.

3.6 Feature Data (Gold)

μ΅œμ ν™”λœ dataset 이닀. 도메인 지식이 Transformed Data 의 열을 model 이 ν•™μŠ΅ν•˜λŠ” λ³€μˆ˜ β€” 이동 평균, 주파수 μ„±λΆ„, embedding β€” 둜 λ°”κΎΈκ³  차원 μΆ•μ†Œλ₯Ό ν•¨κ»˜ μ μš©ν•œλ‹€. feature κ°€ sample 보닀 λ§Žμ•„μ§€λ©΄ ($p \gg n$) 차원 μΆ•μ†ŒλŠ” 선택이 μ•„λ‹ˆλΌ ν•„μˆ˜μ΄λ‹€ [4]. feature μ •μ˜λŠ” version 을 λΆ™μ—¬ train/serve skew [3] λ₯Ό λ§‰λŠ”λ‹€.

4. Key Principles

pipeline 의 κ°’μ–΄μΉ˜λŠ” μ—¬μ„― 개의 μ΄λ¦„ν‘œκ°€ μ•„λ‹ˆλΌ κ·Έ λ’€μ˜ κ·œμœ¨μ— μžˆλ‹€.

  • Immutability β€” 각 layer λŠ” ν•œ 번 μ“°κ³  μ œμžλ¦¬μ—μ„œ κ³ μΉ˜μ§€ μ•ŠλŠ”λ‹€.
  • Reproducibility β€” 각 transform 은 κ²°μ •μ μ΄λ―€λ‘œ 같은 μž…λ ₯이 같은 좜λ ₯을 λ‚Έλ‹€.
  • Lineage β€” λͺ¨λ“  열은 그것을 λ§Œλ“  source κΈ°λ‘κΉŒμ§€ 거슬러 갈 수 μžˆλ‹€.

이 셋이 ν•¨κ»˜ 잘λͺ»λœ μ˜ˆμΈ‘μ„ 진단 κ°€λŠ₯ν•˜κ²Œ λ§Œλ“ λ‹€. κ·Έ μ˜ˆμΈ‘μ„ μ‹€μ–΄ λ‚˜λ₯Έ 열을 λ‹€μ‹œ μœ λ„ν•  수 있고, κ·Έ μ—΄ λ’€μ˜ 기둝을 μ—΄μ–΄ λ³Ό 수 μžˆλ‹€.

References

[1] Databricks. What is Medallion Architecture?. Databricks.
[2] QuiΓ±onero-Candela, J., Sugiyama, M., Schwaighofer, A., & Lawrence, N. D. (Eds.) (2009). Dataset Shift in Machine Learning. MIT Press. ISBN 978-0-262-17005-8.
[3] Sculley, D., Holt, G., Golovin, D., Davydov, E., Phillips, T., Ebner, D., Chaudhary, V., Young, M., Crespo, J.-F., & Dennison, D. (2015). Hidden Technical Debt in Machine Learning Systems. Advances in Neural Information Processing Systems, 28.
[4] BΓΌhlmann, P., & van de Geer, S. (2011). Statistics for High-Dimensional Data: Methods, Theory and Applications. Springer.


Appendix A. Terminology

  • Bronze: μ •μ œλ‚˜ 검증 없이 λ„μ°©ν•œ κ·ΈλŒ€λ‘œμ˜ 데이터λ₯Ό λ‹΄λŠ” Medallion layer.
  • dataset shift: ν›ˆλ ¨ μ‹œμ κ³Ό serving μ‹œμ  μ‚¬μ΄μ—μ„œ μž…λ ₯κ³Ό 좜λ ₯의 κ²°ν•© 뢄포가 λ‹¬λΌμ§€λŠ” 것.
  • Gold: μ™„μ „νžˆ κ°€κ³΅λ˜μ–΄ model 에 λ°”λ‘œ μ“Έ 수 μžˆλŠ” 데이터λ₯Ό λ‹΄λŠ” Medallion layer.
  • idempotent: μ—¬λŸ¬ 번 μ μš©ν•΄λ„ ν•œ 번 μ μš©ν•œ 것과 같은 κ²°κ³Όλ₯Ό λ‚΄λŠ” transform 의 μ„±μ§ˆ.
  • lineage: ν•œ 열을 κ·Έ κΈ°μ›κΉŒμ§€ μž‡λŠ”, 기둝으둜 남은 transform 의 μ‚¬μŠ¬.
  • Medallion architecture: data lakehouse λ₯Ό 데이터 ν’ˆμ§ˆκ³Ό μ„±μˆ™λ„μ— 따라 Bronze, Silver, Gold 둜 λ‚˜λˆˆ 계측 ꡬ쑰.
  • Silver: μ •μ œΒ·μ •κ·œν™”λœ λ’€ model 을 μœ„ν•΄ 재배치되고 λ‹€μ‹œ ν‘œν˜„λœ 데이터λ₯Ό λ‹΄λŠ” Medallion layer.
  • star schema: 츑정값을 ν•˜λ‚˜μ˜ fact table 에 두고 κ·Έ μ„€λͺ… 속성을 λ‘˜λ ˆμ˜ dimension table 에 λ‘λŠ” ν‘œ 배치.
  • train/serve skew: ν›ˆλ ¨ μ‹œμ μ— κ³„μ‚°ν•œ feature κ°’κ³Ό serving μ‹œμ μ— κ³„μ‚°ν•œ 값이 μ–΄κΈ‹λ‚˜λŠ” 것.

Our Score
Click to rate this post!
[Total: 1 Average: 3]
Visited 31 times, 1 visit(s) today

Leave a Comment

Your email address will not be published. Required fields are marked *