SageMaker Notebooks
Master SageMaker's notebook environments for data exploration, model development, and experimentation.
Studio Notebooks vs Notebook Instances
| Feature | Studio Notebooks | Notebook Instances |
|---|---|---|
| Interface | JupyterLab (integrated) | Jupyter / JupyterLab |
| Startup time | Fast (seconds) | Slower (minutes) |
| Instance switching | Change on the fly | Requires restart |
| Collaboration | Shared spaces | Individual |
| Git integration | Built-in | Manual setup |
| Auto shutdown | Configurable idle timeout | Lifecycle config required |
| Recommended | ✓ (default choice) | Legacy / specific needs |
Instance Types
Choose the right instance type for your workload:
- ml.t3.medium: General development, small datasets, code writing. Most cost-effective for learning
- ml.m5.large/xlarge: Data preprocessing, medium datasets, feature engineering
- ml.c5.xlarge: CPU-intensive computations, data transformations
- ml.g4dn.xlarge: GPU-powered development, small model training, deep learning prototyping
- ml.p3.2xlarge: Serious deep learning development with V100 GPU
Lifecycle Configurations
Lifecycle configurations are shell scripts that run when a notebook instance is created or started:
- On-create scripts: Run once when the instance is first created - install persistent packages, configure tools
- On-start scripts: Run every time the instance starts - activate environments, start services
- Auto-shutdown: Configure scripts to automatically stop idle instances after a set period
- Custom environments: Install specific Python packages, Conda environments, or system tools
Working with Data
SageMaker notebooks access data primarily through Amazon S3:
- S3 integration: Use the SageMaker Python SDK or boto3 to read and write data to S3 buckets
- Local storage: Notebook instances have attached EBS volumes for temporary local storage
- EFS mounting: Mount Amazon EFS for shared, persistent file storage across notebooks
- Athena queries: Query data lakes directly from notebooks using Amazon Athena
- Data Wrangler: Use SageMaker Data Wrangler for visual data exploration and transformation
Pre-installed Kernels and Frameworks
Python Kernels
Pre-configured environments with Python 3.x, pandas, numpy, scikit-learn, and the SageMaker SDK.
Deep Learning
TensorFlow, PyTorch, and MXNet kernels with GPU support configured automatically.
R Kernel
R kernel with tidyverse, caret, and integration with the SageMaker R SDK for R-based workflows.
Spark
SparkMagic kernel for connecting to Amazon EMR clusters for distributed data processing.
%%time or %%timeit magic commands in your notebooks to track cell execution time. This helps you identify bottlenecks and make informed decisions about when to scale up your instance type or offload work to SageMaker Processing jobs.Ready to Go Deeper?
Live instructor-led courses from our partners. Affiliate disclosure.
AI & ML Courses - 30% Off
Live instructor-led AI, machine learning, data science, and cloud courses for working professionals. Use code Limited30 at checkout.
EdurekaDataCamp - AI & Data Science
Hands-on Python, machine learning, and AI courses with interactive exercises and real projects.
DataCampedX - Top AI Courses
University-level AI courses from MIT, Harvard, Stanford. Earn certificates that employers recognize.
edX