Learning Objectives
By the end of this chapter, you will be able to:
- Prepare and clean data in Snowflake.
- Perform exploratory data analysis in Snowflake.
- Perform feature engineering on Snowflake data.
- Visualize and interpret the data to present a business case.
Executive Summary
- Cleaning, profiling, and feature work execute inside the warehouse or on Container Runtime, not on a developer laptop. Snowpark DataFrames and SQL both compile to the same pushdown plan; pandas does not.
- Approximation functions (HyperLogLog for distinct counts, t-Digest for percentiles, Space-Saving for top-K) trade bounded statistical error for orders-of-magnitude lower compute on profiling workloads.
- The
snowflake.ml.modeling.preprocessingtransformer family mirrors the scikit-learn API but executes column-wise pushdown and composes with the Feature Store, which enforces point-in-time correctness. - Snowsight dashboards, Streamlit in Snowflake, and Snowflake Notebooks provide three rendering surfaces with different runtime, library, and governance trade-offs.
Assumptions
- Examples use a fictional
ML_LABdatabase with aRETAILschema. The primary tables referenced areCUSTOMER_RAW,TRANSACTIONS,PRODUCTS,CUSTOMER_FEATURES, andCHURN_LABELS. - Snowpark Python examples assume
snowflake-snowpark-pythonandsnowflake-ml-pythonare installed in a Python 3.9 or later environment. - Code blocks omit credentials and session creation boilerplate after the first appearance, except where the boilerplate itself is the subject.
