Kaggle Notebooks Intermediate

Kaggle Notebooks provide a free, cloud-based Jupyter environment with GPU/TPU access, pre-installed libraries, and tight integration with Kaggle's datasets and competitions ecosystem.

Kaggle Notebooks Environment

Kaggle Notebooks run on Google Cloud and provide:

  • Python and R support: Choose your language when creating a notebook
  • Two modes: Notebook (interactive cells) or Script (single .py/.r file)
  • Free GPU: NVIDIA P100 or T4 with 30 hours/week quota
  • Free TPU: Google TPU v3-8 with 20 hours/week quota
  • 12-hour session limit: Sessions automatically stop after 12 hours
  • Internet access: Enable in settings for pip installs and API calls

Free GPU/TPU

ResourceHardwareWeekly QuotaSession Limit
GPUNVIDIA P100 (16GB) or T4 (16GB)30 hours12 hours
TPUGoogle TPU v3-820 hours9 hours
CPU4 vCPUs, 16 GB RAMUnlimited12 hours

Pre-installed Libraries

Kaggle Notebooks come with hundreds of popular libraries pre-installed:

# All of these are available without installation
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import sklearn
import tensorflow as tf
import torch
import xgboost as xgb
import lightgbm as lgb
import catboost as cb
import transformers
import cv2
import nltk
import spacy

# Install additional packages (requires internet enabled)
!pip install some-other-package

Kaggle-Specific Features

  • Input datasets: Attached datasets are available at /kaggle/input/
  • Output directory: Save files to /kaggle/working/ for download or submission
  • Add data: Click + Add data to attach any Kaggle dataset or competition data
  • Add models: Attach pre-trained models from the Kaggle Models hub
  • Commit and run: Save a version that runs all cells from scratch for reproducibility

Publishing Notebooks

Share your work with the Kaggle community:

  1. Click Save Version and choose Save & Run All
  2. Wait for the notebook to run completely (this creates a reproducible version)
  3. Go to notebook settings and set visibility to Public
  4. Add tags, a title, and description to help others find your notebook

Earning Medals

Published notebooks can earn medals based on community upvotes:

MedalUpvotes RequiredPoints
Bronze5+Contributes to Expert rank
Silver20+Contributes to Master rank
Gold50+Contributes to Grandmaster rank

Version Control

  • Each "Save Version" creates a numbered version (v1, v2, v3...)
  • You can view, compare, and revert to any previous version
  • Quick Save: Saves current state without running (for backup)
  • Save & Run All: Creates a reproducible version by running all cells from scratch

Sharing and Forking

  • Share: Public notebooks can be viewed and forked by anyone
  • Fork (Copy & Edit): Create your own copy of any public notebook to modify
  • Embed: Embed notebook outputs in external websites
  • Download: Download as .ipynb to run locally or in Google Colab

Integration with Competitions and Datasets

Notebooks are tightly integrated with the rest of Kaggle:

  • Competition notebooks: Create notebooks directly from a competition page with data pre-attached
  • Dataset notebooks: Start a notebook from any dataset page with data ready to load
  • Notebook competitions: Some competitions require notebook-only submissions (code must run within Kaggle)
  • Submission from notebook: Submit competition predictions directly from your notebook output
Tip: For notebook competitions, your code must run completely within the Kaggle environment with no internet access. Test your notebook with internet disabled before the deadline.