Skip to content

Python, Data Science & Machine Learning ​

Code-First Analytics & Applied ML Curriculum · Zero Prerequisites to Deployed Predictive Systems

A structured 14-week programme at Tech Minds Academy (Abuja & Live Online) taking complete beginners from their very first line of Python to querying relational databases in SQL, wrangling messy retail and fintech datasets with NumPy and Pandas, publishing interactive Plotly and Streamlit dashboards, training leak-free Scikit-Learn / XGBoost models, and serving live predictions behind FastAPI.

14Weeks
5Stages
65+Lessons
9Projects
0Prerequisites

Programme Overview ​

Core Topics: Modern Python 3.12+ & uv · SQL & Window Functions · NumPy & Pandas DataFrame Wrangling · Statistical EDA · Matplotlib, Seaborn & Plotly · Streamlit Dashboards · Scikit-Learn Pipelines & Gradient Boosting · FastAPI Model Serving & Capstone

StageFocusDurationLevelPrerequisite
Stage 1Python Programming Foundations3 weeks (Weeks 1–3)BeginnerNone
Stage 2Relational SQL & Data Wrangling with NumPy/Pandas3 weeks (Weeks 4–6)Beginner–IntermediateStage 1
Stage 3Exploratory Data Analysis (EDA) & Data Storytelling2 weeks (Weeks 7–8)IntermediateStage 2
Stage 4Machine Learning with Scikit-Learn & Gradient Boosting3 weeks (Weeks 9–11)Intermediate–AdvancedStage 3
Stage 5Model Deployment, Data Pipelines & Capstone3 weeks (Weeks 12–14)AdvancedStage 4

Curriculum Rationale — Key Decisions Explained ​

QuestionTech Minds Academy Pedagogical Decision
Why start with clean Python engineering first?Many learners jump straight into copying notebook snippets without understanding functions, dictionaries, virtual environments, or error handling — and hit a wall the moment real data breaks. Spending 3 focused weeks on idiomatic Python, uv, file I/O, and REST APIs ensures every student writes clean, reusable code rather than fragile one-cell scripts.
Why teach SQL alongside Pandas?In real companies — banks, telecoms, logistics startups, and government agencies — data does not arrive as a tidy Kaggle CSV on your desktop. It lives in relational PostgreSQL, MySQL, or warehouse tables. Data analysts and ML engineers who combine window-function SQL queries with vectorised Pandas pipelines pass technical interviews effortlessly.
Why focus on interpretable tabular ML & leak-free Pipelines?Over 85% of commercial machine learning value in fintech, retail, energy, and healthcare comes from structured tabular problems (churn, credit risk, demand forecasting, pricing, fraud). Mastering Scikit-Learn ColumnTransformer pipelines, gradient boosted trees, business-aligned metrics (Precision/Recall/ROC-AUC), and preventing data leakage makes you immediately productive on the job.
Why require FastAPI & Streamlit deployment?A model trapped inside a local .ipynb file delivers zero business impact. Stage 5 trains you to serialise verified pipelines with joblib, expose validated prediction endpoints via FastAPI, build an interactive Streamlit decision app for non-technical executives, and publish a transparent Model Card.

Stage 01 · Python Programming Foundations ​

Duration: 3 Weeks (Weeks 1–3) · Level: Beginner · Prerequisite: None
Writing clean, modular Python 3.12+ code for automation, file processing, and live API ingestion.

Stage 1 builds rock-solid programming fluency from zero: reproducible virtual environments with uv, interactive exploration in JupyterLab alongside modular .py scripts in VS Code, core data structures, and resilient API clients.

Week 1: Python Setup, Variables, Control Flow & Functions (6 Lessons · 5 Hours) ​

  1. 01 — Modern Python workspace setup (uv, Python 3.12+, VS Code & JupyterLab): Managing isolated virtual environments (uv venv, uv pip) without dependency conflicts (see Dev Environment Setup).
  2. 02 — Variables, primitive types & string formatting: Working with int, float, bool, str, f-strings, and numeric formatting (f"₦{amount:,.2f}").
  3. 03 — Conditional logic & boolean expressions: Writing readable if / elif / else decision trees, comparison operators, and truthiness checks.
  4. 04 — Iteration with for and while loops: Using range(), enumerate(), zip(), break, and continue cleanly without off-by-one bugs.
  5. 05 — Reusable functions, type hints & docstrings: Designing single-responsibility functions with positional/keyword arguments, default values, and Python type annotations (def compute_vat(amount: float) -> float:).
  6. 06 — Debugging mindset — reading Python tracebacks: Diagnosing TypeError, ValueError, NameError, and IndexError systematically from the bottom frame up.

