惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
F
Full Disclosure
A
About on SuperTechFans
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
Know Your Adversary
Know Your Adversary
K
Kaspersky official blog
L
LINUX DO - 热门话题
Recorded Future
Recorded Future
C
Cisco Blogs
M
MIT News - Artificial intelligence
T
Tenable Blog
G
GRAHAM CLULEY
月光博客
月光博客
Recent Announcements
Recent Announcements
V
Visual Studio Blog
IT之家
IT之家
T
The Exploit Database - CXSecurity.com
The GitHub Blog
The GitHub Blog
T
Threat Research - Cisco Blogs
D
DataBreaches.Net
P
Privacy International News Feed
P
Proofpoint News Feed
I
Intezer
博客园 - 叶小钗
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Hacker News
The Hacker News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - Franky
SecWiki News
SecWiki News
宝玉的分享
宝玉的分享
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
小众软件
小众软件
Hacker News - Newest:
Hacker News - Newest: "LLM"
O
OpenAI News
N
News and Events Feed by Topic
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic
The Cloudflare Blog
Spread Privacy
Spread Privacy
酷 壳 – CoolShell
酷 壳 – CoolShell
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
B
Blog RSS Feed

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
The Machine Learning Lifecycle: 10 Steps From Problem to Production (And Why Most Projects Fail at Step 3)
Ege Pakten · 2026-04-25 · via DEV Community

Every ML tutorial jumps straight to model training. But in the real world, training is step 7 out of 10 — and the steps before it are where projects succeed or fail. This post walks through the full Machine Learning Lifecycle, from defining your problem to keeping your model healthy in production, with real examples and practical advice at every stage.


The Big Picture

Machine Learning is an iterative and structured process. It's not "throw data at an algorithm and hope for magic." It's a cycle — and most teams loop through it multiple times before they get something that works in production.

Here are the 10 stages:

1. Problem Definition → 2. Data Collection → 3. Data Cleaning & Preprocessing
→ 4. Exploratory Data Analysis (EDA) → 5. Feature Engineering & Selection
→ 6. Model Selection → 7. Model Training → 8. Model Evaluation & Tuning
→ 9. Model Deployment → 10. Monitoring & Maintenance → (back to 1)

Enter fullscreen mode Exit fullscreen mode

Let's go through each one.


1. Problem Definition — "What are we actually solving?"

This is where most failed ML projects go wrong. Before touching any data or code, you need to answer:

  • What business problem am I solving? Not "I want to use AI," but "I want to reduce customer churn by 15%" or "I want to detect fraudulent transactions in real time."
  • Is ML even the right tool? Sometimes a simple rule-based system or a SQL query is better. ML is expensive overkill for problems that have clear, deterministic rules.
  • What does success look like? Define a measurable metric: accuracy, precision, recall, revenue impact, latency requirements.
  • What type of ML problem is this? Classification? Regression? Clustering? Recommendation? This dictates everything downstream.

The problem definition dictates the type of data you need. If you define the problem wrong, you'll collect the wrong data, build the wrong model, and ship something nobody wanted.

Example: A bank wants to "use AI." That's not a problem definition. "Predict which credit card transactions are fraudulent with less than 0.1% false positive rate and under 200ms latency" — that's a problem definition.


2. Data Collection — "Do we have enough?"

Once you know what you're solving, you need data. This step is about gathering enough high-quality, relevant data to train a model.

Key questions:

  • Where does the data come from? Internal databases, APIs, web scraping, third-party vendors, public datasets, user-generated content?
  • How much data do I need? Depends on complexity. A simple classifier might need 1,000 examples. A computer vision model might need 100,000+ labeled images. An LLM needs billions of tokens.
  • Is the data labeled? For supervised learning, you need labels (the "right answers"). Labeling is often the most expensive and time-consuming part.
  • Is the data representative? If you train a facial recognition system only on photos of one demographic, it will fail on others. Your data must represent the real-world distribution.

Common pitfalls:

  • Assuming you have "big data" when you actually have big noise
  • Not checking for sampling bias
  • Ignoring data privacy regulations (GDPR, KVKK, HIPAA)
  • Collecting too many features and not enough samples

3. Data Cleaning and Preprocessing — "Garbage in, garbage out"

This is where you spend 60-80% of your actual project time. Raw data is messy. Always.

What you're doing here:

Handling Missing Values

  • Some rows have blank fields. Do you fill them with the mean? The median? A prediction? Or drop them entirely?
  • The right answer depends on why the data is missing. "Random missing" and "systematically missing" require different approaches.

