Week 7 : Machine Learning Core Concepts (Days 37-43)
1. Introduction
Most ML curricula teach one idea per day: what supervised learning means, how to split data, which metric to trust. That works for concepts. It breaks down when you need to ship.
Software engineers rarely deploy “Day 42 in isolation.” They deploy pipelines: define the problem, prepare data, train, evaluate, persist artifacts, serve predictions. Without a system view, lessons feel disconnected and APIs multiply without purpose.
Week 7: Core Concepts of Introduction to Machine Learning (Days 37–43) addresses that gap. Seven daily lessons are integrated into a single repository with:
A core Python package (
week7_python) holding ported lesson logicA composition engine (
core_ml_engine) that wires lessons into product workflowsA FastAPI backend exposing two API surfaces: learning (per day) and product (composed lifecycle)
An optional React frontend that demonstrates the composed path—not seven separate dashboards
The goal is system-first learning: each concept stays teachable on its own, yet all of them participate in one sentiment-classification lifecycle you can run with a single HTTP call.
2. System Overview
The integrated project lives under week_7_aiml_integrated_project/. Runtime is intentionally minimal:
ProcessPortRoleFastAPI8000Learning + product APIsReact (Vite)3000Lifecycle UI (product APIs only)Legacy Flask/Streamlit5107–5109Optional reference UIs
Key components
Core package — packages/week7_python/src/week7_python/
Ported modules: day37_aiml_intro.py through day43_evaluation_metrics.py. Each module can still run as python -m week7_python.day38_ml_workflow for CLI-style lessons.
API layer — backend/app/
Thin FastAPI app: routing, schemas, request logging, JSON serialization. Business logic stays in the package, not in route handlers.
Composition engine — core_ml_engine/
Facades (concepts, workflow, splitting, metrics, …) plus pipeline.py for end-to-end orchestration. The engine imports day modules; day modules never import the engine.
Frontend (optional) — frontend/
Calls /api/v1/core-ml/* only. Per-day exploration is available via Swagger at /docs or direct learning routes.
Dual-layer API design
LayerPrefixPurposeLearning/api/v1/week7/dayNN/Faithful per-day endpoints for teachingProduct/api/v1/core-ml/Composed ML lifecycle and engine steps
This separation keeps pedagogy intact while giving product engineers one coherent workflow.
3. Architecture Diagram
5. Engine / Core System Design
core_ml_engine is the composition layer. It does not replace lesson code; it adapts it for HTTP-friendly dicts and orchestration.
Dependency rule
core_ml_engine → dayNN_* ✓
dayNN_* → core_ml_engine ✗Day modules remain runnable and testable without the engine. The backend imports week7_python only—never parent day37/ folders in the monorepo.
Folder structure
core_ml_engine/
concepts.py
workflow.py
paradigms.py
task_types.py
diagnostics.py
splitting.py
metrics.py
pipeline.py



