Skip to main content
Software Engineering for Machine Learning

Software Engineering for Machine Learning — Foundation and Overview

Published: 2026-07-26
Level: postgraduate
Audience: Postgraduate students in Software Engineering for Machine Learning

Software Engineering for Machine Learning — Foundation and Overview

1.1 Course Structure and Pedagogical Foundation

1.1.1 Course Overview and Scale

Software Engineering for Machine Learning (SEML) establishes a systematic framework for bridging traditional software development practices with data-driven artificial intelligence pipelines. Over the past five decades, software engineering has established rigorous principles, architectural patterns, and testing methodologies to construct deterministic software—systems where explicit, hand-written algorithms map discrete inputs to predictable outputs.

In contrast, machine learning introduces non-deterministic, exploratory workflows. Rather than hard-coding business logic, an ML system learns probabilistic rules from statistical patterns in data. Consequently, software engineering for ML extends beyond writing clean code to managing changing data distributions, model drift, reproducible training pipelines, and continuous integration/continuous deployment (CI/CD) for probabilistic assets.

Hook & Intuition: Think of traditional software engineering as building a clockwork watch—every gear (line of code) is handcrafted and strictly deterministic. Machine learning engineering is more like running a high-tech farm—you design the greenhouse infrastructure (data pipelines, compute, orchestration), but the crop (the model) grows dynamically based on the soil quality (training data) and weather conditions (data drift).

The course operates at a massive scale, accommodating an unprecedented enrollment of 750 participants. To ensure seamless learning across diverse locations and backgrounds, all core instructional materials are designed to be entirely self-contained within the lecture presentation decks. Students do not need to assemble fragmented documentation across disparate sources to prepare for assessments, as all primary theoretical foundations, system architectures, and evaluation criteria are embedded directly into the primary slides.

Core Paradigm Shift (SE vs. SEML):

  • Traditional Software Engineering (SE): Input Data + Handcrafted Code -> Deterministic Output
  • Software Engineering for ML (SEML): Input Data + Target Labels -> Machine Learning Pipeline -> Learned Model, followed by Inference Data + Learned Model -> Stochastic Predictions.

1.1.2 Assessment Scheme and Examination Structure

The evaluation structure is organized into three distinct components (EC1, EC2, EC3) designed to evaluate theoretical comprehension, architectural system design, and practical deployment skills:

Assessment Weightage & Component Breakdown:

  • Evaluation Component 1 (EC1 — 30% Total Weightage): Continuous evaluation administered via the online portal.
    • Quiz 1 (5%): Evaluates foundational concepts in software development lifecycles, microservices, and ML pipeline fundamentals.
    • Situated Learning Component (5%): Introduced post-midterm (Session 8) to deliver contextualized, scenario-driven problem solving.
    • Assignment 1 (10%): Pre-midterm practical project focusing on software requirements engineering, architectural design, and dataset pipeline formulation.
    • Assignment 2 (10%): Post-midterm practical project covering Docker containerization, cloud deployment, and real-time model monitoring.
  • Evaluation Component 2 (EC2 — 30% Weightage): Midterm Examination. Closed-book format. Tests core software engineering lifecycles, microservice architectural trade-offs, and ML system design.
  • Evaluation Component 3 (EC3 — 40% Weightage): Comprehensive Final Examination. Open-book format. Evaluates full end-to-end system design, production deployment strategies, and quality assurance.

Exam note: EC2 (Midterm) is closed-book, requiring clear conceptual mastery of architectural patterns, SDLC phases, and non-functional quality attributes. EC3 (Final) is open-book, permitting printed reference decks.

To support open-book preparation without sacrificing live instructional clarity, live lectures utilize clean, non-watermarked presentation decks. By Session 13 or 14, all course presentations are compiled into watermarked PDF documents and released via the learning portal for printing and physical reference during the open-book final exam.

