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

推荐订阅源

博客园 - Franky
J
Java Code Geeks
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
L
LangChain Blog
WordPress大学
WordPress大学
A
About on SuperTechFans
Martin Fowler
Martin Fowler
月光博客
月光博客
Y
Y Combinator Blog
U
Unit 42
D
Docker
Recent Announcements
Recent Announcements
Hugging Face - Blog
Hugging Face - Blog
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

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
AI-Generated Code Looked Right, but the Data Was Wrong
Piotr · 2026-05-05 · via DEV Community

Piotr

I'm working on an AI Data Analyst in MLJAR Studio.

The idea is simple: you ask a question in natural language, AI writes Python code, executes it, and shows the result.

But recently I found a small example that reminded me why AI data analysis needs more than code generation.

The code worked

I was testing a medical data analysis use case with a diabetes CSV file.

The first task was simple:

load data from this URL

AI generated Pandas code with read_csv().

The code executed without errors.

The dataframe was displayed.

The shape looked correct: 768 rows and 9 columns.

So everything looked fine.

But then I looked at the dataframe.

148 pregnancies?

In the first row, the Pregnancies column had value 148.

That immediately looked wrong.

Values like 0, 1, 2, 6, or 8 make sense for number of pregnancies.

But 148?

No.

Then I noticed more strange things:

  • Pregnancies had values like 148, 85, 183
  • Age had values like 0 and 1
  • Outcome was empty
  • the whole dataframe looked shifted

The code worked, but the data was wrong.

AI also checked the output

In MLJAR Studio, my AI Data Analyst is not a one-step workflow.

It doesn't only:

  1. generate code
  2. execute code
  3. show result

After the code is executed, there is another step. The LLM analyzes the generated output.

So AI doesn't only ask:

Did the code run?

It also asks:

Does the output make sense?

In this case, AI also noticed that something was wrong. It found suspicious values, missing values in the last column, and strange statistics.

This was very useful because Pandas didn't raise an error. The dataframe was created. But the output was incorrect.

What happened?

The CSV had a small formatting issue: an extra comma in the header row.

Because of that, Pandas treated the first value in each row as the dataframe index.

So the columns were shifted.

The value 148 was not the number of pregnancies. It was the glucose value.

That is why Glucose appeared as Pregnancies, Outcome appeared as Age, and the real Outcome column was empty.

The lesson

This example is small, but the lesson is important.

AI-generated code can look correct.

The notebook can run without errors.

The dataframe can be displayed.

And the data can still be wrong.

That is why AI data analysis needs output verification.

We need a human in the loop, because humans can use common sense. In this case, 148 pregnancies was clearly impossible.

But AI in the loop is helpful as well. AI can scan the output, check basic statistics, and warn us about suspicious values.

For me, the best workflow is:

  1. ask AI to generate code
  2. execute the code
  3. display the output
  4. let AI inspect the output
  5. let the human review the result

AI can help us move faster.

But in data analysis, the real question is not:

Did the code run?

It is:

Does the output make sense?