Removing Duplicates

  • Duplicate records distort your model's understanding of the distribution.

Fixing Inconsistent Data

  • "New York", "new york", "NY", "N.Y." are the same city but four different strings.
  • Date formats: "04/20/2026" vs "2026-04-20" vs "20 April 2026"
  • Units: meters vs feet, Celsius vs Fahrenheit

Handling Outliers

  • A salary dataset where most values are $40K-$120K but one entry says $99,999,999. Is it real or a typo? Outliers can destroy model performance or provide critical signal — you have to decide.

Data Type Conversions

  • Categorical variables need encoding (one-hot, label encoding)
  • Text needs tokenization
  • Images need resizing, normalization
  • Dates need feature extraction (day of week, month, holiday flag)

Normalization and Scaling

  • Features on different scales (age: 0-100, salary: 20,000-500,000) can bias models that use distance calculations. Standard scaling (z-score) or min-max scaling fixes this.

The motto: garbage in, garbage out. No model, no matter how sophisticated, can learn good patterns from bad data.


4. Exploratory Data Analysis (EDA) — "What does the data actually look like?"

Before building any model, you need to understand your data. EDA is about getting the big picture.

What you're looking for:

  • Distributions — Is your target variable balanced? If 99% of transactions are legitimate and 1% are fraud, you have a class imbalance problem.
  • Correlations — Which features are related to each other? Which features predict your target?
  • Patterns and trends — Seasonal effects? Time-based shifts? Geographic clusters?
  • Data quality issues you missed in step 3 — Sometimes problems only become visible in visualization.

Tools: histograms, scatter plots, correlation matrices, box plots, pair plots. Libraries: Pandas, Matplotlib, Seaborn, Plotly.

Example: You're building a house price predictor. EDA reveals that "number of bedrooms" and "square footage" are highly correlated (0.92). Including both might cause multicollinearity. You might drop one or combine them.

EDA often sends you back to step 2 or 3 — you realize you need more data, or your data has problems you didn't see before.


5. Feature Engineering and Selection — "Good features > fancy models"

This is often the difference between a mediocre model and a great one. Feature engineering is the art of creating new input variables that help the model learn patterns better.

Feature Engineering (Creating)

  • From dates: extract day_of_week, is_weekend, month, quarter, days_since_last_event
  • From text: word count, sentiment score, TF-IDF values, embeddings
  • From location: distance to nearest city, population density, latitude buckets
  • Combining features: price_per_sqft = price / square_footage, BMI = weight / height²
  • Domain knowledge: a doctor knows that "blood pressure × age" interaction matters; encode that

Feature Selection (Removing)

Not all features help. Some add noise. Too many features cause overfitting and slow training. Techniques:

  • Correlation analysis — drop features that are highly correlated with each other
  • Feature importance from tree-based models (Random Forest, XGBoost)
  • Recursive Feature Elimination (RFE) — iteratively remove the least important feature
  • L1 Regularization (Lasso) — automatically zeroes out unimportant features during training

Key insight: a simple model with great features almost always beats a complex model with bad features.


6. Model Selection — "Choose the right tool for the job"

Now you pick which algorithm(s) to try. This depends on:

  • Problem type: Classification → Logistic Regression, Random Forest, SVM, Neural Network. Regression → Linear Regression, XGBoost, Neural Network. Clustering → K-Means, DBSCAN. Sequence → RNN, LSTM, Transformer.
  • Data size: Small data → simpler models (logistic regression, SVM). Large data → deep learning can shine.
  • Interpretability needs: Healthcare and finance often need explainable models (decision trees, linear models). Recommendation engines can afford black boxes (deep learning).
  • Latency requirements: Real-time inference needs fast models. Batch processing can afford slower ones.

Best practice: Start simple. Try logistic regression or a decision tree first. If it gets 85% accuracy, you have a strong baseline. Then try more complex models and see if the improvement justifies the complexity.

You often try 3-5 different models and compare their performance.


7. Model Training — "The model learns about the data"

This is the step everyone thinks ML is about — but as you've seen, it's step 7 of 10.

Training means:

  • Feed data into the algorithm — the model sees examples and adjusts its internal parameters (weights) to minimize error
  • Split data into train/validation/test sets — typically 70/15/15 or 80/10/10. Never evaluate on data the model trained on.
  • Choose a loss function — the mathematical definition of "what is wrong." Cross-entropy for classification, MSE for regression, etc.
  • Set hyperparameters — learning rate, batch size, epochs, regularization strength. These are not learned by the model; you set them.
  • Iterate — training is rarely one-shot. You train, look at results, adjust, retrain.