IMPORTANT

Week 1 Project — Personal & SME Expense CLI Tracker: Build an interactive command-line Naira expense tracker with modular functions that categorises spending, calculates monthly totals and 7.5% VAT summaries, flags budget overruns, and prints formatted summary tables.

Week 2: Data Structures, Comprehensions & File I/O (6 Lessons · 5 Hours) ​

  1. 01 — Lists & tuples: Indexing, slicing, sorting with custom key functions, mutability vs immutability, and tuple unpacking.
  2. 02 — Dictionaries & sets: Fast O(1) lookups, .get() defaults, nested record aggregation, and deduplicating IDs with set operations.
  3. 03 — Pythonic comprehensions: Writing concise list, dictionary, and set comprehensions — and knowing when an explicit loop is clearer.
  4. 04 — Working with paths & text/CSV files (pathlib & csv): Using cross-platform pathlib.Path, with open(...) context managers, csv.DictReader, and csv.DictWriter.
  5. 05 — String cleaning & regular expressions basics (re): Stripping whitespace, normalising Nigerian phone numbers (+234...), and standardising inconsistent category labels.
  6. 06 — Organising multi-file Python packages & Git: Splitting logic across cleaners.py, validators.py, and main.py and committing cleanly to GitHub.

Idiomatic Python Example — Standardising Messy Sales CSV Rows ​

python
from pathlib import Path
import csv
import re

PHONE_PATTERN = re.compile(r"^(?:\+?234|0)([789][01]\d{8})$")


def normalise_ng_phone(raw_phone: str) -> str | None:
    """Convert local phone strings like '0803 123 4567' to '+2348031234567'."""
    digits = re.sub(r"[\s\-()]", "", raw_phone.strip())
    match = PHONE_PATTERN.match(digits)
    return f"+234{match.group(1)}" if match else None


def clean_customer_csv(input_path: Path, output_path: Path) -> dict[str, int]:
    stats = {"processed": 0, "valid": 0, "invalid_phone": 0}
    cleaned_rows: list[dict[str, str | float]] = []

    with input_path.open(mode="r", encoding="utf-8-sig", newline="") as infile:
        reader = csv.DictReader(infile)
        for row in reader:
            stats["processed"] += 1
            phone = normalise_ng_phone(row.get("phone", ""))
            if not phone:
                stats["invalid_phone"] += 1
                continue

            amount_str = row.get("amount_ngn", "0").replace(",", "").replace("₦", "").strip()
            cleaned_rows.append(
                {
                    "customer_name": row.get("customer_name", "").strip().title(),
                    "phone": phone,
                    "city": row.get("city", "Unknown").strip().title(),
                    "amount_ngn": round(float(amount_str or 0), 2),
                }
            )
            stats["valid"] += 1

    if cleaned_rows:
        with output_path.open(mode="w", encoding="utf-8", newline="") as outfile:
            writer = csv.DictWriter(outfile, fieldnames=list(cleaned_rows[0].keys()))
            writer.writeheader()
            writer.writerows(cleaned_rows)

    return stats

IMPORTANT

Week 2 Project — Automated CSV Data Cleaner: Write a reusable Python script that ingests a messy 1,000-row merchant CSV (duplicate rows, broken phone numbers, mixed currency symbols, missing fields), outputs a clean standardised CSV, and writes an audit report of rejected records.

Week 3: JSON, REST APIs (requests), Error Handling & Testing (6 Lessons · 5 Hours) ​

  1. 01 — Serialising and parsing nested JSON (json): Navigating deeply nested dictionaries and arrays returned by modern web services.
  2. 02 — Fetching live data from REST APIs (requests / httpx): Query parameters, custom headers, timeouts, pagination loops, and environment-variable API keys (python-dotenv).
  3. 03 — Defensive error handling (try / except / else / finally): Raising informative custom exceptions, handling network timeouts gracefully, and avoiding bare except: anti-patterns.
  4. 04 — Dataclasses & structured validation (dataclasses / pydantic intro): Representing domain records cleanly with typed attributes.
  5. 05 — Logging vs print() (logging): Writing timestamped info, warning, and error logs for unattended data collection scripts.
  6. 06 — Writing unit tests with pytest: Testing edge cases on data transformation functions automatically.

