Machine Learning Guide

Machine Learning Guide

Download on the App Store

All Machine Learning Guide episodes

  • MLA 024 Agentic Coding: Specs and Review

    Agentic coding best practices: write a spec, make the agent plan, verify with checks it must run, and review with a fresh model before you merge. Also: parallel agents, auto mode safety, and what studies show about speed.

    Links
    • Notes and resources at ocdevel.com/mlg/mla-24
    • Join the free MLG group: listen to my other AI shows, ask me questions, and talk with other listeners
    Agentic coding best practices

    spec → plan → implement in slices → verify → review → human merge

    Writing code is cheap; checking it is the job. Anthropic's and OpenAI's Codex guides both describe this loop.

    How detailed should a spec be?

    Scale it to the change's size and reversibility.

    • One-sentence diff: a specific prompt naming the symptom, where to look and what fixed means.
    • A few files: goal, context, constraints, and a "done when" line a machine can check, plus what's out of scope.
    • Multi-day, schema or public API: have the agent interview you into a spec file, then build it in a fresh session. Review the plan (plan mode, Shift+Tab or /plan in Claude Code and Codex) for the files it names, its verification step and its scope.
    How to make a coding agent verify its work

    Give it a pass/fail command (typecheck, lint, tests, build) and require the output; "all tests pass" alone proves little. Enforcement runs from softest to hardest: prompt → /goal → Stop hook → CI. Agents game tests: on ImpossibleBench, 2025 frontier models passed about half of tasks whose tests contradict the spec, and letting the model report the conflict cut GPT-5's rate from 54% to 9%. Review test-file edits first. For UI, have the agent screenshot the page.

    Should a second model review the code?

    At minimum a fresh context: /code-review, a second session, or a read-only reviewer subagent. For a different model family, the Codex plugin for Claude Code runs Codex reviews inside Claude Code. Review against the spec and skip style. Keep standing rules in AGENTS.md or REVIEW.md.

    How many coding agents in parallel?

    About three per supervising person; Anthropic's agent-team guidance starts at 3–5. Review speed is the limit. Parallelize only tasks on separate files; beyond that, use a labeled issue queue. Before any unattended run, answer: what's done, how it checks itself, what it may touch, what stops it, who signs off.

    Is Claude Code auto mode safe?

    Safe enough in a dev checkout with no production credentials, and not a security boundary (permission modes). It may read your .env and use those keys with their own API. Put must-nevers in deny rules (MLA 23); skip permissions only in a throwaway container without internet. Injection: MLA 28.

    Do AI coding agents make developers faster?

    No clean number exists for current agents. METR's 2026 update estimated 18% faster (returning developers) and 4% (new), both intervals crossing zero, after its 2025 study found 19% slower. Cursor adopters saw a two-month velocity spike and lasting rises in warnings and complexity (He et al., MSR '26). DORA 2025: more throughput, less stability. Anthropic's trial: learners using AI scored 50% vs 67%.

    How to use Claude Code: the first week
    1. Ask questions about a project you know, make one small change, read the diff, commit.
    2. Put your one-command check in CLAUDE.md.
    3. Write a task with a done-when line; run it through plan mode.
    4. Run /code-review before merging.
    5. Try one parallel task in a worktree on a separate module.

    The full course on this topic is Gnothi's Claude Code, next to the Agentic AI Course, at ocdevel.com/courses.

    More in the resources. Next: MLA 25, on AI image generation.

    32 min
  • MLA 023 Inside a Coding Agent: Skills, Hooks, MCP

    Inside a coding agent: context is the budget, skills load on demand, hooks enforce rules, subagents get fresh windows and MCP tools cost tokens. What belongs in CLAUDE.md, and the settings that guard against a PocketOS-style deletion.

    Links
    • Notes and resources at ocdevel.com/mlg/mla-23
    • Join the free MLG group: listen to my other AI shows, ask me questions, and talk with other listeners
    How a coding agent uses its context window

    Each turn sends the whole conversation back to the model, so every file read and test log stays in the window until you compact or clear. The instruction file, skill descriptions and MCP tool names cost tokens on every request. Skill bodies, subagent work and hooks cost nothing until used. /context shows the breakdown. Rules said only in chat can be lost to compaction; rules in the root CLAUDE.md are reloaded.

    What to put in CLAUDE.md or AGENTS.md

    Put in what the model can't derive and needs every time: exact build and test commands, conventions that differ from the default, invisible boundaries, mistakes it made twice. Leave out codebase tours: Evaluating AGENTS.md found context files raised cost over 20% without generally improving success, and overviews didn't help. Claude Code now reads AGENTS.md when no CLAUDE.md exists. The memory docs suggest under 200 lines per file.

    Claude Code skills vs MCP vs plugins vs subagents

    A skill is a folder with a SKILL.md: its description loads at startup, and its body loads when a task matches. The Agent Skills format works in Claude Code, Codex and OpenCode. Anthropic's features overview sorts the rest: outside systems connect through MCP or a CLI, noisy side tasks go to subagents, must-happen steps become hooks, and a setup shared across repositories becomes a plugin.

    How to stop an AI agent deleting your database

    In the PocketOS incident, a Cursor agent found an unscoped Railway token in an unrelated file and deleted a production volume, backups included. Keep production credentials out of the agent's reach, scope tokens, add deny rules, turn on the sandbox, and store backups elsewhere. Permission rules match command text, so a script can get around them. The sandbox is the OS-level boundary, and it's off by default.

    Claude Code hooks

    A hook is a program run at a loop event, and it fires whether or not the model remembers the rule. In Claude Code hooks, exit code 2 blocks and exit code 1 doesn't. Add lint and typecheck after every edit, and a Stop hook that holds the turn while tests fail.

    Subagents and worktrees

    A subagent runs in a fresh window and returns only a summary. Use one for noisy reads and fresh-eyes review. Each spends its own tokens; agent teams in plan mode run about 7x a normal session. Worktrees give each agent its own checkout.

    What is an MCP server, and what does it cost?

    An MCP server exposes tools to the agent over stdio or HTTP. Loading every tool up front is expensive: five servers took about 55K tokens in Anthropic's tool-use tests. Tool search cut that overhead 85% and is now on by default in Claude Code. Prefer a CLI like gh or aws where one exists. The protocol itself: MLA 28.

    Memory and moving between tools

    Claude Code's auto memory is a local per-repo folder of notes; Codex memories are opt-in. Required rules still belong in the instruction file. AGENTS.md and skills carry over between tools, while hooks and permissions have to be set up again in each one.

    The full course on this topic is Gnothi's Claude Code, next to the Agentic AI Course, at ocdevel.com/courses.

    More in the resources. Next: MLA 24, on specs, verification and the review loop.

    32 min
  • MLA 022 Claude Code vs Codex vs Cursor in 2026

    Vibe coding in 2026 means picking an agent: Claude Code for steering, Codex for delegation, Cursor for editors, Antigravity for Google users. Plus pricing and free tiers, which model to run, OpenCode and DeepSeek or Kimi, and no-code builders.

    Links
    • Notes and resources at ocdevel.com/mlg/mla-22
    • Join the free MLG group: listen to my other AI shows, ask me questions, and talk with other listeners
    What is vibe coding?

    Building software with an AI model without reviewing the code it writes. Andrej Karpathy coined it in February 2025 for "throwaway weekend projects". Fine for prototypes; code that holds user data or that you'll maintain needs a verification loop (MLA 24).

    What is a coding agent?

    A model in a loop with tools: read files, run commands, check the result, repeat. The harness is everything around the model: loop, tools, permissions, context handling. MLA 23 goes inside it.

    Claude Code vs Codex vs Cursor vs Antigravity

    In the Stack Overflow 2026 survey, 12,255 developers reported using Claude Code (65.5%), GitHub Copilot (58.7%), Codex (29.5%), Cursor (25.5%) and Antigravity (16.0%).

    • Claude Code: terminal-first and scriptable, for close steering and custom workflows.
    • Codex: delegation to cloud tasks under one ChatGPT login. The CLI is Apache-2.0.
    • Cursor: editor-first. SpaceX owns it now; Grok and Composer 2.5 are its house models.
    • Antigravity: Google's main coding agent: Gemini CLI stopped serving consumer plans on June 18, 2026, and Jules shuts down December 31. Its menu includes Claude Sonnet and Opus 5.5.
    Claude Code vs Codex

    On Terminal-Bench 4.1, Claude Code with Opus 5.5 or Fable 5.2 scores 65.8% and Codex with GPT-6.1 Sol 60.9%, each ±3 points. Choose by fit: Claude Code for interactive work, Codex for delegated work. Many developers write with one and review with the other.

    Claude Code pricing, Codex pricing and free tiers
    • Claude: no Claude Code on the Free plan. Pro $20 ($17 annual), Max $100, Ultra $200. API billing averages ~$13 per active developer day.
    • Codex: limited on Free and Go, then Plus $20 and Pro from $100.
    • Cursor: Free, Plus $8 (Grok models only), Premium $30, Super $100, Ultra $200.
    • Antigravity: free tier, then Google AI Pro $19.99 and Ultra $99.99.
    • Copilot: Pro $10 includes the coding agent. The CLI is free.
    Which model to use in Claude Code or Codex

    Claude Code defaults to Opus 5.5 at medium effort. Fable 5.2 costs 2× Opus, and Sonnet 5.5 costs half. Codex's GPT-6.1 Sol costs a fifth of GPT-6 Astra. Raise effort before you change models, and run search-heavy subtasks on a cheaper tier.

    OpenCode vs Claude Code

    OpenCode (MIT) runs nearly any provider, including a ChatGPT sign-in and local runtimes. Pi is the minimal alternative you extend yourself. Anthropic's terms bar Claude subscription credentials in third-party harnesses, so Claude in OpenCode means an API key.

    Can I use DeepSeek or Kimi with Claude Code or Codex?

    Yes. Codex takes custom providers. DeepSeek, Kimi Code and Z.ai's GLM Coding Plan publish Anthropic-format endpoints for Claude Code. Kimi K3.1 Pro (open weights, November 4, 2026) scores 59.7% on Terminal-Bench inside Claude Code. Antigravity offers only its own menu. For self-hosting, see MLA 14.

    Best vibe coding tools if you can't code

    Lovable for a polished web app, Replit Agent 4 for app plus hosting plus mobile, Google AI Studio Build mode to start free. Before launch, have a developer check who can read the database.

    Which coding agent should I use?

    Already paying Anthropic or OpenAI → that lab's agent. Editor-first → Cursor. GitHub-centric → Copilot. On Google's plans → Antigravity. Need model freedom → OpenCode or pi. Then test two agents on bugs you already understand.

    The full course on this topic is Gnothi's Claude Code, next to the Agentic AI Course, at ocdevel.com/courses.

    More in the resources. Next: MLA 23, on what's inside a coding agent.

    30 min
  • MLG 033 Transformers

    A transformer is attention plus multilayer perceptrons: each token's query, key and value let it weigh every other token, and dropping recurrence lets training run in parallel, at a cost that grows with the square of the context window. Also covers RNNs and vanishing gradients, multi-head attention, positional encodings, masking and where to learn transformers.

    Links
    • Notes and resources at ocdevel.com/mlg/33
    • Join the free MLG group: listen to my other AI shows, ask me questions, and talk with other listeners
    What is a transformer?

    A transformer is a neural network built from attention layers and multilayer perceptrons (MLPs), introduced in Attention Is All You Need (Vaswani et al., 2017). It is the architecture behind large language models (LLMs) (MLG 034). It reads every token of its input at once, where a recurrent neural network (RNN) reads one step at a time.

    Context-free vs context-aware

    A plain MLP scores each row in isolation: a house from its bedrooms and bathrooms, a freight load from its weight, miles, rate and origin. That is context-free. Attention makes it context-aware, letting each row or token be modified by the others. A dispatcher's loads compete for one truck's capacity and route. In "The blue trophy didn't fit on the shelf because it was too big", "trophy" should take in "blue", and "it" should point to the trophy, not the shelf. A static word2vec embedding (MLG 022) gives a homonym like "close" one vector in every context.

    RNNs, vanishing gradients and the origin of attention

    An RNN passes a hidden state from step to step, predicting the next token and updating a running summary of the sequence (MLG 022, MLG 023). It has two separate problems over long sequences. The vanishing-gradient problem is gradients shrinking as they backpropagate through many steps during training. The other is the fixed-size hidden state losing information. LSTM and GRU cells address both.

    Attention was first added to RNN encoder-decoders for machine translation (Bahdanau et al., 2014), letting each decoder step weigh every encoder state of the source sentence. The remaining limit was speed: an RNN computes step by step, so training can't be spread across a GPU in parallel. Attention Is All You Need dropped the recurrence and kept attention.

    Context window and quadratic cost

    A transformer works over a fixed context window: the prompt plus the tokens generated so far. Self-attention compares every token with every other, so its compute and memory grow with the square of the context length. Attention's learned parameters (the query, key and value matrices) don't grow with context length; only a learned position table, as in BERT and GPT-2, does. In exchange, training and reading the prompt run in parallel. Generation stays sequential: the model emits one token, appends it to the context and runs again.

    Query, key and value

    Learned weight matrices project each token's embedding into a query, a key and a value vector.

    Attention(Q, K, V) = softmax(Q·Kᵀ / √d_k) · V d_k = key dimension
    • Query: what a token is looking for, as "trophy" looks for its modifiers.
    • Key: what each token offers to be matched on, as "blue" and "it" do.
    • Value: what each token contributes once matched.

    Query-key dot products measure the match and are not capped at 1. Scaling by √d_k and a softmax turn them into attention weights that sum to 1 for each token. Each token's output is the weighted sum of the value vectors, which moves "trophy" toward "blue trophy". A weight near 0 leaves out that token's contribution. The weights form a tokens × tokens matrix.

    Attention heads, multi-head attention and transformer blocks
    • Attention mechanism: the operation above, in general.
    • Attention head: one instance of it, with its own query, key and value weights.
    • Multi-head attention: several heads in parallel, each projecting the full embedding into its own smaller subspace, so each can learn a different relationship. Their outputs are concatenated and projected.
    • Transformer block: multi-head attention followed by an MLP (feed-forward) layer, each wrapped in a residual connection and layer normalization. A transformer stacks many blocks.

    3Blue1Brown's chapter How might LLMs store facts shows how MLP layers can hold a fact, drawing on Google DeepMind's Fact Finding study of factual recall. Locating and Editing Factual Associations in GPT (Meng et al., 2022) traces much factual recall to mid-layer MLPs.

    Self-attention vs cross-attention

    In self-attention a sequence attends to itself. In cross-attention one sequence attends to another: in an encoder-decoder translator, the tokens of the translation being written attend to the encoder's representation of the source sentence.

    Positional encodings and causal masking

    Attention ignores word order, so each token gets position information. The original Transformer added fixed sinusoidal encodings, BERT and GPT-2 learned theirs, and most current LLMs use rotary position embeddings (RoPE), which rotate queries and keys by position.

    Causal masking stops each token from attending to later tokens. That lets a model train on a whole sentence at once without seeing the token it is predicting.

    Where to learn transformers
    1. 3Blue1Brown's neural networks series, above all Transformers, the tech behind LLMs and Attention in transformers, step-by-step. Most of the teaching is in the animations, so watch rather than listen.
    2. The paper, Attention Is All You Need.
    3. Jay Alammar's The Illustrated Transformer.

    Next: MLG 034, on LLMs: scaling laws, mixture of experts, RLHF and chain of thought.

    43 min
  • MLA 021 Databricks: Cloud Analytics and MLOps

    Databricks is a cloud-based platform for data analytics and machine learning operations, integrating features such as a hosted Spark cluster, Python notebook execution, Delta Lake for data management, and seamless IDE connectivity. Raybeam utilizes Databricks and other ML Ops tools according to client infrastructure, scaling needs, and project goals, favoring Databricks for its balanced feature set, ease of use, and support for both startups and enterprises.

    Links
    • Notes and resources at ocdevel.com/mlg/mla-21
    • Try a walking desk stay healthy & sharp while you learn & code
    Raybeam and Databricks
    • Raybeam is a data science and analytics company, recently acquired by Dept Agency.
    • While Raybeam focuses on data analytics, its acquisition has expanded its expertise into ML Ops and AI.
    • The company recommends tools based on client requirements, frequently utilizing Databricks for its comprehensive nature.
    Understanding Databricks
    • Databricks is not merely an analytics platform; it is a competitor in the ML Ops space alongside tools like SageMaker and Kubeflow.
    • It provides interactive notebooks, Python code execution, and runs on a hosted Apache Spark cluster.
    • Databricks includes Delta Lake, which acts as a storage and data management layer.
    Choosing the Right MLOps Tool
    • Raybeam evaluates each client's needs, existing expertise, and infrastructure before recommending a platform.
    • Databricks, SageMaker, Kubeflow, and Snowflake are common alternatives, with the final selection dependent on current pipelines and operational challenges.
    • Maintaining existing workflows is prioritized unless scalability or feature limitations necessitate migration.
    Databricks Features
    • Databricks is accessible via a web interface similar to Jupyter Hub and can be integrated with local IDEs (e.g., VS Code, PyCharm) using Databricks Connect.
    • Notebooks on Databricks can be version-controlled with Git repositories, enhancing collaboration and preventing data loss.
    • The platform supports configuration of computing resources to match model size and complexity.
    • Databricks clusters are hosted on AWS, Azure, or GCP, with users selecting the underlying cloud provider at sign-up.
    Parquet and Delta Lake
    • Parquet files store data in a columnar format, which improves efficiency for aggregation and analytics tasks.
    • Delta Lake provides transactional operations on top of Parquet files by maintaining a version history, enabling row edits and deletions.
    • This approach offers a database-like experience for handling large datasets, simplifying both analytics and machine learning workflows.
    Pricing and Usage
    • Pricing for Databricks depends on the chosen cloud provider (AWS, Azure, or GCP) with an additional fee for Databricks' services.
    • The added cost is described as relatively small, and the platform is accessible to both individual developers and large enterprises.
    • Databricks is recommended for newcomers to data science and ML for its breadth of features and straightforward setup.
    Databricks, MLflow, and Other Integrations
    • Databricks provides a hosted MLflow solution, offering experiment tracking and model management.
    • The platform can access data stored in services like S3, Snowflake, and other cloud provider storage options.
    • Integration with tools such as PyArrow is supported, facilitating efficient data access and manipulation.
    Example Use Cases and Decision Process
    • Migration to Databricks is recommended when a client's existing infrastructure (e.g., on-premises Spark clusters) cannot scale effectively.
    • The selection process involves an in-depth exploration of a client's operational challenges and goals.
    • Databricks is chosen for clients lacking feature-specific needs but requiring a unified data analytics and ML platform.
    Personal Projects by Ming Chang
    • Ming Chang has explored automated stock trading using APIs such as Alpaca, focusing on downloading and analyzing market data.
    • He has also developed drone-related projects with Raspberry Pi, emphasizing real-world applications of programming and physical computing.
    Additional Resources
    • Databricks Homepage
    • Delta Lake on Databricks
    • Parquet Format
    • Raybeam Overview
    • MLFlow Documentation
    27 min
  • MLA 020 Kubeflow and ML Pipeline Orchestration on Kubernetes

    Machine learning pipeline orchestration tools, such as SageMaker and Kubeflow, streamline the end-to-end process of data ingestion, model training, deployment, and monitoring, with Kubeflow providing an open-source, cross-cloud platform built atop Kubernetes. Organizations typically choose between cloud-native managed services and open-source solutions based on required flexibility, scalability, integration with existing cloud environments, and vendor lock-in considerations.

    Links
    • Notes and resources at ocdevel.com/mlg/mla-20
    • Try a walking desk stay healthy & sharp while you learn & code

    Dirk-Jan Verdoorn - Data Scientist at Dept Agency

    Managed vs. Open-Source ML Pipeline Orchestration
    • Cloud providers such as AWS, Google Cloud, and Azure offer managed machine learning orchestration solutions, including SageMaker (AWS) and Vertex AI (GCP).
    • Managed services provide integrated environments that are easier to set up and operate but often result in vendor lock-in, limiting portability across cloud platforms.
    • Open-source tools like Kubeflow extend Kubernetes to support end-to-end machine learning pipelines, enabling portability across AWS, GCP, Azure, or on-premises environments.
    Introduction to Kubeflow
    • Kubeflow is an open-source project aimed at making machine learning workflow deployment on Kubernetes simple, portable, and scalable.
    • Kubeflow enables data scientists and ML engineers to build, orchestrate, and monitor pipelines using popular frameworks such as TensorFlow, scikit-learn, and PyTorch.
    • Kubeflow can integrate with TensorFlow Extended (TFX) for complete end-to-end ML pipelines, covering data ingestion, preprocessing, model training, evaluation, and deployment.
    Machine Learning Pipelines: Concepts and Motivation
    • Production machine learning systems involve not just model training but also complex pipelines for data ingestion, feature engineering, validation, retraining, and monitoring.
    • Pipelines automate retraining based on model performance drift or updated data, supporting continuous improvement and adaptation to changing data patterns.
    • Scalable, orchestrated pipelines reduce manual overhead, improve reproducibility, and ensure that models remain accurate as underlying business conditions evolve.
    Pipeline Orchestration Analogies and Advantages
    • ML pipeline orchestration tools in machine learning fulfill a role similar to continuous integration and continuous deployment (CI/CD) in traditional software engineering.
    • Pipelines enable automated retraining, modularization of pipeline steps (such as ingestion, feature transformation, and deployment), and robust monitoring.
    • Adopting pipeline orchestrators, rather than maintaining standalone models, helps organizations handle multiple models and varied business use cases efficiently.
    Choosing Between Managed and Open-Source Solutions
    • Managed services (e.g., SageMaker, Vertex AI) offer streamlined user experiences and seamless integration but restrict cross-cloud flexibility.
    • Kubeflow, as an open-source platform on Kubernetes, enables cross-platform deployment, integration with multiple ML frameworks, and minimizes dependency on a single cloud provider.
    • The complexity of Kubernetes and Kubeflow setup is offset by significant flexibility and community-driven improvements.
    Cross-Cloud and Local Development
    • Kubeflow operates on any Kubernetes environment including AWS EKS, GCP GKE, and Azure AKS, as well as on-premises or local clusters.
    • Local and cross-cloud development are facilitated in Kubeflow, while managed services like SageMaker and Vertex AI are better suited to cloud-native workflows.
    • Debugging and development workflows can be challenging in highly secured cloud environments; Kubeflow's local deployment flexibility addresses these hurdles.
    Relationship to TensorFlow Extended (TFX) and Machine Learning Frameworks
    • TensorFlow Extended (TFX) is an end-to-end platform for creating production ML pipelines, tightly integrated with Kubeflow for deployment and execution.
    • While Kubeflow originally focused on TensorFlow, it has grown to support PyTorch, scikit-learn, and other major ML frameworks, offering wider applicability.
    • TFX provides modular pipeline components (data ingestion, transformation, validation, model training, evaluation, and deployment) that execute within Kubeflow's orchestration platform.
    Alternative Pipeline Orchestration Tools
    • Airflow is a general-purpose workflow orchestrator using DAGs, suited for data engineering and automation, but less resource-capable for heavy ML training within the pipeline.
      • Airflow often submits jobs to external compute resources (e.g., AI Platform) for resource-intensive workloads.
      • In organizations using both Kubeflow and Airflow, Airflow may handle data workflows, while Kubeflow is reserved for ML pipelines.
    • MLflow and other solutions also exist, each with unique integrations and strengths; their adoption depends on use case requirements.
    Selecting a Cloud Platform and Orchestration Approach
    • The optimal choice of cloud platform and orchestration tool is typically guided by client needs, existing integrations (e.g., organizational use of Google or Microsoft solutions), and team expertise.
    • Agencies with diverse client portfolios often benefit from open-source, cross-cloud tools like Kubeflow to maximize flexibility and knowledge sharing across projects.
    • Users entrenched in a single cloud provider may prefer managed offerings for ease of use and integration, while those prioritizing portability and flexibility often choose open-source solutions.
    Cost Optimization in Model Training
    • Both AWS and GCP offer cost-saving compute options for training, such as spot instances (AWS) and preemptible instances (GCP), which are suitable for non-production, batch training jobs.
    • Production workloads that require high uptime and reliability do not typically utilize cost-saving transient compute resources, as these can be interrupted.
    Machine Learning Project Lifecycle Overview
    • Project initiation begins with data discovery and validation of the client's requirements against available data.
    • Cloud environment selection is influenced by client infrastructure, business applications, and platform integrations rather than solely by technical features.
    • Data cleaning, exploratory analysis, model prototyping, advanced model refinement, and deployment are handled collaboratively with data engineering and machine learning teams.
    • The pipeline is gradually constructed in modular steps, facilitating scalable, automated retraining and integration with business applications.
    Educational Pathways for Data Science and Machine Learning Careers
    • Advanced mathematics or statistics education provides a strong foundation for work in data science and machine learning.
    • Master's degrees in data science add the most value for candidates from non-technical undergraduate backgrounds; those with backgrounds in statistics, mathematics, or computer science may benefit more from self-study or targeted upskilling.
    • When evaluating online or accelerated degree programs, candidates should scrutinize the curriculum, instructor engagement, and peer interaction to ensure comprehensive learning.
    1 hr 9 min
  • MLA 019 Cloud, DevOps & Architecture

    The deployment of machine learning models for real-world use involves a sequence of cloud services and architectural choices, where machine learning expertise must be complemented by DevOps and architecture skills, often requiring collaboration with professionals. Key concepts discussed include infrastructure as code, cloud container orchestration, and the distinction between DevOps and architecture, as well as practical advice for machine learning engineers wanting to deploy products securely and efficiently.

    Links
    • Notes and resources at ocdevel.com/mlg/mla-19
    • Try a walking desk stay healthy & sharp while you learn & code

    ;## Translating Machine Learning Models to Production

    • After developing and training a machine learning model locally or using cloud tools like AWS SageMaker, it must be deployed to reach end users.
    • A typical deployment stack involves the trained model exposed via a SageMaker endpoint, a backend server (e.g., Python FastAPI on AWS ECS with Fargate), a managed database (such as AWS RDS Postgres), an application load balancer (ALB), and a public-facing frontend (e.g., React app hosted on S3 with CloudFront and Route 53).
    Infrastructure as Code and Automation Tools
    • Infrastructure as code (IaC) manages deployment and maintenance of cloud resources using tools like Terraform, allowing environments to be version-controlled and reproducible.
    • Terraform is favored for its structured approach and cross-cloud compatibility, while other tools like Cloud Formation (AWS-specific) and Pulumi offer alternative paradigms.
    • Configuration management tools such as Ansible, Chef, and Puppet automate setup and software installation on compute instances but are increasingly replaced by containerization and Dockerfiles.
    • Continuous Integration and Continuous Deployment (CI/CD) pipelines (with tools like AWS CodePipeline or CircleCI) automate builds, testing, and code deployment to infrastructure.
    Containers, Orchestration, and Cloud Choices
    • Containers, enabled by Docker, allow developers to encapsulate applications and dependencies, facilitating consistency across environments from local development to production.
    • Deployment options include AWS ECS/Fargate for managed orchestration, Kubernetes for large-scale or multi-cloud scenarios, and simpler services like AWS App Runner and Elastic Beanstalk for small-scale applications.
    • Kubernetes provides robust flexibility and cross-provider support but brings high complexity, making it best suited for organizations with substantial infrastructure needs and experienced staff.
    • Use of cloud services versus open-source alternatives on Kubernetes (e.g., RDS vs. Postgres containers) affects manageability, vendor lock-in, and required expertise.
    DevOps and Architecture: Roles and Collaboration
    • DevOps unites development and operations through common processes and tooling to accelerate safe production deployments and improve coordination.
    • Architecture focuses on the holistic design of systems, establishing how different technical components fit together and serve overall business or product goals.
    • There is significant overlap, but architecture plans and outlines systems, while DevOps engineers implement, automate, and monitor deployment and operations.
    • Cross-functional collaboration is essential, as machine learning engineers, DevOps, and architects must communicate requirements, constraints, and changes, especially regarding production-readiness and security.
    Security, Scale, and When to Seek Help
    • Security is a primary concern when moving to production, especially if handling sensitive data or personally identifiable information (PII); professional DevOps involvement is strongly advised in such cases.
    • Common cloud security pitfalls include publicly accessible networks, insecure S3 buckets, and improper handling of secrets and credentials.
    • For experimentation or small-scale safe projects, machine learning engineers can use tools like Terraform, Docker, and AWS managed services, but should employ cloud cost monitoring to avoid unexpected bills.
    Cloud Providers and Service Considerations
    • AWS dominates the cloud market, followed by Azure (strong in enterprise/Microsoft-integrated environments) and Google Cloud Platform (GCP), which offers a strong user interface but has a record of sunsetting products.
    • Managed cloud machine learning services, such as AWS SageMaker and GCP Vertex AI, streamline model training, deployment, and monitoring.
    • Vendor-specific tools simplify management but limit portability, while Kubernetes and its ML pipelines (e.g., Kubeflow, Apache Airflow) provide open-source, cross-cloud options with greater complexity.
    Recommended Learning Paths and Community Resources
    • Learning and prototyping with Terraform, Docker, and basic cloud services is encouraged to understand deployment pipelines, but professional security review is critical before handling production-sensitive data.
    • For those entering DevOps, structured learning with platforms like aCloudGuru or AWS's own curricula can provide certification-ready paths.
    • Continual learning is necessary, as tooling and best practices evolve rapidly.
    Reference Links

    Expert coworkers at Dept

    • Matt Merrill - Principal Software Developer
    • Jirawat Uttayaya - DevOps Lead
    • The Ship It Podcast (frequent discussions on DevOps and architecture)

    DevOps Tools

    • Terraform
    • Ansible

    Visual Guides and Comparisons

    • Which AWS container service should I use?
    • A visual guide on troubleshooting Kubernetes deployments
    • Public Cloud Services Comparison
    • Killed by Google

    Learning Resources

    • aCloudGuru AWS curriculum
    1 hr 16 min
  • MLA 018 Descript

    Try a walking desk to stay healthy while you study or work!

    Full notes at ocdevel.com/mlg/mla-18

    (Optional episode) just showcasing a cool application using machine learning

    Dept uses Descript for some of their podcasting. I'm using it like a maniac, I think they're surprised at how into it I am. Check out the transcript & see how it performed.

    • Descript
    • The Ship It Podcast How to ship software, from the front lines. We talk with software developers about their craft, developer tools, developer productivity and what makes software development awesome. Hosted by your friends at Rocket Insights. AKA shipit.io
    • Brandbeats Podcast by BASIC An agency podcast with views on design, technology, art, and culture. Explore the new microsite at www.brandbeats.basicagency.com
    7 min
  • MLA 017 AWS Local Development Environment

    AWS development environments for local and cloud deployment can differ significantly, leading to extra complexity and setup during cloud migration. By developing directly within AWS environments, using tools such as Lambda, Cloud9, SageMaker Studio, client VPN connections, or LocalStack, developers can streamline transitions to production and leverage AWS-managed services from the start. This episode outlines three primary strategies for treating AWS as your development environment, details the benefits and tradeoffs of each, and explains the role of infrastructure-as-code tools such as Terraform and CDK in maintaining replicable, trackable cloud infrastructure.

    Links
    • Notes and resources at ocdevel.com/mlg/mla-17
    • Try a walking desk stay healthy & sharp while you learn & code
    Docker Fundamentals for Development
    • Docker containers encapsulate operating systems, packages, and code, which simplifies dependency management and deployment.
    • Files are added to containers using either the COPY command for one-time inclusion during a build or the volume directive for live synchronization during development.
    • Docker Compose orchestrates multiple containers on a local environment, while Kubernetes is used at larger scale for container orchestration in the cloud.
    Docker and AWS Integration
    • Docker is frequently used in AWS, including for packaging and deploying Lambda functions, SageMaker jobs, and ECS/Fargate containers.
    • Deploying complex applications like web servers and databases on AWS involves using services such as ECR for image storage, ECS/Fargate for container management, RDS for databases, and requires configuration of networking components such as VPCs, subnets, and security groups.
    Challenges in Migrating from Localhost to AWS
    • Local Docker Compose setups differ considerably from AWS managed services architecture.
    • Migrating to AWS involves extra steps such as pushing images to ECR, establishing networking with VPCs, configuring load balancers or API Gateway, setting up domain names with Route 53, and integrating SSL certificates via ACM.
    • Configuring internal communication between services and securing databases adds complexity compared to local development.
    Strategy 1: Developing Entirely in the AWS Cloud
    • Developers can use AWS Lambda's built-in code editor, Cloud9 IDE, and SageMaker Studio to edit, run, and deploy code directly in the AWS console.
    • Cloud-based development is not tied to a single machine and eliminates local environment setup.
    • While convenient, in-browser IDEs like Cloud9 and SageMaker Studio are less powerful than established local tools like PyCharm or DataGrip.
    Strategy 2: Local Development Connected to AWS via Client VPN
    • The AWS Client VPN enables local machines to securely access AWS VPC resources, such as RDS databases or Lambda endpoints, as if they were on the same network.
    • This approach allows developers to continue using their preferred local IDEs while testing code against actual cloud services.
    • Storing sensitive credentials is handled by AWS Secrets Manager instead of local files or environment variables.
    • Example tutorials and instructions:
      • AWS Client VPN
      • Terraform example
      • YouTube tutorial
      • Creating the keys
    Strategy 3: Local Emulation of AWS Using LocalStack
    • LocalStack provides local, Docker-based emulation of AWS services, allowing development and testing without incurring cloud costs or latency.
    • The project offers a free tier supporting core serverless services and a paid tier covering more advanced features like RDS, ACM, and Route 53.
    • LocalStack supports mounting local source files into Lambda functions, enabling direct development on the local machine with changes immediately reflected in the emulated AWS environment.
    • This approach brings rapid iteration and cost savings, but coverage of AWS features may vary, especially for advanced or new AWS services.
    Infrastructure as Code: Managing AWS Environments
    • Managing AWS resources through the web console is not sustainable for tracking or reproducing environments.
    • Infrastructure as code (IaC) tools such as Terraform, AWS CDK, and Serverless enable declarative, version-controlled description and deployment of AWS services.
    • Terraform offers broad multi-cloud compatibility and support for both managed and cloud-native services, whereas CDK is AWS-specific and typically more streamlined but supports fewer services.
    • Changes made via IaC tools are automatically propagated to dependent resources, reducing manual error and ensuring consistency across environments.
    Benefits of AWS-First Development
    • Developing directly in AWS or with local emulation ensures alignment between development, staging, and production environments, reducing last-minute deployment issues.
    • Early use of AWS services can reveal managed solutions—such as Cognito for authentication or Data Wrangler for feature transformation—that are more scalable and secure than homegrown implementations.
    • Infrastructure as code provides reproducibility, easier team onboarding, and disaster recovery.
    Alternatives and Kubernetes
    • Kubernetes represents a different model of orchestrating containers and services, generally leveraging open source components inside Docker containers, independent of managed AWS services.
    • While Kubernetes can manage deployments to AWS (via EKS), GCP, or Azure, its architecture and operational concerns differ from AWS-native development patterns.
    Additional AWS IDEs and Services
    • Lambda
    • SageMaker Studio
    • Cloud9
    Conclusion
    • Choosing between developing in the AWS cloud, connecting local environments via VPN, or using tools like LocalStack depends on team needs, budget, and workflow preferences.
    • Emphasizing infrastructure as code ensures environments remain consistent, maintainable, and easily reproducible.
    1 hr 5 min
  • MLA 016 AWS SageMaker MLOps 2

    SageMaker streamlines machine learning workflows by enabling integrated model training, tuning, deployment, monitoring, and pipeline automation within the AWS ecosystem, offering scalable compute options and flexible development environments. Cloud-native AWS machine learning services such as Comprehend and Poly provide off-the-shelf solutions for NLP, time series, recommendations, and more, reducing the need for custom model implementation and deployment.

    Links
    • Notes and resources at ocdevel.com/mlg/mla-16
    • Try a walking desk stay healthy & sharp while you learn & code
    Model Training and Tuning with SageMaker
    • SageMaker enables model training within integrated data and ML pipelines, drawing from components such as Data Wrangler and Feature Store for a seamless workflow.
    • Using SageMaker for training eliminates the need for manual transitions from local environments to the cloud, as models remain deployable within the AWS stack.
    • SageMaker Studio offers a browser-based IDE environment with iPython notebook support, providing collaborative editing, sharing, and development without the need for complex local setup.
    • Distributed, parallel training is supported with scalable EC2 instances, including AWS-proprietary chips for optimized model training and inference.
    • SageMaker's Model Debugger and monitoring tools aid in tracking performance metrics, model drift, and bias, offering alerts via CloudWatch and accessible graphical interfaces.
    Flexible Development and Training Environments
    • SageMaker supports various model creation approaches, including default AWS environments with pre-installed data science libraries, bring-your-own Docker containers, and hybrid customizations via requirements files.
    • SageMaker JumpStart provides quick-start options for common ML tasks, such as computer vision or NLP, with curated pre-trained models and environment setups optimized for SageMaker hardware and operations.
    • Users can leverage Autopilot for end-to-end model training and deployment with minimal manual configuration or start from JumpStart templates to streamline typical workflows.
    Hyperparameter Optimization and Experimentation
    • SageMaker Experiments supports automated hyperparameter search and optimization, using Bayesian optimization to evaluate and select the best performing configurations.
    • Experiments and training runs are tracked, logged, and stored for future reference, allowing efficient continuation of experimentation and reuse of successful configurations as new data is incorporated.
    Model Deployment and Inference Options
    • Trained models can be deployed as scalable REST endpoints, where users specify required EC2 instance types, including inference-optimized chips.
    • Elastic Inference allows attachment of specialized hardware to reduce costs and tailor inference environments.
    • Batch Transform is available for non-continuous, ad-hoc, or large batch inference jobs, enabling on-demand scaling and integration with data pipelines or serverless orchestration.
    ML Pipelines, CI/CD, and Monitoring
    • SageMaker Pipelines manages the orchestration of ML workflows, supporting CI/CD by triggering retraining and deployments based on code changes or new data arrivals.
    • CI/CD automation includes not only code unit tests but also automated monitoring of metrics such as accuracy, drift, and bias thresholds to qualify models for deployment.
    • Monitoring features (like Model Monitor) provide ongoing performance assessments, alerting stakeholders to significant changes or issues.
    Integrations and Deployment Flexibility
    • SageMaker supports integration with Kubernetes via EKS, allowing teams to leverage universal orchestration for containerized ML workloads across cloud providers or hybrid environments.
    • The SageMaker Neo service optimizes and packages trained models for deployment to edge devices, mobile hardware, and AWS Lambda, reducing runtime footprint and syncing updates as new models become available.
    Cloud-Native AWS ML Services
    • AWS offers a variety of cloud-native services for common ML tasks, accessible via REST or SDK calls and managed by AWS, eliminating custom model development and operations overhead.
      • Comprehend for document clustering, sentiment analysis, and other NLP tasks.
      • Forecast for time series prediction.
      • Fraud Detector for transaction monitoring.
      • Lex for chatbot workflows.
      • Personalize for recommendation systems.
      • Poly for text-to-speech conversion.
      • Textract for OCR and data extraction from complex documents.
      • Translate for machine translation.
      • Panorama for computer vision on edge devices.
    • These services continuously improve as AWS retrains and updates their underlying models, transferring benefits directly to customers without manual intervention.
    Application Example: Migrating to SageMaker and AWS Services
    • When building features such as document clustering, question answering, or recommendations, first review whether cloud-native services like Comprehend can fulfill requirements prior to investing in custom ML models.
    • For custom NLP tasks not available in AWS services, use SageMaker to manage model deployment (e.g., deploying pre-trained Hugging Face Transformers for summarization or embeddings).
    • Batch inference and feature extraction jobs can be triggered using SageMaker automation and event notifications, supporting modular, scalable, and microservices-friendly architectures.
    • Tabular prediction and feature importance can be handled by pipe-lining data from relational stores through SageMaker Autopilot or traditional algorithms such as XGBoost.
    • Recommendation workflows can combine embeddings, neural networks, and event triggers, with SageMaker handling monitoring, scaling, and retraining in response to user feedback and data drift.
    General Usage Guidance and Strategy
    • Employ AWS cloud-native services where possible to minimize infrastructure management and accelerate feature delivery.
    • Use SageMaker JumpStart and Autopilot to jump ahead in common ML scenarios, falling back to custom code and containers only when unique use cases demand.
    • Leverage SageMaker tools for pipeline orchestration, monitoring, retraining, and model deployment to ensure scalable, maintainable, and up-to-date ML workflows.
    Useful Links
    • MadeWithML overview & ML tutorials
    • SageMaker Home
    • SageMaker JumpStart
    • SageMaker Model Deployment
    • SageMaker Pipelines
    • SageMaker Model Monitor
    • SageMaker Kubernetes Integration
    • SageMaker Neo
    1 hr 1 min