The course curriculum is anchored by two primary reference texts:

  1. Machine Learning in Production: From Models to Products (Carnegie Mellon University)
  2. Software Engineering for Data Scientists by Catherine Nelson (O'Reilly)

1.1.3 Experiential Learning and Tooling Infrastructure

Starting in Session 4, theoretical concepts transition into hands-on architectural implementation. Practical lab capsules, interactive webinars, and real-world case studies utilize dedicated cloud infrastructure provisioned on Amazon Web Services (AWS). Each enrolled student is allocated an isolated virtual machine instance (Amazon EC2) pre-configured with modern software runtimes and MLOps tooling.

The modern production machine learning stack introduced throughout the course includes:

Category Industry Tools & Runtimes Production Responsibility
Pipeline Orchestration Prefect, Prefect Cloud, Apache Airflow Automating DAG execution, task scheduling, backfilling, and dependency handling.
Experimentation & Tracking MLflow Logging hyperparameters, metrics, model artifacts, and registration.
Data Versioning Data Version Control (DVC) Git-like version control for large datasets, features, and model weights.
Cloud ML & Foundation Models AWS SageMaker (Studio/Canvas), AWS Bedrock Model training, serverless hosting, managed endpoints, and LLM fine-tuning/RAG.
Containerization & Orchestration Docker, Kubernetes, minikube, AWS ECS, AWS EKS Packaging runtime dependencies, container orchestration, auto-scaling, and deployment.
API Development FastAPI Constructing high-performance, asynchronous REST APIs for model inference.
Testing & Monitoring PyTest, EvidentlyAI, AWS CloudWatch Automated unit testing, real-time data drift monitoring, concept drift detection, and log collection.
GenAI & RAG Infrastructure LangChain, ChromaDB, OpenAI Embeddings Vector storage, embedding generation, context retrieval, and agentic workflows.

Scope & Common Tooling Pitfalls:

  • Over-engineering prematurely: Introducing heavy orchestrators like Kubernetes or Airflow before establishing basic automated testing (PyTest) and data versioning (DVC) creates unnecessary operational overhead.
  • Notebook lock-in: Relying exclusively on interactive Jupyter Notebooks for production logic leads to hidden state bugs, non-reproducible runs, and deployment failures.

1.1.4 Student Questions and Answers

Q: Will watermarked slides be provided in time for open-book exam preparation? A: Yes. Live instruction uses clear, non-watermarked slides to avoid visual clutter during lectures. Around Session 13 or 14, all lecture decks will be converted into watermarked PDFs and uploaded to the portal, allowing ample time for downloading and printing prior to the comprehensive open-book final exam.

Q: Will we need to study multiple external textbooks or documentation sources for the exams? A: No. All core learning content is directly embedded within the presentation slides. While supplementary case studies and research papers are provided for broader practical context, the slides themselves serve as the primary self-contained study material for all examinations.

Q: Can this course help us integrate machine learning models with legacy enterprise platforms such as SAP or core banking systems? A: While the course does not focus on proprietary enterprise software configurations like SAP, it teaches universal architectural patterns—such as RESTful APIs, microservices, containerization, and message queues—that form the industry-standard integration layer between ML inference services and legacy enterprise backends.

Q: How can a student with zero software engineering experience follow this course? A: The course builds concepts progressively from fundamental first principles. While low-level programming syntax is not taught from scratch, all software engineering lifecycles, architectural trade-offs, and machine learning workflows are introduced systematically to ensure students from non-traditional software backgrounds build both theoretical understanding and practical engineering capability.

Recap & Bridge: SEML bridges the gap between software engineering discipline and exploratory ML workflows through a 750-student self-contained curriculum supported by AWS hands-on labs. Next, we examine how traditional Software Development Lifecycles (SDLC) evolved into the modern Agentic Development Life Cycle (ADLC).

1.2 Software Development Lifecycle and Architectural Evolution

1.2.1 The Software Development Lifecycle (SDLC)

The Software Development Lifecycle (SDLC) is a structured, end-to-end framework defining the systematic sequence of stages involved in planning, designing, constructing, testing, deploying, and maintaining software applications. Over five decades of software engineering practice, SDLC methodologies have provided the blueprint for transforming ambiguous human requirements into robust, high-quality production software.

+----------+    +--------------+    +----------+    +-------------+    +-------------+    +------------+    +------------+
| Planning | -> | Requirements | -> | Analysis | -> | High & Low  | -> | Development | -> | Testing &  | -> | Deployment |
|  Phase   |    | Engineering  |    | & Arch.  |    | Level Design|    | & Coding    |    | QA Phase   |    | & Maint.   |
+----------+    +--------------+    +----------+    +-------------+    +-------------+    +------------+    +------------+

The 8 Sequential Phases of traditional SDLC:

  1. Planning Phase: Defines strategic goals, project scope, technical feasibility, financial budgeting, and timeline schedules.
  2. Requirements Engineering Phase: Captures stakeholder needs, writing formal business requirements documents (BRD) and functional specifications.
  3. Analysis and Architecture Phase: Establishes system design boundaries, architectural patterns, and inter-component data flows.
  4. Design Phase: Split into High-Level Design (HLD) (module topology, microservice boundaries) and Low-Level Design (LLD) (class diagrams, data schemas, API signatures).
  5. Development and Coding Phase: Translates LLD specifications into executable code adhering to functional or object-oriented design principles.
  6. Testing and Quality Assurance (QA) Phase: Progressive validation across three core tiers:
    • Unit Testing: Isolated verification of individual functions or modules (written by developers).
    • Integration Testing: Verifying contract compliance and data exchange between interacting modules.
    • System & Acceptance Testing: End-to-end testing by QA teams to certify performance, security, and functional correctness.
  7. Deployment Phase: Moving built binaries through staging environments into production cloud infrastructure.
  8. Maintenance Phase: Continuous post-launch operations, defect patching, performance optimization, and capacity scaling.

1.2.2 Key Roles in Software Engineering Projects

Enterprise software construction requires strict separation of responsibilities among multidisciplinary roles:

Role Primary Operational Focus Core Artifact Produced
Business Analyst (BA) Translates business vision into functional specifications Functional Requirement Document (FRD)
Product Owner (PO) Owns product vision, backlog prioritization, and feature roadmap Prioritized Product Backlog
Project Manager (PM) Schedule tracking, resource allocation, risk management Project Gantt Chart & Risk Register
Scrum Master Agile process facilitation and unblocking development teams Sprint Velocity & Burn-down Metrics
Software Architect Macro system structure, tech stack selection, quality trade-offs Architecture Decision Records (ADRs)
Software Engineer Code synthesis, unit test implementation, refactoring Source Code & Unit Test Suites
QA Engineer Automated test suites, edge case verification, regression testing Test Plans & Defect Logs
UI/UX Designer User journey mapping, wireframing, component design system Design System & Interactive Prototypes

1.2.3 Four Dimensions of Software Engineering Evolution

Software engineering has evolved continuously across four interconnected dimensions: process methodology, software architecture, packaging/deployment, and hosting infrastructure.

Evolution Matrix across the 4 Engineering Dimensions:

Dimension Stage 1 (Legacy) Stage 2 (Transitional) Stage 3 (Modern Cloud-Native)
1. Process Waterfall Model Agile (Scrum / XP) Agile + DevOps (Automated CI/CD)
2. Architecture Monolithic System Tiered / SOA Microservices Architecture
3. Packaging Physical Bare-Metal Virtual Machines (VMs) Lightweight Containers (Docker/K8s)
4. Infrastructure On-Premise Data Center Managed Hosting Elastic Public/Private Cloud

Dimension 1: Development Process Evolution

  • Waterfall Model (1980s–1990s): A strictly linear sequential process where downstream phases cannot begin until upstream phases are 100% complete and frozen.

Teaching Moment — The Danger of Waterfall Rigidity: In an enterprise software initiative witnessed firsthand, a software team spent 9 months drafting over 160 exhaustive use-case documents. Before entering the architecture or coding phase, business priorities and market conditions shifted completely. The entire 9-month requirements artifact was scrapped, yielding zero usable software. This highlights the catastrophic risk of rigid, upfront Waterfall planning in fast-changing domains.

  • Agile Methodologies (Early 2000s): Introduced iterative 2-to-4 week development cycles ("sprints"). Frameworks like Scrum and Extreme Programming (XP) emphasize adaptive planning, customer collaboration, and rapid delivery of working software increments.
  • Agile + DevOps (Modern Era): Unifies development (Dev) and operations (Ops) through automated Continuous Integration (CI) and Continuous Deployment (CD) pipelines. Teams run automated test suites on every git push and deploy code into production multiple times per day (e.g., Amazon executes over 150 automated micro-deployments daily).

Dimension 2: Application Architecture Evolution

  • Monolithic Architecture: Entire application packaged as a single binary where presentation logic, business logic, and database access are tightly coupled. Modifying a single module requires rebuilding and redeploying the entire codebase, with high risks of unintended side effects.
  • Tiered (N-Tier) & SOA: Decouples applications into logical tiers (Presentation Layer, Business Logic Layer, Data Access Layer) communicating across formal service contracts.
  • Microservices Architecture: Deconstructs the application into small, independently deployable, loosely coupled services organized around specific business capabilities (e.g., User Auth, Payment Gateway, Recommendation Engine). Each service manages its own database, technology stack, and deployment pipeline.

Dimension 3: Packaging and Deployment Evolution

  • Physical Bare-Metal: Applications installed directly on dedicated host hardware, leading to server underutilization and hardware lock-in.
  • Virtual Machines (VMs): Hardware virtualization via hypervisors (e.g., VMware, KVM). Multiple full guest operating systems run on a single physical host, improving density but incurring high memory and startup overhead.
  • Containerization (Docker / Kubernetes): Operating-system-level virtualization. Containers share the host kernel while isolating application binaries, dependencies, and environment configurations. They start in milliseconds and guarantee runtime consistency between local laptop environments and production cloud clusters.

Dimension 4: Infrastructure Evolution

  • On-Premise Data Centers: High capital expenditure (CapEx), manual hardware provisioning, and fixed compute capacity.
  • Elastic Cloud Computing (AWS / Azure / GCP): On-demand operational expense (OpEx) compute model. Cloud-native systems dynamically scale server instances up or down based on real-time traffic spikes.

Synthesis — Cloud-Native Systems: A modern Cloud-Native System represents the ultimate convergence of these four dimensions: Agile + DevOps delivery processes, built on Microservices architecture, packaged inside Containers, and hosted on Elastic Cloud infrastructure.

1.2.4 Agentic Development Life Cycle (ADLC)

The software engineering landscape is currently experiencing a paradigm shift from traditional SDLC to the Agentic Development Life Cycle (ADLC). ADLC integrates autonomous AI agents powered by Large Language Models (LLMs) and foundation models into every phase of the engineering workflow:

ADLC Functional Capabilities across SDLC Stages:

  • Automated Requirements Synthesis: AI agents ingest unstructured customer meeting recordings and synthesize structured product backlog items and user stories.
  • Architectural Code Generation: Agents generate boilerplate microservices, API contracts (OpenAPI/Swagger), and database schemas from natural language specifications.
  • Automated Test Engineering: Agents inspect pull requests, generate comprehensive PyTest/JUnit unit test suites, and simulate edge-case failure modes.
  • Autonomous Bug Resolution & Remediation: Production observability agents scan stack traces, trace root causes in source code, generate fix PRs, and verify fixes against CI test suites autonomously.

Exam note & Recap: Understanding the 4 dimensions of software evolution (Waterfall -> Agile -> DevOps; Monolith -> Microservices; Bare-metal -> Containers; On-prem -> Cloud) is a high-yield concept for closed-book EC2 exams. Next, we examine how non-functional quality attributes dictate microservices architecture choices.

1.3 Quality Attributes and Microservices Design Patterns

1.3.1 Functional vs Non-Functional Requirements

Software requirements are categorized into two complementary dimensions that define what a system does and how well it performs:

  • Functional Requirements: Specify the explicit actions, computations, calculations, business rules, or operations that a system must execute (e.g., "The payment service must process credit card transactions and issue an electronic receipt").
  • Non-Functional Requirements (Quality Attributes): Define the operational characteristics, constraints, safety boundaries, and performance benchmarks under which the functional features must execute.

Core Software Quality Attributes ("The -ilities"):

  • Scalability: The capacity of a system to handle growing workloads (concurrent request volume, data ingestion rates) by scaling compute/storage resources horizontally or vertically without degrading responsiveness.
  • Performance: System responsiveness measured in latency (e.g., 99th percentile response time ) and throughput (e.g., transactions per second, ).
  • Reliability & Availability: Reliability measures the probability that a system performs faultlessly over a specified period. Availability is the percentage of total operational uptime: where is Mean Time Between Failures and is Mean Time To Repair.
  • Safety & Security: Safeguards ensuring data confidentiality, integrity against unauthorized access, and operational isolation preventing catastrophic failure modes.
  • Usability & Maintainability: Interface clarity for users and ease of updating/debugging code for developers.

1.3.2 The Role of the Software Architect

A Software Architect bridges business goals and technical implementation by evaluating non-functional trade-offs. Selecting an architectural pattern always involves balancing competing priorities—such as simplicity versus scalability, or immediate latency versus long-term data consistency.

Architectural Trade-Off Case Study (Synchronous vs. Asynchronous): Imagine an online retail platform during a flash sale. A naive synchronous REST API requires the checkout service to wait for the inventory, payment, and notification services sequentially. Under high traffic (), threads block waiting for network responses, leading to resource exhaustion and system crash.

The Software Architect resolves this by decoupling services using an asynchronous event-driven architecture (e.g., Apache Kafka). The checkout service places an order event on a message bus and immediately returns a success acknowledgment to the user, while background worker microservices consume events asynchronously.

1.3.3 Microservices Data Storage and Inter-Service Communication

When decomposing applications into microservices, data ownership and communication protocols determine system resilience and operational autonomy.

Database-per-Service Pattern (Preferred):
[ Order Microservice ] ---> ( Order DB )
         |
    (Saga Event)
         v
[ Payment Microservice ] -> ( Payment DB )

Microservice Data Patterns:

  • Database-per-Service Pattern (Recommended): Each microservice maintains complete ownership over its private database instance. External services cannot execute SQL queries directly against another service's database; all data access occurs strictly through public API endpoints. This isolates schema changes and allows polyglot persistence (e.g., PostgreSQL for Orders, Redis for Caching, Neo4j for Fraud Graphs).
  • Shared Database Pattern (Anti-Pattern): Multiple microservices query and mutate a single central database. While easy during early monolith migration, it creates tight schema coupling, single points of database failure, and cross-team deployment bottlenecks.

Distributed Transactions & The Saga Pattern: In a database-per-service architecture, traditional single-database ACID transactions spanning multiple microservices are impossible. Microservices use the Saga Pattern—a sequence of localized transactions. Each microservice updates its local database and emits an event. If a downstream service fails (e.g., Payment Declined), the Saga orchestrator emits compensating transactions to roll back prior local updates (e.g., Restock Reserved Inventory).

Inter-Service Communication Protocols:

  • Synchronous Communication (REST / gRPC / GraphQL): Request-response model. The client halts execution waiting for the server's HTTP/gRPC response. Preferred for low-latency point-to-point queries.
  • Asynchronous Communication (Kafka / RabbitMQ / SQS): Publisher-subscriber model. The publisher places messages into an event broker queue without blocking. Preferred for high-throughput, fault-tolerant event processing.

1.3.4 Student Questions and Answers

Q: Where do Site Reliability Engineers (SREs) fit into the software development lifecycle, especially in security-sensitive banking environments with restricted production access? A: SREs operate on the production and operational side of the lifecycle. In security-sensitive environments (like banking or healthcare) where developers are legally barred from direct production database/server access, SREs manage automated deployment pipelines, infrastructure scaling, logging, and real-time observability. They monitor system metrics (CPU, memory, latency) and model performance signals (data drift alerts) to maintain production SLA compliance.

Q: Can we classify functional requirements as user-facing front-end components and non-functional requirements as back-end infrastructure? A: No. Non-functional quality attributes apply across both front-end and back-end components. A user-facing feature (such as clicking a food delivery order button) requires both clean UI usability (front-end non-functional attribute) and rapid sub-second processing latency (back-end non-functional attribute). Quality attributes define how well the system fulfills its functional features across the entire architectural stack.

Q: Is implementing a CI/CD pipeline always beneficial for software projects? A: For cloud-native and custom in-house software, CI/CD pipelines provide immense speed, safety, and operational efficiency. However, when implementing third-party vendor software that undergoes frequent architectural overhauls, forcing custom external CI/CD automation can introduce severe maintenance overhead, making CI/CD an operational bottleneck rather than an enabler.

Exam note & Recap: Database-per-service vs Shared Database, Saga pattern compensation, and synchronous (REST/gRPC) vs asynchronous (Kafka) protocols are frequent examination topics. Next, we examine the historical evolution of Data Infrastructure and Data Science.

1.4 Evolution of Data Science and Machine Learning

1.4.1 Historical Timeline of Data Infrastructure and Analytics

Modern machine learning systems exist as the culmination of six decades of technological evolution across data storage, compute infrastructure, and statistical algorithms.

+-----------+    +-----------+    +--------------+    +---------------+    +--------------+    +--------------+    +----------------+
|  1960s    | -> |   1970s   | -> |    1980s     | -> |  Early 2000s  | -> |  Late 2000s  | -> |  2010-2015   | -> | 2017-Present   |
| Flat Files|    |  RDBMS    |    | Data Mining  |    | Data Warehouse|    | Social Media |    | Big Data &   |    | Transformers & |
| & Sheets  |    | (EF Codd) |    |   & KDD      |    |   & ETL/BI    |    | & Cloud Era  |    | Deep Learning|    | Multimodal AI  |
+-----------+    +-----------+    +--------------+    +---------------+    +--------------+    +--------------+    +----------------+

The 7 Epochs of Data Infrastructure & Analytics Evolution:

  1. 1960s — Flat Files and Physical Sheets: Data was stored locally in unstructured flat text files and simple ledger spreadsheets. Querying was manual, serial, and restricted to micro-scale dataset sizes.
  2. 1970s — Relational Database Management Systems (RDBMS): E.F. Codd published the milestone paper E.F. Codd (1970) A Relational Model of Data for Large Shared Data Banks, laying down mathematical set theory for relational tables and normalization. Financial institutions rapidly adopted RDBMS to guarantee ACID transactions (Atomicity, Consistency, Isolation, Durability) via Structured Query Language (SQL).
  3. 1980s — Knowledge Discovery in Databases (KDD) and Data Mining: The rapid accumulation of transactional databases led to data mining techniques aimed at discovering hidden statistical patterns. Classic algorithms emerged during this era: Decision Trees (ID3/C4.5), Support Vector Machines (SVM), Naive Bayes classifiers, k-Nearest Neighbors (KNN), and Logistic Regression.
  4. Early to Mid-2000s — Data Warehousing, ETL, and Business Intelligence: Organizations separated real-time operational systems (Online Transaction Processing / OLTP) from analytical query systems (Online Analytical Processing / OLAP). Batch Extract, Transform, Load (ETL) jobs ingested nightly transactional logs into centralized Data Warehouses organized in star or snowflake schemas for Business Intelligence (BI) dashboarding.
  5. Late 2000s — Rise of Social Media, Unstructured Logs, and Cloud Infrastructure: Social networks and mobile web platforms generated petabytes of semi-structured (JSON/XML) and unstructured data (images, videos, clickstreams). AWS introduced EC2 and S3 in 2006, inaugurating elastic cloud storage and compute.
  6. 2010–2015 — Big Data Deluge & Deep Learning Expansion: Traditional machine learning models hit performance asymptotic limits when scaling to massive unstructured data. Deep neural networks gained prominence: Convolutional Neural Networks (CNNs) revolutionized computer vision, while Recurrent Neural Networks (RNNs, LSTMs, GRUs) dominated sequence modeling.
  7. 2017–Present — Transformers, Foundation Models, and Multimodal AI: The seminal paper Vaswani et al. (2017) Attention Is All You Need introduced the Transformer architecture, replacing sequential recurrence with parallelized self-attention mechanisms: Transformers enabled pre-training across web-scale text corpora, yielding Large Language Models (BERT, GPT, Gemini, Claude, Grok), Large Vision Models (LVMs), and agentic multimodal systems.

1.4.2 The Principle of Data-Driven Evolution

A foundational architectural insight of software engineering for machine learning is that data evolution drives hardware and algorithm evolution—not the reverse.

Causal Chain of AI Evolution: Exponential Growth in Unstructured Data Demand for Distributed Cloud Compute & GPUs Feasibility of Scalable Deep Transformer Architectures Emergence of Foundation Models & Multimodal AI Agents.

Scope & Architectural Boundary: While traditional software engineering focuses on code complexity and algorithmic efficiency ( time complexity), machine learning systems engineering prioritizes data pipeline scaling, feature freshness, reproducible dataset versions, and distributed model serving latency.

Recap & Bridge: Data infrastructure evolved from 1960s flat files to modern Transformer-driven foundation models. Next, we examine the convergence of AI, Machine Learning, Deep Learning, Data Science, and Software Engineering.

1.5 Convergence of Data Science, Artificial Intelligence, and Software Engineering

1.5.1 Conceptual Taxonomy and Relationships

Understanding modern machine learning systems requires establishing a precise structural taxonomy connecting Artificial Intelligence (AI), Machine Learning (ML), Deep Learning (DL), and Data Science (DS).

+-------------------------------------------------------------+
| Artificial Intelligence (AI)                                |
|  +-------------------------------------------------------+  |
|  | Machine Learning (ML)                                 |  |
|  |  +-------------------------------------------------+  |  |
|  |  | Deep Learning (DL)                              |  |  |
|  |  |  +-------------------------------------------+  |  |  |
|  |  |  | Transformers & Foundation Models          |  |  |  |
|  |  |  +-------------------------------------------+  |  |  |
|  |  +-------------------------------------------------+  |  |
|  +-------------------------------------------------------+  |
|                                                             |
|  Data Science (Cross-cutting domain covering data pipelines,|
|  EDA, modeling, visualization, and domain engineering)      |
+-------------------------------------------------------------+

Hook & Analogy — Andrew Ng's Electricity Analogy: Just as electricity transformed every major industry a century ago—from transportation and manufacturing to healthcare and communication—Artificial Intelligence is the new electricity. It is not an isolated software tool, but a foundational utility powering intelligent decision-making across all domains.

Taxonomic Definitions:

  • Artificial Intelligence (AI): The overarching computer science discipline focused on building systems capable of performing tasks that traditionally require human cognitive intelligence (symbolic logic, reasoning, natural language comprehension, vision).
  • Machine Learning (ML): A specialized subset of AI where algorithms discover mathematical relationships and predictive patterns directly from historical data without being explicitly programmed with hard-coded rules.
  • Deep Learning (DL): A sub-field of ML utilizing multi-layered artificial neural network architectures (CNNs, RNNs, Transformers) to extract hierarchical representation features from high-dimensional unstructured data.
  • Data Science (DS): An interdisciplinary, cross-cutting field combining computer science, statistics, domain expertise, and software engineering to manage the entire data value chain—from ingestion and cleaning to exploratory data analysis (EDA), modeling, and executive storytelling.

1.5.2 "Garbage In, Garbage Out" (GIGO) and Data Quality

A fundamental law of machine learning engineering is "Garbage In, Garbage Out" (GIGO). A machine learning model is an optimizer that faithfully mirrors the statistical distribution of its training data.

Teaching Moment — The GIGO Principle: If training datasets contain corrupted features, missing values, uncalibrated sensor noise, label errors, or historical selection bias, even the most sophisticated billion-parameter transformer model will generate flawed or toxic outputs.

In classical software engineering, bugs stem from flawed code logic. In machine learning engineering, bugs frequently stem from corrupted data pipelines. Therefore, software engineering for ML requires rigorous automated schema enforcement, data versioning (via DVC), feature validation (via Great Expectations), and continuous data quality monitoring (via EvidentlyAI).

1.5.3 Data Science Hierarchy of Needs and Role Specialization

Deploying enterprise ML solutions requires building a stable data foundation, often visualized as a hierarchy of needs inspired by Monica Rogati's framework:

          / \
         / AI \             <- Foundation Models, Agents, RL
        /------\
       / Deep   \           <- Neural Networks, Transformers
      /----------\
     / Machine    \         <- Supervised/Unsupervised ML
    /--------------\
   / Explore & Clean\       <- EDA, Aggregations, Metrics
  /------------------\
 / Collect & Store    \     <- DBs, Pipelines, Data Lakes
------------------------

Engineering Role Specialization across the Hierarchy:

Tier / Function Core Responsibilities Primary Role Key Tooling
1. Collect & Store Setting up raw data collection, ingestion streams, and storage clusters Data Infrastructure Engineer AWS S3, PostgreSQL, Kafka
2. Transform & Move Building ETL/ELT pipelines, data lakes, feature stores, and schema validation Data Engineer Apache Spark, Airflow, dbt, Snowflake
3. Explore & Analyze Exploratory Data Analysis (EDA), statistical summary, business metrics Data Analyst / BI Engineer SQL, Tableau, PowerBI, Pandas
4. Model & Predict Feature selection, algorithm tuning, model training, evaluation metrics Machine Learning Engineer / Data Scientist Scikit-Learn, PyTorch, MLflow
5. Deploy & Scale Containerization, CI/CD pipelines, MLOps, inference APIs, drift monitoring AI / ML Systems Engineer Docker, Kubernetes, FastAPI, EvidentlyAI

1.5.4 Student Questions and Answers

Q: What technologies are emerging beyond Transformer architectures in modern AI development? A: AI development is expanding rapidly across three primary frontiers:

  1. Native Multimodal Systems: Moving beyond single-modality models to unified architectures natively processing text, vision, audio, and sensor streams within a single tensor embedding space.
  2. Embodied AI and Physical Robotics: Coupling multimodal foundation models with real-world spatial perception and motor control for robotic automation.
  3. Agentic Development Lifecycles (ADLC): Building multi-agent systems equipped with long-term memory, planning capabilities, and external tool-execution interfaces to autonomously solve complex engineering tasks.

Exam note & Recap: Understanding the nested AI/ML/DL taxonomy, the GIGO data quality principle, and role specialization across the data hierarchy are key concepts. Next, we examine how ML systems transition from experimental notebooks to scalable production environments.

1.6 Machine Learning Systems in Production

1.6.1 Transitioning from Notebooks to Production Systems

In academic, research, and exploratory settings, machine learning is typically developed inside interactive computational environments such as Jupyter Notebooks or Google Colab. In these sandbox settings, data scientists manually load static local files, execute ad-hoc preprocessing, fit models, and compute static evaluation metrics (e.g., accuracy, -score, ROC-AUC).

However, a trained model binary (model.pkl or weights.bin) represents only a tiny fraction of a production ML system. Transitioning machine learning into an enterprise-grade production system requires surrounding the model with robust software infrastructure:

[ Data Ingestion ] -> [ Feature Store ] -> [ Training Pipeline ] -> [ Model Registry ]
                                                                             |
[ Monitoring ] <----- [ Containerized API ] <--------------------------------+
(EvidentlyAI)        (FastAPI / Docker)

The 5 Production System Infrastructure Tiers:

  1. Automated Data Ingestion & Validation: Continuous ingestion of streaming logs or batch databases, enforcing schema constraints before data enters the training pipeline.
  2. Feature Store & Version Control: Centralized management of transformed feature representations, using DVC (Data Version Control) for dataset lineage and reproducibility.
  3. Automated Retraining & Experiment Tracking: Orchestrating continuous retraining pipelines (using Airflow or Prefect) and tracking hyperparameter experiments and artifacts via MLflow.
  4. Containerized Model Serving: Packaging model inference runtimes into lightweight FastAPI web microservices encapsulated inside Docker containers deployed to orchestrated clusters (Kubernetes / AWS EKS / SageMaker).
  5. Continuous Monitoring & Observability: Real-time tracking of operational metrics (latency, error rates via CloudWatch) and ML-specific signals—specifically data drift (shifting input feature distributions) and concept drift (degradation of relationship between features and target labels) using tools like EvidentlyAI.

Common Pitfall — The "Notebook to Production" Anti-Pattern: Copy-pasting raw Jupyter Notebook cells directly into production backend servers introduces hidden global variable states, memory leaks, unhandled edge-case exceptions, non-reproducible model outputs, and lack of automated unit testing.

1.6.2 Scope of Software Engineering for Machine Learning

Software Engineering for Machine Learning (SEML) treats machine learning models not as isolated artifacts, but as probabilistic software components integrated into enterprise software architectures. SEML is organized around 7 core engineering pillars:

The 7 Pillars of SEML Discipline:

  1. Requirements Engineering for ML: Assessing business problem suitability for ML vs rule-based software, defining functional targets, and specifying non-functional SLAs (latency , uptime ).
  2. System Architecture & Microservice Design: Designing event-driven decoupled microservices, database-per-service patterns, vector store indexing (ChromaDB), and RAG architectures.
  3. Implementation & Software Crafts: Writing modular, object-oriented/functional Python code adhering to strict linting, type hinting, and design patterns.
  4. Quality Assurance & Testing: Executing progressive testing suites—unit testing (PyTest), integration testing, data schema validation, and model sanity checks.
  5. MLOps & Pipeline Engineering: Building automated Continuous Integration (CI), Continuous Training (CT), and Continuous Deployment (CD) pipelines.
  6. Production Deployment & Scaling: Deploying containerized endpoints onto elastic cloud infrastructure (AWS SageMaker, EKS, ECS) with auto-scaling capabilities.
  7. Responsible & Ethical Engineering: Embedding fairness auditing, explainability (SHAP/LIME), privacy preservation, and security safeguards against adversarial attacks.

Recap & Bridge: SEML provides the rigorous software engineering foundation required to transform fragile notebook models into resilient, scalable, production-grade cloud services.

Exam Guidance Summary

Midterm Examination (EC2 — 30% Weightage — Closed Book): Evaluates core concepts from early sessions:

  • Distinctions between traditional Software Engineering (deterministic) and Machine Learning (exploratory, data-driven).
  • Software Development Lifecycles (SDLC): Phased progression from requirements to maintenance.
  • The 4 dimensions of software development evolution: Process (Waterfall to Agile+DevOps), Architecture (Monolithic to Microservices), Packaging (Physical to Containers), and Infrastructure (On-Premise to Elastic Cloud).
  • Functional versus Non-Functional Requirements (Quality Attributes: scalability, performance, reliability, usability).
  • Architectural patterns: Database-per-service vs Shared Database, Saga pattern for distributed microservice transactions, synchronous (REST/gRPC) vs asynchronous (Kafka/SQS) communication.
  • Historical data evolution stages: RDBMS (Codd's rules), KDD/Data Mining, Data Warehousing (ETL/BI), Big Data deluge, and Deep Learning expansion.

Comprehensive Final Examination (EC3 — 40% Weightage — Open Book):

  • Presentation slide decks serve as self-contained study materials.
  • Compiled watermarked PDF documents will be released by Session 13 or 14 for printing and hall reference.

Continuous Evaluation Components (EC1 — 30% Weightage):

  • Quiz 1 (5%): Administered online prior to midterm.
  • Situated Learning (5%): Practical scenario component administered post-midterm (introduced in Session 8).
  • Assignment 1 (10%): Pre-midterm hands-on architectural and requirement design.
  • Assignment 2 (10%): Post-midterm hands-on MLOps, containerization, and monitoring pipeline implementation.

Core Exam Study Advice: Focus on understanding architectural trade-offs rather than memorizing isolated syntax. Be prepared to analyze scenarios requiring choices between synchronous/asynchronous protocols, microservices data patterns, and quality attribute prioritizations.

Key Industry Applications

E-Commerce and Food Delivery Systems (Swiggy, Zomato, Amazon):

  • Real-world: High-throughput microservices architectures supporting real-time order processing, payment integration, dynamic delivery routing, and real-time recommendation engines.
  • Real-world: Automated CI/CD pipelines executing up to 150 daily micro-deployments to update services without downtime.

Digital Media and Video Streaming (Netflix):

  • Real-world: Canonical industry benchmark for transitioning from legacy monolithic architecture to highly decoupled microservices running across multi-region cloud infrastructure.

Financial Services and Banking (Barclays, HSBC):

  • Real-world: Enterprise transactional databases (RDBMS) paired with nightly ETL pipelines feeding data warehouses for business intelligence.
  • Real-world: Strict production access security managed by Site Reliability Engineering (SRE) teams utilizing automated observability agents.

Foundational AI Platforms (Google, OpenAI, Anthropic):

  • Real-world: Web-scale data ingestion, multi-modal foundation models (GPT series, Gemini, Grok), and parallel transformer training across high-performance GPU clusters.

SEML Lecture 1 notes · Software Engineering for Machine Learning — Foundation and Overview

Software Engineering for Machine Learning· postgraduate· 2026-07-26

Sections Breakdown

1Course Structure and Pedagogical Foundation

SEML course overview, enrollment scale, assessment scheme, AWS tooling stack, and student Q&A

2Software Development Lifecycle and Architectural Evolution

SDLC phases, team roles, 4 dimensions of SE evolution, and ADLC

3Quality Attributes and Microservices Design Patterns

Functional vs non-functional requirements, architect trade-offs, database-per-service, Saga pattern, and communication protocols

4Evolution of Data Science and Machine Learning

7 epochs of data infrastructure, Transformer self-attention, and data-driven evolution principle

5Convergence of Data Science, AI, and Software Engineering

AI/ML/DL/DS taxonomy, GIGO principle, data science hierarchy of needs, and role specialization

6Machine Learning Systems in Production

Notebook-to-production transition, 5 infrastructure tiers, and 7 SEML engineering pillars

7Exam Guidance Summary

Exam scope for EC1 continuous, EC2 midterm, and EC3 final

8Key Industry Applications

Real-world applications in e-commerce, streaming, banking, and foundational AI platforms

Postgraduate students in Software Engineering for Machine Learning

Exam Revision Notes

Below is the distilled, exam-ready core. Every entry comes from the full explanation above. Use this section for rapid review; return to the main notes when a point needs more context.

Course Structure and Assessment

Must-know: EC1 is 30% continuous assessment, EC2 is 30% closed-book midterm, EC3 is 40% open-book final using watermarked slides provided in session 13-14.

Top pitfall: Relying on raw Jupyter Notebooks for production logic leads to non-reproducible deployments.

Self-check: What evaluation component uses open-book format and what materials can be brought?

Connects to: 1.2 Software Development Lifecycle and Architectural Evolution

4 Dimensions of Software Evolution

Must-know: Understand the 4 dimensions of software evolution: Waterfall->Agile->DevOps, Monolith->Microservices, Bare-metal->Containers, On-prem->Cloud.

Top pitfall: Waterfall rigidity risk: Spending months upfront on specs before validating architecture can lead to completely scrapped work.

Self-check: What defines a Cloud-Native application across the four software engineering dimensions?

Connects to: 1.1 Course Structure, 1.3 Quality Attributes

Microservices Design Patterns

Must-know: Understand trade-offs between Database-per-service vs Shared DB, Saga pattern for distributed transactions, and REST/gRPC vs Kafka/SQS.

Top pitfall: Classifying non-functional requirements solely as backend infrastructure — quality attributes apply across both frontend usability and backend latency.

Self-check: How does the Saga pattern manage distributed transactions across microservices with isolated databases?

Connects to: 1.2 SDLC Evolution, 1.4 Data Infrastructure

Data Infrastructure Evolution

Must-know: Understand the 7 historical epochs of data infrastructure, E.F. Codd's relational model (1970), and the Transformer self-attention formula (Vaswani et al. 2017).

Top pitfall: Assuming algorithms drive data infrastructure — data evolution drives algorithmic and compute evolution.

Self-check: Why did Transformers replace Recurrent Neural Networks (RNNs/LSTMs) for web-scale sequence modeling?

Connects to: 1.3 Quality Attributes, 1.5 AI/ML Taxonomy

AI/ML/DL Taxonomy and GIGO

Must-know: The nested relationships between AI, ML, DL, and DS, and why GIGO makes data pipeline validation critical in ML engineering.

Top pitfall: Garbage In, Garbage Out: Corrupted input data produces useless predictions regardless of model architecture sophistication.

Self-check: What are the 5 tiers of the Data Science Hierarchy of Needs and their corresponding roles?

Connects to: 1.4 Data Infrastructure, 1.6 ML Production

ML Production Systems

Must-know: The 5 production infrastructure tiers (Ingestion, Feature Store, Retraining, Serving, Monitoring) and the 7 pillars of SEML.

Top pitfall: Deploying raw notebook code directly to production introduces hidden state, memory leaks, and lack of test coverage.

Self-check: What is the difference between data drift and concept drift in production ML monitoring?

Connects to: 1.5 AI/ML Taxonomy

Was this lecture useful?

Loading comments…
🤖

BitsNotes AI Assistant

Subject Notes Assistant

Configure AI Chat

Choose how to access the chatbot
Have your own API key?

Switch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.

🔑 Enter API key above to fetch live models from provider, or enter model name manually.
OpenAI-Compatible API Support

Choose any provider preset (Gemini, DeepSeek, Kimi, GLM, MiniMax, Qwen, OpenAI, Groq, Ollama, etc.) or enter a custom endpoint URL.

Security & Privacy First

Your API key is sent directly from your browser to your specified provider. BitsNotes servers never store or see your key.