IMPORTANT

Week 3 Project — Live Weather & FX Market Data Collector: Build a resilient pytest-tested Python collector that fetches live Abuja/Lagos weather metrics and currency exchange rates from public REST APIs, handles network errors with retries, and appends clean daily snapshots to local JSON/CSV storage.


Stage 02 · Relational SQL & Data Wrangling with NumPy/Pandas ​

Duration: 3 Weeks (Weeks 4–6) · Level: Beginner–Intermediate · Prerequisite: Stage 1
Extracting truth from relational databases with SQL and transforming tabular datasets at scale with NumPy and Pandas.

Week 4: Relational Databases & Analytical SQL (PostgreSQL & SQLite) (6 Lessons · 6 Hours) ​

  1. 01 — Relational data modelling fundamentals: Tables, primary keys, foreign keys, normalisation, and entity-relationship diagrams across customers, orders, order_items, and payments.
  2. 02 — Core querying (SELECT, WHERE, ORDER BY, LIMIT, CASE WHEN): Filtering, null-safe comparisons (IS NULL, COALESCE), and conditional bucketing.
  3. 03 — Aggregations (GROUP BY, HAVING, COUNT, SUM, AVG): Answering revenue, retention, and cohort questions without pulling raw millions of rows into memory.
  4. 04 — Multi-table joins (INNER, LEFT, FULL OUTER) & CTEs (WITH): Writing clean, readable Common Table Expressions instead of deeply nested subqueries.
  5. 05 — Analytical Window Functions (OVER, PARTITION BY, ROW_NUMBER, LAG, SUM() OVER): Computing month-over-month revenue growth, rolling 7-day averages, and top-3 products per region in pure SQL.
  6. 06 — Connecting Python to SQL (sqlite3 & SQLAlchemy + Pandas read_sql): Executing parameterised queries safely (preventing SQL injection) and loading query results directly into Pandas.

Analytical SQL Example — Monthly Merchant Growth & Regional Ranking ​

sql
WITH monthly_branch_revenue AS (
    SELECT
        b.region,
        b.branch_name,
        DATE_TRUNC('month', o.created_at)::DATE AS sales_month,
        COUNT(DISTINCT o.order_id)              AS total_orders,
        SUM(o.total_amount_ngn)                 AS revenue_ngn
    FROM orders AS o
    INNER JOIN branches AS b
        ON o.branch_id = b.branch_id
    WHERE o.payment_status = 'PAID'
    GROUP BY b.region, b.branch_name, DATE_TRUNC('month', o.created_at)::DATE
)
SELECT
    region,
    branch_name,
    sales_month,
    total_orders,
    revenue_ngn,
    LAG(revenue_ngn) OVER (
        PARTITION BY branch_name
        ORDER BY sales_month
    ) AS prev_month_revenue_ngn,
    ROUND(
        100.0 * (revenue_ngn - LAG(revenue_ngn) OVER (PARTITION BY branch_name ORDER BY sales_month))
        / NULLIF(LAG(revenue_ngn) OVER (PARTITION BY branch_name ORDER BY sales_month), 0),
        2
    ) AS mom_growth_pct,
    DENSE_RANK() OVER (
        PARTITION BY sales_month, region
        ORDER BY revenue_ngn DESC
    ) AS regional_rank
FROM monthly_branch_revenue
ORDER BY sales_month DESC, region, regional_rank;

IMPORTANT

Week 4 Project — Retail & Fintech SQL Analytics Pack: Query a multi-table SQLite/PostgreSQL commerce database using 12 analytical queries (joins, CTEs, cohort retention, and window functions) to answer an executive business brief.

Week 5: Vectorised Numerical Computing with NumPy & Pandas Core (6 Lessons · 5 Hours) ​

  1. 01 — Why Python loops are slow on 1M rows — NumPy ndarray architecture: Contiguous C-backed memory, data types (float64, int32), shapes, and 50x–100x vectorisation speedups.
  2. 02 — Indexing, boolean masking & broadcasting in NumPy: Filtering arrays without loops, np.where(), linear algebra basics, and random number generators (np.random.default_rng).
  3. 03 — Pandas Series and DataFrame foundations: Inspecting schemas (.info(), .describe(), dtypes), memory optimisation, and reading CSV, Excel, Parquet, and SQL sources.
  4. 04 — Label vs positional selection (.loc[] vs .iloc[]) & .query(): Writing explicit, chain-safe filters without triggering SettingWithCopyWarning.
  5. 05 — Vectorised column creation & .assign() method chaining: Building clean, functional data transformation pipelines in Pandas 2+.
  6. 06 — String (.str) and categorical (.cat) accessors: Fast vectorised text extraction and memory-efficient categorical encoding.

