A guided portfolio of capstones, live demos, and production-minded AI engineering work across data science, machine learning, and deep learning.
Capstone Project
Capstone 9
Deep learning capstone page for bank churn modeling, staged outputs, and concept-driven neural network explanations.
Capstone 9 Scope
Capstone 9 converts the copied churn-prediction assignment into an executed TensorFlow ANN workflow with saved training history, confusion-matrix evidence, and sample-customer scoring.
Primary staged dataset: Churn_Modeling.csv.
Training history, prediction samples, and summary outputs are staged under outputs/.
Capstone 9 Infographic
This visual summary sits alongside the detailed walkthrough so the project can be understood quickly before drilling into the notebook, metrics, and exported artifacts.
Each walkthrough block maps the copied PDF requirements to the executed notebook cells, exported outputs, and reviewable evidence staged with this capstone.
9a
Prepare The Churn Dataset For ANN Training
Notebook section: Load, drop, encode, and split cells
Requirement: Drop personal-data columns, encode Geography and Gender, and split the dataset 80:20 with random_state 0.
The notebook removes RowNumber, CustomerId, and Surname, applies scaling plus one-hot encoding, and prepares the processed feature matrix for the ANN.
This TensorFlow Playground embed is a concept simulator for the ANN ideas behind the churn project. It does not load `Churn_Modeling.csv`; instead, it preloads small synthetic classification datasets and network settings so you can watch how hidden layers, activations, learning rate, and regularization change the learned decision boundary.
What This Is
The embedded lab is not the graded Session 9 model and does not use the bank churn dataset from the notebook.
What is preloaded depends on the preset button you click: each preset swaps in a synthetic dataset, activation, network shape, learning rate, train split, and noise setting.
The right-hand plot shows the model output over the 2D feature space, while the loss values at the top tell you whether training is improving.
How To Use It
Click any preset button above the embed to load that preconfigured scenario into the playground frame.
Press the Play button in the top-left corner of the playground to start training the network.
Watch the epoch counter, loss readout, and colored output panel update as the model learns.
Switch to another preset to compare how a different dataset or network design changes the training behavior.
What To Look For
Decision Boundary Basics: expect a smooth boundary forming around the center cluster as the tanh network converges.
Hidden Layers On Spiral Data: expect a harder problem that needs more epochs and more capacity to untangle the spiral arms.
ReLU On XOR: expect the network to learn a nonlinear separation that a simple linear separator cannot produce.
Regularization Under Noise: expect noisier points and a smoother boundary, which helps explain overfitting control.
Preset 1
Decision Boundary Basics
Preloads a circle-classification toy dataset with `x` and `y` inputs, a tanh network shaped `4,2`, learning rate `0.03`, zero noise, and 50% train split. Press Play to watch the network learn a nonlinear boundary around the center cluster, which is the same classification idea used by the churn ANN even though this demo uses synthetic 2D points instead of bank-customer rows.
Preloads the spiral dataset with a deeper `8,6,4` tanh network so you can see why extra hidden-layer capacity helps on more complex class boundaries. Use this to compare a simple ANN versus a deeper one and watch how training takes longer but can represent more complicated separation patterns.
Preloads the XOR dataset with a `6,3` ReLU network so you can compare activation choice and topology. Press Play and watch the network solve a pattern that a linear model cannot separate, which mirrors why hidden layers and nonlinear activations matter in ANN-based classification.
Preloads Gaussian classification data with 15% noise, visible test points, and regularization rate `0.001`. Press Play and compare how the learned boundary stays smoother under noisy data, which is useful for explaining generalization and overfitting risk in the churn project.
These four buttons are preset loaders, not dead tabs. Clicking one reloads the embedded playground with a different preconfigured dataset and network. The actual graded evidence for Session 9 still comes from the notebook, the training-history plot, the confusion matrix, and the exported churn-prediction outputs.
Colab Notebook
This section provides the notebook preview, launch link, and project file links.
The notebook opens in Google Colab when a launch URL is configured, and the project files and outputs remain available here on the site.
This notebook is generated from the copied Capstone_Session_9.pdf directions and the staged Churn_Modeling.csv dataset.
Cell 2 Markdown
Objective
Build the required artificial neural network for customer churn prediction, evaluate it on the held-out test set, and score the specified sample customer.
Cell 3 Code · python
from pathlib import Path
import json
import os
import sys
from urllib.parse import quote
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import tensorflow as tf
from IPython.display import display
from sklearn.compose import ColumnTransformer
from sklearn.metrics import accuracy_score, confusion_matrix
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import OneHotEncoder, StandardScaler
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
tf.keras.utils.set_random_seed(42)
IS_COLAB = 'google.colab' in sys.modules
GITHUB_REPO_OWNER = 'FrancisBurnet'
GITHUB_REPO_NAME = 'francisburnet'
GITHUB_REPO_BRANCH = 'main'
CAPSTONE_ROOT = Path('Incremental Capstones/Deep Learning Specialization/Capstone Session 9')
DATASET_FILENAME = 'Churn_Modeling.csv'
def build_raw_github_url(relative_path: Path) -> str:
encoded_path = quote(relative_path.as_posix(), safe='/')
return (
f"https://raw.githubusercontent.com/{GITHUB_REPO_OWNER}/{GITHUB_REPO_NAME}/"
f"{GITHUB_REPO_BRANCH}/{encoded_path}"
)
def resolve_capstone_dir() -> Path | None:
current = Path.cwd().resolve()
for candidate in [current, *current.parents]:
if candidate.name == CAPSTONE_ROOT.name and (candidate / DATASET_FILENAME).exists():
return candidate
nested_candidate = candidate / CAPSTONE_ROOT
if nested_candidate.exists():
return nested_candidate
return None
CAPSTONE_DIR = resolve_capstone_dir()
DATASET_URL = build_raw_github_url(CAPSTONE_ROOT / DATASET_FILENAME)
if CAPSTONE_DIR is not None:
OUTPUT_ROOT = CAPSTONE_DIR
OUTPUT_MODE = 'permanent capstone outputs'
else:
runtime_root = Path('/content/capstone-session-9-runtime') if IS_COLAB else Path.cwd().resolve() / 'capstone-session-9-runtime'
OUTPUT_ROOT = runtime_root
OUTPUT_MODE = 'runtime scratch outputs; export final artifacts back into the capstone outputs folder'
OUTPUTS_DIR = (OUTPUT_ROOT / 'outputs').resolve()
PLOTS_DIR = OUTPUTS_DIR / 'plots'
OUTPUTS_DIR.mkdir(parents=True, exist_ok=True)
PLOTS_DIR.mkdir(parents=True, exist_ok=True)
sns.set_theme(style='whitegrid')
pd.set_option('display.max_columns', 100)
print('Runtime:', 'Google Colab' if IS_COLAB else 'Local / notebook runtime')
print('Capstone directory:', CAPSTONE_DIR if CAPSTONE_DIR is not None else 'Not available in current runtime')
print('Dataset source:', DATASET_URL)
print('Output mode:', OUTPUT_MODE)
print('Outputs directory:', OUTPUTS_DIR)