Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,336 changes: 861 additions & 475 deletions 02_end_to_end_machine_learning_project.ipynb

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions INSTRUCTIONS.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#+TITLE: Hands-on Machine Learning 3rd Edition - Setup Instructions
#+AUTHOR: Development Environment
#+DATE: 2026-01-19

* Overview

This guide will help you set up the development environment for the Hands-on Machine Learning 3rd Edition notebooks using Nix.

* Prerequisites

- Nix with flakes enabled

* Setup Steps

** 1. Enter the Nix Development Environment

Navigate to the handson-ml3 directory and enter the Nix shell:

#+begin_src bash
cd handson-ml3
nix develop
#+end_src

The flake will automatically:
- Provide Python 3.10
- Install micromamba (conda alternative)
- Create the homl3 environment from =environment.yml= (first time only)
- Activate the homl3 environment

** 2. Install IPython Kernel (First Time Only)

#+begin_src bash
python -m ipykernel install --user --name=python3
#+end_src

** 3. Start Jupyter Notebook

#+begin_src bash
jupyter notebook
#+end_src

* That's it!

The Jupyter notebook server will open in your default browser and you can start working with the notebooks.
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
description = "Hands-on Machine Learning 3rd Edition - Development Environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.python310
pkgs.micromamba
];

shellHook = ''
echo "===================================================="
echo "Hands-on Machine Learning 3rd Edition Environment"
echo "===================================================="
echo ""

# Set up micromamba
export MAMBA_ROOT_PREFIX="$HOME/.micromamba"
eval "$(micromamba shell hook --shell bash)"

# Check if homl3 environment exists
if ! micromamba env list | grep -q "homl3"; then
echo "Creating homl3 environment from environment.yml..."
micromamba env create -f environment.yml -y
echo "Environment created successfully!"
echo ""
else
echo "homl3 environment already exists."
echo ""
fi

# Activate the environment
echo "Activating homl3 environment..."
micromamba activate homl3

# Install IPython kernel if not already installed
if ! jupyter kernelspec list | grep -q "python3"; then
echo ""
echo "Installing IPython kernel..."
python -m ipykernel install --user --name=python3
echo "IPython kernel installed!"
fi

echo ""
echo "===================================================="
echo "Environment activated!"
echo "Python version: $(python --version)"
echo ""
echo "Ready to start Jupyter:"
echo " jupyter notebook"
echo "===================================================="
'';
};
}
);
}