Week 6: Advanced Pandas Wrangling, Merges & Time-Series Analysis (6 Lessons · 6 Hours) ​

  1. 01 — Diagnosing and handling missing data: Distinguishing MCAR/MAR/MNAR missingness; choosing wisely between .dropna(), group-median imputation, and forward-fill (ffill).
  2. 02 — Detecting and treating outliers & duplicates: IQR rules, z-scores, domain sanity bounds, and deduplicating event logs by timestamp.
  3. 03 — Relational merges (.merge()), concatenations & validation: Using validate='many_to_one' and indicator flags to catch accidental row-multiplying join bugs.
  4. 04 — Split-Apply-Combine (groupby, .agg(), pivot_table, melt): Reshaping wide spreadsheet reports into tidy long-format analytical tables.
  5. 05 — Datetime indexing, resampling & rolling windows: Parsing messy timezones, .resample('W'), .rolling(7).mean(), and seasonality patterns on daily transaction logs.
  6. 06 — Exporting clean Parquet/Excel workbooks & reproducible pipelines: Saving typed Parquet datasets that preserve schemas for Stage 3 and Stage 4.

Idiomatic Pandas 2+ Method-Chaining Example ​

python
import pandas as pd


def build_weekly_fintech_summary(transactions_df: pd.DataFrame) -> pd.DataFrame:
    """Transform raw POS/transfer logs into weekly regional KPIs."""
    return (
        transactions_df.assign(
            tx_timestamp=lambda df: pd.to_datetime(df["tx_timestamp"], errors="coerce"),
            amount_ngn=lambda df: pd.to_numeric(df["amount_ngn"], errors="coerce"),
            fee_ngn=lambda df: (df["amount_ngn"] * 0.015).clip(upper=2000.0),
        )
        .dropna(subset=["tx_timestamp", "amount_ngn", "state"])
        .query("status == 'SUCCESS' and amount_ngn > 0")
        .set_index("tx_timestamp")
        .groupby(["state", pd.Grouper(freq="W-MON")])
        .agg(
            tx_count=("tx_id", "count"),
            unique_merchants=("merchant_id", "nunique"),
            gross_volume_ngn=("amount_ngn", "sum"),
            median_ticket_ngn=("amount_ngn", "median"),
            platform_fee_ngn=("fee_ngn", "sum"),
        )
        .reset_index()
        .sort_values(["tx_timestamp", "gross_volume_ngn"], ascending=[True, False])
    )

IMPORTANT

Weeks 5–6 Milestone Project — Nigerian Fintech Transaction Wrangling Pipeline: Clean, merge, and analyse a messy 100,000-row multi-table POS & bank-transfer dataset (missing merchant regions, duplicate retries, timezone shifts), producing tidy Parquet outputs and a time-series cohort performance report.


Stage 03 · Exploratory Data Analysis (EDA) & Data Storytelling ​

Duration: 2 Weeks (Weeks 7–8) · Level: Intermediate · Prerequisite: Stage 2
Statistical thinking, publication-grade visualisations, and interactive executive apps in Streamlit.

Week 7: Statistical EDA, Distributions, Matplotlib & Seaborn (6 Lessons · 5 Hours) ​

  1. 01 — Descriptive statistics that don't lie: Why skewed income, real-estate, and transaction data demand medians and percentiles (p50, p90, p99) alongside means and standard deviations.
  2. 02 — Probability distributions, skewness & log transformations: Visualising histograms, KDEs, boxplots, and violin plots to uncover multi-modal customer segments.
  3. 03 — Correlation vs causation & Simpson's Paradox: Computing Pearson and Spearman correlation matrices, spotting confounding variables, and avoiding misleading claims.
  4. 04 — Hypothesis testing & A/B test intuition (scipy.stats): Understanding p-values, confidence intervals, Mann-Whitney U / t-tests, and sample-size pitfalls in plain business language.
  5. 05 — Publication-quality static charts with Matplotlib & Seaborn: Controlling figure hierarchy, annotations, accessible colourblind-safe palettes, and zero-clutter formatting.
  6. 06 — Structuring a compelling EDA notebook: Organising notebooks around explicit business hypotheses, visual evidence, and quantified recommendations.