Key concept: train/test split. If you evaluate your model on the same data it trained on, you get misleadingly high scores. It's like grading a student using the exact exam questions they practiced on.


8. Model Evaluation and Tuning — "How is your model doing?"

Training is done. Now: is the model actually good?

Evaluation Metrics

Different problems need different metrics:

  • Accuracy — % of correct predictions. Misleading with imbalanced data (99% accuracy on fraud detection means nothing if you just predict "not fraud" every time).
  • Precision — Of all things the model flagged as positive, how many were actually positive?
  • Recall — Of all actual positives, how many did the model catch?
  • F1 Score — Harmonic mean of precision and recall. Good when you need to balance both.
  • AUC-ROC — Area under the curve. Measures how well the model separates classes across all thresholds.
  • MSE / RMSE / MAE — For regression: how far off are predictions from actual values?

Hyperparameter Tuning

If results aren't good enough, adjust hyperparameters:

  • Grid Search — try every combination of predefined values
  • Random Search — randomly sample combinations (often faster than grid search)
  • Bayesian Optimization — smart search that learns from previous trials

Dealing with Problems

  • Overfitting (training score high, test score low) → more data, simpler model, regularization, dropout
  • Underfitting (both scores low) → more complex model, more features, longer training
  • Class imbalance → oversampling (SMOTE), undersampling, class weights, different metrics

This step often sends you back to steps 3, 4, 5, or 6. That's the iterative nature of ML.


9. Model Deployment — "Integrate model to the real world"

Your model works in a Jupyter notebook. Now it needs to work in production — handling real users, real data, and real scale.

Deployment means:

  • Packaging the model — save weights, serialize with ONNX, TorchScript, or pickle
  • Creating an API — wrap the model in a REST API (Flask, FastAPI) or gRPC endpoint
  • Infrastructure — where does it run? AWS SageMaker, Google Vertex AI, Azure ML, self-hosted Kubernetes, or edge devices?
  • Scaling — handle 10 requests/second? 10,000? Auto-scaling, load balancing, caching
  • CI/CD for ML — automated testing, model versioning, rollback capabilities

Common deployment patterns:

  • Real-time inference — API call, response in milliseconds (fraud detection, chatbot)
  • Batch inference — process large datasets periodically (weekly churn predictions, nightly recommendations)
  • Edge deployment — model runs on device (mobile app, IoT sensor, self-driving car)

Deployment is NOT the finish line. It's where the real work begins.


10. Monitoring and Maintenance — "Keep model healthy"

A deployed model is a living system. It degrades over time because the real world changes.

What to Monitor

  • Model performance — are accuracy/precision/recall staying stable?
  • Data drift — is incoming data different from training data? (seasonal changes, new user demographics, market shifts)
  • Concept drift — has the relationship between features and target changed? (what predicted churn in 2023 might not in 2026)
  • Latency — is inference speed within requirements?
  • Resource usage — CPU, memory, cost

When to Retrain

  • Performance drops below a threshold
  • Data distribution shifts significantly
  • Business requirements change
  • New data categories appear that the model has never seen

Best Practices

  • Set up automated alerts for performance degradation
  • Keep a champion/challenger system: new model version runs alongside the old one; switch only when the new one proves better
  • Log everything: predictions, input data, confidence scores. You'll need this for debugging.
  • Version your models like you version code. Know exactly which model version produced which prediction.

Monitoring is vital. A model that was 95% accurate at launch can silently drop to 70% if nobody's watching.


Summary — The Key Takeaways

ML is an iterative and structured process. It's a cycle, not a line. You will loop back to earlier steps repeatedly — that's normal, not failure.

Data quality and feature engineering are critical. Steps 3 and 5 have more impact on final model performance than the choice of algorithm at step 6. Good features beat fancy models.

Evaluation and tuning improve model performance. Don't ship the first model that trains. Rigorously evaluate, tune hyperparameters, and test on data the model has never seen.

Deployment isn't the end; monitoring is vital. The real world changes. Your model will degrade. Monitor, retrain, and iterate continuously.

The lifecycle is a loop. The best ML teams are the ones that spin through it fastest — not the ones with the fanciest models.


*If this helped you see the full picture of ML beyond "just training," drop a reaction.