IMPORTANT

Week 7 Project — Deep-Dive Exploratory Data Analysis Report: Conduct a rigorous statistical EDA on a retail, telecom churn, or housing dataset — delivering annotated Seaborn/Matplotlib figures and an executive memo of 5 actionable findings.

Week 8: Interactive Visualisation with Plotly & Executive Streamlit Dashboards (6 Lessons · 6 Hours) ​

  1. 01 — Interactive visual analytics with plotly.express & graph_objects: Hover tooltips, zoomable time-series, funnel charts, treemaps, and geographic choropleths.
  2. 02 — Data storytelling principles: Choosing the right chart for comparison, composition, distribution, and relationship — and writing action-oriented chart titles.
  3. 03 — Rapid analytical web apps with Streamlit: Layouts (st.columns, st.tabs, st.sidebar), interactive date/region filters, KPI metric cards (st.metric), and data caching (@st.cache_data).
  4. 04 — Designing executive-ready KPI definitions: Defining North Star metrics, churn rates, ARPU, and unit economics unambiguously (connecting well with Digital Marketing & SEO).
  5. 05 — Exporting stakeholder deliverables: Downloading filtered CSV/Excel views directly from your Streamlit dashboard.
  6. 06 — Deploying Streamlit apps to Streamlit Community Cloud / Render: Sharing a live public portfolio link from your GitHub repository.

IMPORTANT

Week 8 Project — Deployed Interactive Streamlit KPI Dashboard: Build and deploy a live multi-tab Streamlit + Plotly business intelligence dashboard allowing stakeholders to filter revenue, retention, product mix, and regional performance dynamically.


Stage 04 · Machine Learning with Scikit-Learn & Gradient Boosting ​

Duration: 3 Weeks (Weeks 9–11) · Level: Intermediate–Advanced · Prerequisite: Stage 3
Building leak-free, interpretable, and high-performing predictive models on real tabular data.

Week 9: ML Foundations, Feature Engineering & Leak-Free Pipelines (6 Lessons · 6 Hours) ​

  1. 01 — Framing business problems as Machine Learning tasks: Distinguishing supervised regression, binary/multiclass classification, time-series forecasting, and unsupervised clustering — plus knowing when a simple SQL rule beats ML.
  2. 02 — Train / Validation / Test splits & Cross-Validation: Stratified splits (StratifiedKFold), temporal splits for time-ordered data, and why testing on training data creates useless overfitted models.
  3. 03 — Preventing Data Leakage (the #1 rookie ML mistake): Identifying target leakage and preprocessing leakage — ensuring scalers and imputers fit strictly on training folds.
  4. 04 — Scikit-Learn Pipeline & ColumnTransformer: Combining numeric imputation/scaling (StandardScaler, Median) and categorical encoding (OneHotEncoder, TargetEncoder) into one atomic object.
  5. 05 — Regression algorithms — Linear, Ridge/Lasso & Random Forest Regressors: Understanding bias-variance trade-offs, L1/L2 regularisation, and non-linear tree ensembles.
  6. 06 — Evaluating regression models (MAE, RMSE, R², residual plots): Translating Mean Absolute Error directly into Naira pricing error for business stakeholders.

Week 10: Classification, Imbalanced Data & Gradient Boosting (XGBoost / LightGBM) (6 Lessons · 6 Hours) ​

  1. 01 — Binary & multiclass classification (LogisticRegression baseline to ensembles): Predicting calibrated probabilities (predict_proba) rather than blind hard labels.
  2. 02 — Beyond accuracy — Confusion Matrix, Precision, Recall, F1 & ROC-AUC: Why a 98% accurate fraud model can still miss 100% of fraud on imbalanced datasets.
  3. 03 — Decision threshold tuning for business ROI: Choosing probability cutoffs based on the real Naira cost of False Positives vs False Negatives.
  4. 04 — Gradient Boosted Decision Trees (HistGradientBoosting, XGBoost, LightGBM): How sequential residual-learning trees dominate tabular benchmarks.
  5. 05 — Handling class imbalance properly: Class weights (scale_pos_weight, class_weight='balanced'), Precision-Recall AUC, and probability calibration.
  6. 06 — Hyperparameter tuning (RandomizedSearchCV / Optuna) & experiment tracking: Tuning learning rate, max depth, and regularisation systematically without overfitting the validation set.

Idiomatic Scikit-Learn Pipeline + ColumnTransformer Example ​

python
import pandas as pd
from sklearn.compose import ColumnTransformer
from sklearn.ensemble import HistGradientBoostingClassifier
from sklearn.impute import SimpleImputer
from sklearn.metrics import classification_report, roc_auc_score
from sklearn.model_selection import StratifiedKFold, cross_val_score, train_test_split
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import OneHotEncoder, StandardScaler


def train_churn_pipeline(df: pd.DataFrame, target_col: str = "churned") -> Pipeline:
    X = df.drop(columns=[target_col, "customer_id"], errors="ignore")
    y = df[target_col].astype(int)

    numeric_cols = X.select_dtypes(include=["number"]).columns.tolist()
    categorical_cols = X.select_dtypes(include=["object", "category"]).columns.tolist()

    X_train, X_test, y_train, y_test = train_test_split(
        X, y, test_size=0.2, stratify=y, random_state=42
    )

    preprocessor = ColumnTransformer(
        transformers=[
            (
                "num",
                Pipeline(
                    [
                        ("imputer", SimpleImputer(strategy="median")),
                        ("scaler", StandardScaler()),
                    ]
                ),
                numeric_cols,
            ),
            (
                "cat",
                Pipeline(
                    [
                        ("imputer", SimpleImputer(strategy="most_frequent")),
                        ("ohe", OneHotEncoder(handle_unknown="ignore", sparse_output=False)),
                    ]
                ),
                categorical_cols,
            ),
        ]
    )

    clf_pipeline = Pipeline(
        steps=[
            ("prep", preprocessor),
            (
                "model",
                HistGradientBoostingClassifier(
                    learning_rate=0.05,
                    max_depth=6,
                    class_weight="balanced",
                    random_state=42,
                ),
            ),
        ]
    )

    cv = StratifiedKFold(n_splits=5, shuffle=True, random_state=42)
    cv_auc = cross_val_score(clf_pipeline, X_train, y_train, cv=cv, scoring="roc_auc")
    print(f"5-Fold CV ROC-AUC: {cv_auc.mean():.4f} ± {cv_auc.std():.4f}")

    clf_pipeline.fit(X_train, y_train)
    test_probs = clf_pipeline.predict_proba(X_test)[:, 1]
    print(f"Holdout Test ROC-AUC: {roc_auc_score(y_test, test_probs):.4f}")
    print(classification_report(y_test, (test_probs >= 0.45).astype(int)))

    return clf_pipeline

IMPORTANT

Weeks 9–10 Milestone Project — Leak-Free Credit Risk or Churn Prediction Engine: Engineer domain features, compare a regularised Logistic Regression baseline against a tuned Gradient Boosting Pipeline, calibrate probability thresholds against a business cost matrix, and achieve documented holdout ROC-AUC / PR-AUC targets.

Week 11: Model Explainability (SHAP), Unsupervised Clustering & Segmentation (6 Lessons · 5 Hours) ​

  1. 01 — Explaining black-box predictions — permutation importance & SHAP: Generating global feature importance and individual local waterfall explanations ("Why did this specific loan applicant receive a high-risk score?").
  2. 02 — Auditing fairness, subgroup slices & error analysis: Inspecting model error rates across regions, device types, and customer tiers to catch systematic blind spots.
  3. 03 — Unsupervised learning — KMeans & hierarchical clustering: Scaling features, using the Elbow & Silhouette diagnostics, and profiling behavioural customer segments (RFM: Recency, Frequency, Monetary value).
  4. 04 — Dimensionality reduction (PCA & UMAP intuition): Visualising high-dimensional feature spaces and embeddings in 2D.
  5. 05 — Anomaly & outlier detection (IsolationForest): Flagging unusual POS transactions or sensor readings when labelled fraud examples are scarce.
  6. 06 — Choosing interpretable models vs deep learning: Understanding why gradient boosting excels on tabular data while neural networks/LLMs shine on unstructured text, audio, and vision.

IMPORTANT

Week 11 Project — RFM Customer Segmentation & SHAP Explainability Brief: Segment an e-commerce customer base into actionable behavioural clusters using KMeans + RFM features, and attach SHAP reason-code explanations to your classification pipeline.


Stage 05 · Model Deployment, Data Pipelines & Capstone ​

Duration: 3 Weeks (Weeks 12–14) · Level: Advanced · Prerequisite: Stage 4
Taking machine learning out of notebooks into tested REST APIs, interactive decision apps, and production documentation.

Week 12: Model Serialisation (joblib), FastAPI Serving & Input Validation (6 Lessons · 6 Hours) ​

  1. 01 — Packaging end-to-end Scikit-Learn Pipelines (joblib & metadata): Saving preprocessing + model + version metadata together so inference never suffers training-serving skew.
  2. 02 — Building a typed ML prediction API with FastAPI & Pydantic: Defining strict request/response schemas, automatic OpenAPI (/docs) Swagger UI, and HTTP 422 validation on malformed inputs.
  3. 03 — Health checks, prediction logging & input drift awareness: Recording prediction distributions and spotting when live inputs drift outside training bounds.
  4. 04 — Testing ML endpoints with pytest & TestClient: Writing automated API tests verifying latency, valid probability bounds (0.0 to 1.0), and edge-case handling.
  5. 05 — Connecting a Streamlit frontend to your FastAPI service: Building a clean "What-If" scenario simulator for business teams.
  6. 06 — Containerising Python ML services with Docker: Writing slim Dockerfiles with pinned uv.lock / requirements.txt for cloud deployment (bridging into Cloud Computing & DevOps).

Clean FastAPI Model-Serving Endpoint Example ​

python
from pathlib import Path
from typing import Literal
import joblib
import pandas as pd
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel, Field

MODEL_PATH = Path("artifacts/churn_pipeline_v1.joblib")

app = FastAPI(
    title="Tech Minds Customer Churn Scoring API",
    version="1.0.0",
)

pipeline = joblib.load(MODEL_PATH) if MODEL_PATH.exists() else None


class CustomerFeatures(BaseModel):
    tenure_months: int = Field(..., ge=0, le=240)
    monthly_spend_ngn: float = Field(..., ge=0)
    support_tickets_90d: int = Field(default=0, ge=0)
    payment_method: Literal["bank_transfer", "card", "ussd", "wallet"]
    state: str = Field(..., min_length=2)


class ChurnPrediction(BaseModel):
    churn_probability: float
    risk_tier: Literal["LOW", "MEDIUM", "HIGH"]
    recommended_action: str


@app.post("/v1/predict-churn", response_model=ChurnPrediction)
def predict_churn(payload: CustomerFeatures) -> ChurnPrediction:
    if pipeline is None:
        raise HTTPException(status_code=503, detail="Model artifact not loaded.")

    input_df = pd.DataFrame([payload.model_dump()])
    prob = float(pipeline.predict_proba(input_df)[0, 1])

    if prob >= 0.65:
        tier, action = "HIGH", "Trigger immediate retention call & loyalty fee waiver"
    elif prob >= 0.35:
        tier, action = "MEDIUM", "Enrol in automated WhatsApp/email check-in sequence"
    else:
        tier, action = "LOW", "No intervention needed"

    return ChurnPrediction(
        churn_probability=round(prob, 4),
        risk_tier=tier,
        recommended_action=action,
    )

IMPORTANT

Week 12 Project — FastAPI Model Microservice + Streamlit Simulator: Serialise your trained Scikit-Learn Pipeline, expose a Pydantic-validated /v1/predict FastAPI endpoint with pytest tests, and connect an interactive Streamlit simulation interface.

Week 13: Automated Data Pipelines, Model Cards & Responsible AI (6 Lessons · 5 Hours) ​

  1. 01 — Designing scheduled batch scoring & ETL scripts: Structuring idempotent daily Python pipelines (Extract → Validate → Transform → Score → Write to DB).
  2. 02 — Data quality assertions before training & inference: Verifying row counts, null ratios, schema types, and value ranges automatically so corrupt upstream CSVs never poison predictions.
  3. 03 — Authoring transparent Model Cards: Documenting intended use, out-of-scope uses, training dataset provenance, evaluation metrics across subgroups, and ethical limitations.
  4. 04 — Data privacy & Nigeria Data Protection Act (NDPA) compliance: Hashing/anonymising PII (BVN, NIN, phone numbers, emails) before analytics and model training.
  5. 05 — Structuring a recruiter-grade Data Science GitHub portfolio: Replacing messy Untitled14_final_v2.ipynb files with clean src/, notebooks/, tests/, artifacts/, and visual README.md case studies.
  6. 06 — Capstone dataset auditing & problem formulation clinic: Mentor review of your chosen Week 14 capstone dataset, leakage audit, and baseline metric targets.

Week 14: End-to-End Data Science Capstone (6 Sessions · 10 Hours) ​

  1. 01 — Business problem & KPI definition: Translating an operational problem into measurable analytical and predictive metrics.
  2. 02 — SQL / Python data ingestion & cleaning pipeline: Producing reproducible, validated Parquet tables from raw data.
  3. 03 — Statistical EDA & interactive visual insights: Uncovering key drivers and domain patterns.
  4. 04 — Leak-free ML Pipeline training, tuning & SHAP explainability: Comparing baseline vs ensemble models with business-cost threshold selection.
  5. 05 — FastAPI + Streamlit cloud deployment: Publishing a live interactive application anyone can test in a browser.
  6. 06 — Model Card documentation & live executive presentation: Presenting both technical rigour and clear business ROI to the Tech Minds review panel.

IMPORTANT

Week 14 End-to-End Data Science Capstone: Deliver a complete, deployed data product (clean Python repo + SQL/Pandas pipeline + EDA dashboard + Scikit-Learn/XGBoost model + FastAPI/Streamlit app + Model Card). Popular capstone tracks include:

  1. Telecom / Fintech Customer Churn Predictor & Retention Simulator
  2. Abuja & Lagos Residential Real Estate Price Estimator (location, amenities, power/infrastructure features + error bounds)
  3. SME Micro-Loan Default Risk Scorer (calibrated probabilities + SHAP reason codes + threshold cost analysis)
  4. Retail Inventory Demand Forecaster (time-series lag features + stockout risk dashboard)

Assessment & Completion ​

ComponentDescriptionWeight
Weekly & Milestone Projects (×9)Python CLI & CSV cleaner, live API collector, SQL query pack, Pandas fintech pipeline, EDA study, Streamlit dashboard, ML pipeline, segmentation brief, and FastAPI service40%
Stage Assessments (×5)Live hands-on Python, SQL, Pandas, and Scikit-Learn debugging & modelling assessments at the close of each stage30%
End-to-End Data Science CapstoneReproducible data pipeline + validated ML model + deployed FastAPI/Streamlit app + Model Card & live defence30%

Learning Outcomes — What You Can Do on Completion ​

On graduating from Python, Data Science & Machine Learning, you will be able to:

  • Write clean, modular, type-annotated Python 3.12+ code with uv virtual environments, pytest tests, file I/O, and live REST API clients.
  • Query multi-table relational databases using SQL joins, CTEs, aggregations, and analytical window functions (LAG, DENSE_RANK, rolling totals).
  • Clean, merge, reshape, and analyse 100,000+ row datasets efficiently using vectorised NumPy and Pandas pipelines.
  • Conduct rigorous Exploratory Data Analysis (EDA) and communicate insights visually with Matplotlib, Seaborn, and interactive Plotly charts.
  • Build and deploy interactive business intelligence dashboards and decision tools using Streamlit.
  • Train, cross-validate, tune, and explain leak-free Scikit-Learn and Gradient Boosting models for regression, classification, and KMeans customer segmentation.
  • Interpret model behaviour using SHAP values, Precision/Recall trade-offs, ROC-AUC, and business cost matrices.
  • Package trained pipelines with joblib, serve validated predictions via FastAPI, and publish transparent Model Cards.

Tools & Resources — Everything You Need ​

Tool / LibraryPurpose in the CurriculumCost Tier
Python 3.12+ & uvCore programming language and fast reproducible virtual-environment managerFree / Open Source
VS Code & JupyterLabScript/API engineering and interactive exploratory notebooksFree / Open Source
PostgreSQL & SQLiteRelational SQL querying, joins, CTEs, and window functionsFree / Open Source
NumPy & Pandas 2+Vectorised numerical computing, tabular data wrangling, and time-series analysisFree / Open Source
Matplotlib, Seaborn & PlotlyStatic statistical figures and interactive browser visualisationsFree / Open Source
Scikit-Learn, XGBoost & shapLeak-free ML pipelines, gradient boosted trees, clustering, and explainabilityFree / Open Source
FastAPI, Pydantic & joblibModel serialisation and production REST prediction APIsFree / Open Source
StreamlitInteractive KPI dashboards and ML simulation web appsFree / Community Cloud

Next Steps in Your Tech Minds Pathway ​

G5 Plaza (Before AEDC Office, Sabon-Gari Road), Bwari, Abuja, Nigeria · info@techmindsacademy.org · (+234) 814 732 8332