<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ProTechSC Academy</title>
    <description>The latest articles on DEV Community by ProTechSC Academy (@protechscacademy).</description>
    <link>https://dev.to/protechscacademy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2632558%2F22a1983b-ab91-4af4-81e0-8e799f5f7fe7.png</url>
      <title>DEV Community: ProTechSC Academy</title>
      <link>https://dev.to/protechscacademy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/protechscacademy"/>
    <language>en</language>
    <item>
      <title>Arrow Flight moved 6 million rows 4.4x faster than JDBC, and it sent no fewer bytes</title>
      <dc:creator>ProTechSC Academy</dc:creator>
      <pubDate>Tue, 24 Nov 2026 13:43:01 +0000</pubDate>
      <link>https://dev.to/protechscacademy/arrow-flight-moved-6-million-rows-44x-faster-than-jdbc-and-it-sent-no-fewer-bytes-515d</link>
      <guid>https://dev.to/protechscacademy/arrow-flight-moved-6-million-rows-44x-faster-than-jdbc-and-it-sent-no-fewer-bytes-515d</guid>
      <description>&lt;p&gt;How long does it take to move a query result from a data service into another program's memory? We moved the &lt;strong&gt;same results six ways&lt;/strong&gt; into a fresh client process and timed each one:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;CSV text over HTTP&lt;/strong&gt; from an Apache DataFusion 55.0.0 service&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Arrow Flight, one stream&lt;/strong&gt;, from the same service&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Arrow Flight, four streams&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JDBC&lt;/strong&gt; (Java) from PostgreSQL 18.7&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A Python DB-API driver&lt;/strong&gt; (psycopg2) from PostgreSQL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ADBC&lt;/strong&gt; from PostgreSQL (binary COPY straight into Arrow arrays)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; TPC-H &lt;code&gt;lineitem&lt;/code&gt; (6,001,215 rows) and the NYC taxi trips of January 2024 (2,964,624 rows).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Queries:&lt;/strong&gt; seven, from 4 rows (TPC-H Q1) to the whole table.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finish line:&lt;/strong&gt; every run ends with the whole result as typed columns in the client's memory, not just bytes received.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measured:&lt;/strong&gt; transfer time, client and service CPU, memory, and bytes on the wire.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Answer check:&lt;/strong&gt; all &lt;strong&gt;251 runs&lt;/strong&gt; matched a reference computed by &lt;strong&gt;DuckDB&lt;/strong&gt; from the Parquet files.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Client and services ran on one standard laptop over the loopback interface. This compares the exchange paths, not network speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results: the whole lineitem table
&lt;/h2&gt;

&lt;p&gt;Mean of 3 runs, 6,001,215 rows into client memory:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Client CPU (s)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Arrow Flight, 4 streams&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;560 ms&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2.41&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arrow Flight, 1 stream&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2.41 s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2.84&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CSV over HTTP&lt;/td&gt;
&lt;td&gt;4.56 s&lt;/td&gt;
&lt;td&gt;5.67&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ADBC (PostgreSQL)&lt;/td&gt;
&lt;td&gt;6.18 s&lt;/td&gt;
&lt;td&gt;2.68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JDBC (Java)&lt;/td&gt;
&lt;td&gt;10.7 s&lt;/td&gt;
&lt;td&gt;18.17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DB-API (psycopg2)&lt;/td&gt;
&lt;td&gt;23.3 s&lt;/td&gt;
&lt;td&gt;18.80&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Over the four large results, as geometric means relative to one Flight stream: CSV &lt;strong&gt;2.6x&lt;/strong&gt; slower, ADBC &lt;strong&gt;3.9x&lt;/strong&gt;, JDBC &lt;strong&gt;5.9x&lt;/strong&gt;, psycopg2 &lt;strong&gt;12.1x&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Arrow was not smaller on the wire
&lt;/h2&gt;

&lt;p&gt;We expected Arrow to win by sending fewer bytes. It did not:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Per lineitem row: CSV &lt;strong&gt;135 bytes&lt;/strong&gt;, Arrow Flight &lt;strong&gt;137&lt;/strong&gt;, JDBC and psycopg2 &lt;strong&gt;180&lt;/strong&gt;, ADBC &lt;strong&gt;188&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;On the six numeric columns, CSV was even smaller than Arrow (35 vs 48 bytes per row). Arrow sends its in-memory layout, a fixed 8 bytes per number, while short numbers as text take fewer bytes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Arrow's speed comes from not having to parse.&lt;/strong&gt; The row and text paths spend their CPU converting every value: parsing text, building Java or Python objects, then building columns. The Arrow paths hand over buffers.&lt;/p&gt;

&lt;h2&gt;
  
  
  You can get Arrow without changing the database
&lt;/h2&gt;

&lt;p&gt;ADBC read the &lt;strong&gt;same PostgreSQL tables&lt;/strong&gt; as JDBC and psycopg2, but through binary COPY into Arrow arrays:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;6.18 s against 10.7 s (JDBC) and 23.3 s (psycopg2)&lt;/li&gt;
&lt;li&gt;2.68 s of client CPU against 18.17 s and 18.80 s&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Small results are a different story
&lt;/h2&gt;

&lt;p&gt;For about 10 thousand rows, Flight took 56 ms and CSV 68 ms, but all three PostgreSQL paths took about &lt;strong&gt;600-740 ms&lt;/strong&gt;. Almost all of that is fixed cost: a PostgreSQL connection starts a new server process on Windows, and the drivers read type information first.&lt;/p&gt;

&lt;p&gt;A simple fitted model (time = fixed cost + rows x per-row cost) shows it clearly:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Fixed cost&lt;/th&gt;
&lt;th&gt;Per row&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Arrow Flight, 1 stream&lt;/td&gt;
&lt;td&gt;58 ms&lt;/td&gt;
&lt;td&gt;0.39 us&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CSV over HTTP&lt;/td&gt;
&lt;td&gt;54 ms&lt;/td&gt;
&lt;td&gt;0.75 us&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ADBC (PostgreSQL)&lt;/td&gt;
&lt;td&gt;589 ms&lt;/td&gt;
&lt;td&gt;0.93 us&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JDBC (Java)&lt;/td&gt;
&lt;td&gt;614 ms&lt;/td&gt;
&lt;td&gt;1.69 us&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DB-API (psycopg2)&lt;/td&gt;
&lt;td&gt;597 ms&lt;/td&gt;
&lt;td&gt;3.78 us&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For TPC-H Q1 (4 rows), Flight took 103 ms and PostgreSQL 1.70-1.83 s, because PostgreSQL itself needed 1.48 s for the aggregation. &lt;strong&gt;For tiny results, the engine decides, not the exchange format.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What did not work as expected
&lt;/h2&gt;

&lt;p&gt;We varied the record-batch size on one Flight stream (2,048 to 131,072 rows). The times jumped around (1.16 s to 2.41 s for lineitem) without a clear direction, and DataFusion's default of 8,192 rows was the slowest for the text-heavy table. Four streams at 560 ms beat every batch size on one stream.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we would tell a student
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Measure "into typed columns", not "bytes received".&lt;/strong&gt; Conversion is where the time goes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separate fixed cost from per-row cost.&lt;/strong&gt; Small and large results rank the paths differently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Try ADBC before replacing a database.&lt;/strong&gt; Columnar transfer from PostgreSQL gave most of the CPU saving.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check every answer against an independent reference.&lt;/strong&gt; All 251 runs matched DuckDB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Know what was not tested:&lt;/strong&gt; two machines over a real network, ODBC (client written, not run) and Arrow Flight SQL.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;Full project, report and video: &lt;a href="https://www.protechscacademy.com/projects/big-data/columnar-data-exchange-arrow-flight-versus-jdbc-and-csv" rel="noopener noreferrer"&gt;Columnar Data Exchange: Arrow Flight versus JDBC and CSV - ProTechSC Academy&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We guide final-year and PhD research projects in engineering, AI and big data. WhatsApp +91 97907 09424.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>bigdata</category>
      <category>database</category>
      <category>python</category>
      <category>performance</category>
    </item>
    <item>
      <title>MapReduce, Hive and Spark SQL on the same 7 jobs: Spark won by 1.5x, but 58% of its time was start-up</title>
      <dc:creator>ProTechSC Academy</dc:creator>
      <pubDate>Mon, 23 Nov 2026 05:51:12 +0000</pubDate>
      <link>https://dev.to/protechscacademy/mapreduce-hive-and-spark-sql-on-the-same-7-jobs-spark-won-by-15x-but-58-of-its-time-was-4ikp</link>
      <guid>https://dev.to/protechscacademy/mapreduce-hive-and-spark-sql-on-the-same-7-jobs-spark-won-by-15x-but-58-of-its-time-was-4ikp</guid>
      <description>&lt;p&gt;How much did each generation of the Hadoop-era tools actually change? We wrote the &lt;strong&gt;same seven analyses three times&lt;/strong&gt; and ran them on the same files:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Generation 1:&lt;/strong&gt; hand-written &lt;strong&gt;Java MapReduce&lt;/strong&gt; jobs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generation 2:&lt;/strong&gt; &lt;strong&gt;HiveQL&lt;/strong&gt; on Hive 4.2.1 with its MapReduce engine&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generation 3:&lt;/strong&gt; &lt;strong&gt;Spark SQL&lt;/strong&gt; 4.3.0 on YARN&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;plus Spark in local mode as an ablation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; NASA web-server logs of 1995 and generated &lt;strong&gt;TPC-H&lt;/strong&gt; tables, at two sizes: sf1 (1.34 GB) and sf3 (4.06 GB).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jobs:&lt;/strong&gt; word count, requests per day and top 10 URLs over the logs; TPC-H &lt;strong&gt;Q1, Q6, Q3 and Q12&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Same everything:&lt;/strong&gt; the same files in HDFS (Hadoop 3.5.0, single machine, pseudo-distributed), the same YARN task slots, one fresh client command per run, timed from start to exit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Answer check:&lt;/strong&gt; every run's output was read back from HDFS and compared with &lt;strong&gt;DuckDB&lt;/strong&gt; (TPC-H) or a plain Python pass (logs).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a standard laptop, not a multi-machine cluster. The comparison is about the tools, not about cluster scaling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;At sf3 (4.06 GB), as geometric means over the seven jobs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Comparison&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Spark SQL vs hand-written MapReduce&lt;/td&gt;
&lt;td&gt;Spark SQL &lt;strong&gt;1.5x faster&lt;/strong&gt; (per job 0.9x-2.8x)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spark SQL vs Hive on MapReduce&lt;/td&gt;
&lt;td&gt;Spark SQL &lt;strong&gt;1.9x faster&lt;/strong&gt; (per job 1.3x-3.0x)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hand-written MapReduce vs Hive&lt;/td&gt;
&lt;td&gt;MapReduce &lt;strong&gt;1.3x faster&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lines of code&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;768 lines of Java&lt;/strong&gt; vs 70 lines of HiveQL and 63 of Spark SQL (&lt;strong&gt;12.2x less&lt;/strong&gt; for SQL)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Correct answers&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;119 of 119&lt;/strong&gt; runs equal to the reference&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At sf1 (1.34 GB) the picture was similar but closer: Spark SQL was 1.3x faster than MapReduce (clearly faster on 4 jobs, &lt;strong&gt;clearly slower on 2&lt;/strong&gt;) and 1.8x faster than Hive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Spark's time actually went
&lt;/h2&gt;

&lt;p&gt;The surprise was not that Spark SQL won. It was &lt;strong&gt;how much of each Spark run was not the query at all.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spark SQL on YARN spent &lt;strong&gt;13.5 s-15.2 s of every run&lt;/strong&gt; starting the YARN application master and four executors.&lt;/li&gt;
&lt;li&gt;At sf1 that start-up was on average &lt;strong&gt;58% of a Spark-on-YARN run.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Running the same queries in Spark &lt;strong&gt;local mode&lt;/strong&gt; (one JVM, no YARN) was &lt;strong&gt;1.6x faster&lt;/strong&gt; than Spark on YARN. Most of the difference is the YARN application start-up, not the query.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MapReduce and Hive pay their start-up too, just hidden inside the job: every MapReduce job is its own YARN application, so even the smallest work took at least 19.2 s per MapReduce job. That is why hand-written MapReduce suffers on queries that need &lt;strong&gt;several chained jobs&lt;/strong&gt;: TPC-H Q3 alone needs 203 lines of Java and three chained MapReduce jobs, against 9 lines of SQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Growth with data size
&lt;/h2&gt;

&lt;p&gt;From sf1 to sf3 the data grew &lt;strong&gt;3.0x&lt;/strong&gt;, but the wall time grew only &lt;strong&gt;1.3x-1.4x&lt;/strong&gt; for every engine. At these sizes fixed start-up costs dominate, and they do not grow with the data. A bigger cluster or bigger data would shift the balance; we did not test that here.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we would tell a student choosing a stack
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Write SQL first.&lt;/strong&gt; The same query text ran unchanged in Hive and Spark SQL; only the output clause differed. It was 12.2x less code than MapReduce, with identical answers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure start-up separately.&lt;/strong&gt; On small and medium data, start-up can be most of the run. Report it next to the query time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check every answer against an independent reference.&lt;/strong&gt; All 119 runs matched DuckDB or Python, to the cent for sums.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Know what you did not test:&lt;/strong&gt; a multi-machine cluster, Hive on Tez, and columnar formats (ORC, Parquet) were out of scope.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;Full project (Java MapReduce jobs, HiveQL and Spark SQL scripts, study harness, web app, report, video): &lt;a href="https://www.protechscacademy.com/projects/big-data/hadoop-mapreduce-hive-spark-sql-one-analysis-three-generations" rel="noopener noreferrer"&gt;From Hadoop MapReduce and Hive to Spark SQL - ProTechSC Academy&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We guide final-year and PhD research projects in engineering, AI and big data. WhatsApp +91 97907 09424.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>bigdata</category>
      <category>hadoop</category>
      <category>spark</category>
      <category>sql</category>
    </item>
    <item>
      <title>Our data-analyst agent lost to a single prompt: 0.55 vs 0.70 on DABench with a 1.5B model</title>
      <dc:creator>ProTechSC Academy</dc:creator>
      <pubDate>Wed, 18 Nov 2026 15:36:24 +0000</pubDate>
      <link>https://dev.to/protechscacademy/our-data-analyst-agent-lost-to-a-single-prompt-055-vs-070-on-dabench-with-a-15b-model-ohk</link>
      <guid>https://dev.to/protechscacademy/our-data-analyst-agent-lost-to-a-single-prompt-055-vs-070-on-dabench-with-a-15b-model-ohk</guid>
      <description>&lt;p&gt;We built a &lt;strong&gt;data-analyst agent&lt;/strong&gt;: it reads a question about a CSV file, plans the analysis, writes pandas code, runs it in a sandbox, reads the error if something breaks, and repairs its own code. It is the kind of loop most agent tutorials recommend.&lt;/p&gt;

&lt;p&gt;Then we compared it with the simplest possible baseline: &lt;strong&gt;ask the same model once for a program, run it, done.&lt;/strong&gt; The one-shot baseline won, &lt;strong&gt;0.70 vs 0.55&lt;/strong&gt;. This post explains how we measured that and why it happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  The benchmark
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DABench&lt;/strong&gt; (the InfiAgent data-analysis benchmark): questions such as "what is the mean fare of passengers with missing age?" with closed-form answers and a required answer format.&lt;/li&gt;
&lt;li&gt;We used &lt;strong&gt;40 evaluation questions&lt;/strong&gt; drawn with a fixed seed (16 easy, 12 medium, 12 hard) and &lt;strong&gt;8 separate DEV questions&lt;/strong&gt; for design decisions. Every number below is on the 40 EVAL questions.&lt;/li&gt;
&lt;li&gt;Model: &lt;strong&gt;qwen2.5-coder 1.5B&lt;/strong&gt; (Q4_K_M) served by Ollama, temperature 0, 8k context. The agent framework is &lt;strong&gt;Pydantic AI&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Each question is scored on exact sub-answers, with a 95% bootstrap CI and paired comparisons on the same questions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Six configurations
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configuration&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Direct answer&lt;/td&gt;
&lt;td&gt;The LLM answers from the question text, no code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Keyword templates&lt;/td&gt;
&lt;td&gt;A classical rule-based solver, no LLM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Single-shot code&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;One LLM call writes a program; we run it once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent v1 (tool calls)&lt;/td&gt;
&lt;td&gt;The agent must &lt;em&gt;call&lt;/em&gt; &lt;code&gt;run_python&lt;/code&gt; and other tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Agent v2 (main)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Plan-and-execute; the reply &lt;em&gt;is&lt;/em&gt; a program, failed runs are fed back for up to 3 repairs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent without self-repair&lt;/td&gt;
&lt;td&gt;v2, but a failed run ends the attempt&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configuration&lt;/th&gt;
&lt;th&gt;Accuracy [95% CI]&lt;/th&gt;
&lt;th&gt;easy / medium / hard&lt;/th&gt;
&lt;th&gt;Tokens per question&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Direct answer&lt;/td&gt;
&lt;td&gt;0.025 [0.00, 0.08]&lt;/td&gt;
&lt;td&gt;0.06 / 0.00 / 0.00&lt;/td&gt;
&lt;td&gt;702&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Keyword templates&lt;/td&gt;
&lt;td&gt;0.300 [0.15, 0.45]&lt;/td&gt;
&lt;td&gt;0.75 / 0.00 / 0.00&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent v1 (tool calls)&lt;/td&gt;
&lt;td&gt;0.225 [0.10, 0.35]&lt;/td&gt;
&lt;td&gt;0.19 / 0.33 / 0.17&lt;/td&gt;
&lt;td&gt;6,775&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent without self-repair&lt;/td&gt;
&lt;td&gt;0.525 [0.38, 0.70]&lt;/td&gt;
&lt;td&gt;0.88 / 0.58 / 0.00&lt;/td&gt;
&lt;td&gt;1,944&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent v2 (main)&lt;/td&gt;
&lt;td&gt;0.550 [0.40, 0.70]&lt;/td&gt;
&lt;td&gt;0.88 / 0.67 / 0.00&lt;/td&gt;
&lt;td&gt;5,030&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Single-shot code&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.700 [0.55, 0.85]&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0.94 / 0.67 / &lt;strong&gt;0.42&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;897&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxs4jqr9yixgqsvlpib0y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxs4jqr9yixgqsvlpib0y.png" alt="Accuracy with 95% bootstrap intervals on the 40 EVAL questions" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Accuracy with 95% bootstrap intervals on the 40 EVAL questions&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;On the same 40 questions, the agent minus single-shot difference is &lt;strong&gt;−0.15 [−0.275, −0.025]&lt;/strong&gt;. The agent won 1 question and lost 7 (sign test p = 0.07). So the gap is consistent in direction, but 40 questions are not enough to call it significant at 5%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the agent lost
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. The 1.5B model could not drive a tool-calling loop.&lt;/strong&gt; In agent v1, 18 of the 40 questions failed because the model never actually ran any code: it wrote tool calls as plain JSON text, echoed the framework's retry prompt, or left chat-template fragments in its code. We added small, documented shims for each of these, and it still reached only 0.225.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Self-repair mostly went in circles.&lt;/strong&gt; Agent v2 lets the model see its traceback and try again. On these questions that added only &lt;strong&gt;+0.025&lt;/strong&gt; over the same agent without repair (one extra correct answer). The most common v2 failure was a &lt;strong&gt;repair loop&lt;/strong&gt;: 15 questions where the model kept fixing one error and introducing another until the 3-repair limit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The hard questions need one clean program, not many patches.&lt;/strong&gt; Single-shot code solved 5 of 12 hard questions. Both agent versions with plan-and-execute solved none. Splitting a hard question into steps gave the small model more places to go wrong.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkfreemqhroe4vel1lsxd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkfreemqhroe4vel1lsxd.png" alt="Why each configuration failed — no code run, repair loops and execution errors" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Why each configuration failed — no code run, repair loops and execution errors&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. It costs more.&lt;/strong&gt; The main agent used about &lt;strong&gt;5.6× the tokens&lt;/strong&gt; and &lt;strong&gt;3.3× the time&lt;/strong&gt; of single-shot code for lower accuracy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2k6lihe5vjvuh1lz6nx2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2k6lihe5vjvuh1lz6nx2.png" alt="Tokens per question against accuracy — single-shot code is cheapest and most accurate here" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Tokens per question against accuracy — single-shot code is cheapest and most accurate here&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A caveat we report against ourselves
&lt;/h2&gt;

&lt;p&gt;Agent v2's "reply is a program" protocol was designed &lt;strong&gt;after&lt;/strong&gt; we saw v1 fail on the EVAL questions. That makes v2's 0.55 an &lt;strong&gt;optimistic&lt;/strong&gt; number, and we label it that way in the report. Even with that advantage, it did not catch up with single-shot code. The lesson for us: choose the agent protocol on the DEV set &lt;em&gt;before&lt;/em&gt; the evaluation run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Safety of the sandbox
&lt;/h2&gt;

&lt;p&gt;Generated code runs in a fresh &lt;code&gt;python -I&lt;/code&gt; subprocess in a temporary folder, with a 30-second timeout, a 1 MB CSV limit and an allow-list of three tools. That guards against accidents. It is &lt;strong&gt;not&lt;/strong&gt; a security boundary for hostile code, and we say so in the README.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Always run the boring baseline.&lt;/strong&gt; Here, "generate one program and run it" beat the agent loop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent loops need a model that can follow them.&lt;/strong&gt; A 1.5B model on a laptop can write useful pandas, but not reliably call tools or repair code over several turns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure cost next to accuracy.&lt;/strong&gt; Tokens and seconds per question belong in the results table.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pick the protocol on DEV, report EVAL once.&lt;/strong&gt; Otherwise label the result optimistic.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These results are for a small local model. A larger model may well reverse the ranking; we have not tested that here.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Full project (Pydantic AI agent, sandbox, trace viewer web app, MATLAB version, report): &lt;a href="https://www.protechscacademy.com/projects/agent-development/data-analyst-agent-with-code-execution-and-self-correction" rel="noopener noreferrer"&gt;Data analyst agent with code execution and self-correction — ProTechSC Academy&lt;/a&gt;. Video walkthrough: &lt;a href="https://youtu.be/y9vpE8hbuhk" rel="noopener noreferrer"&gt;youtu.be/y9vpE8hbuhk&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We guide final-year and PhD research projects in engineering, AI and AI agents. WhatsApp +91 97907 09424.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>python</category>
      <category>agents</category>
    </item>
    <item>
      <title>Our variant classifier scored ROC-AUC 0.995 — here's why that number is mostly the easy part</title>
      <dc:creator>ProTechSC Academy</dc:creator>
      <pubDate>Mon, 16 Nov 2026 17:10:05 +0000</pubDate>
      <link>https://dev.to/protechscacademy/our-variant-classifier-scored-roc-auc-0995-heres-why-that-number-is-mostly-the-easy-part-4e9n</link>
      <guid>https://dev.to/protechscacademy/our-variant-classifier-scored-roc-auc-0995-heres-why-that-number-is-mostly-the-easy-part-4e9n</guid>
      <description>&lt;p&gt;Classifying a genetic variant as &lt;strong&gt;pathogenic&lt;/strong&gt; (disease-causing) or &lt;strong&gt;benign&lt;/strong&gt; is a classic machine-learning task in genomics. Our XGBoost model reached an ROC-AUC of &lt;strong&gt;0.995&lt;/strong&gt; on genes it had never seen. That sounds almost perfect, but &lt;strong&gt;most of that score comes from variants that are easy to call&lt;/strong&gt;. This post looks at where the difficulty actually lies.&lt;/p&gt;

&lt;h2&gt;
  
  
  The data: real ClinVar labels, real population frequencies
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Labels&lt;/strong&gt; come from &lt;strong&gt;ClinVar&lt;/strong&gt; (GRCh38 VCF, release 19 October 2026, 4.6 million records). We kept germline variants of up to 50 bp, in a single gene, with at least one review star. From these we drew a seeded random sample of &lt;strong&gt;25,000 pathogenic/likely pathogenic and 25,000 benign/likely benign&lt;/strong&gt; variants across 6,531 genes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Population allele frequencies&lt;/strong&gt; (gnomAD, TOPMed, ALFA, 1000 Genomes) come from &lt;strong&gt;dbSNP&lt;/strong&gt; via NCBI E-utilities. &lt;strong&gt;Gene constraint&lt;/strong&gt; scores (pLI, LOEUF) come from gnomAD.&lt;/li&gt;
&lt;li&gt;We built &lt;strong&gt;58 features&lt;/strong&gt; in total: allele frequencies, molecular consequence, variant type and length, intron offset, protein position, and the amino-acid change (Grantham distance, BLOSUM62, hydropathy, volume, charge).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We &lt;strong&gt;deliberately left out&lt;/strong&gt; ClinVar review status, submitter count and dbSNP clinical significance. Each of these partly &lt;em&gt;is&lt;/em&gt; the label, so including them would leak the answer into the model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Split by gene, not by variant
&lt;/h2&gt;

&lt;p&gt;If variants are split at random, the model sees other variants of the &lt;em&gt;same gene&lt;/em&gt; during training. It can then learn "variants in gene X are usually pathogenic" instead of learning anything about the variant itself. Our main test therefore uses &lt;strong&gt;673 genes that never appear in training&lt;/strong&gt; (a 70/15/15 split by gene). We also ran a random split and a &lt;strong&gt;temporal split&lt;/strong&gt; that tests on the newest 15% of ClinVar submissions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Headline results on unseen genes
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;ROC-AUC&lt;/th&gt;
&lt;th&gt;MCC&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ACMG-style rule score&lt;/td&gt;
&lt;td&gt;0.975&lt;/td&gt;
&lt;td&gt;0.44&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Logistic regression&lt;/td&gt;
&lt;td&gt;0.993&lt;/td&gt;
&lt;td&gt;0.93&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SVM (RBF)&lt;/td&gt;
&lt;td&gt;0.991&lt;/td&gt;
&lt;td&gt;0.93&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;XGBoost&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.995&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.94&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XGBoost + SVM stacked&lt;/td&gt;
&lt;td&gt;0.995&lt;/td&gt;
&lt;td&gt;0.94&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The stacked ensemble did &lt;strong&gt;not&lt;/strong&gt; beat XGBoost alone: the difference was +0.0001, with a 95% CI of [−0.0000, +0.0002]. We kept the simpler model.&lt;/p&gt;

&lt;p&gt;Look at the first row. &lt;strong&gt;A transparent rule score already reaches an AUC of 0.975.&lt;/strong&gt; That is the first hint that the overall number is inflated by easy cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it is easy, and where it is hard
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fka58uwflmhojzunh77mk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fka58uwflmhojzunh77mk.png" alt="Test ROC-AUC by subgroup — the overall 0.995 hides much weaker groups" width="799" height="370"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Test ROC-AUC by subgroup — the overall 0.995 hides much weaker groups&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Null variants&lt;/strong&gt; (nonsense, frameshift, canonical splice) are 99.7% pathogenic in the test set.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Synonymous variants&lt;/strong&gt; are 99.6% benign.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Common variants&lt;/strong&gt; are almost always benign because of their frequency.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A model scores well on these largely by recognising the &lt;em&gt;type&lt;/em&gt; of variant. The clinically difficult group is &lt;strong&gt;missense&lt;/strong&gt; variants, where one amino acid changes:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Subgroup&lt;/th&gt;
&lt;th&gt;n&lt;/th&gt;
&lt;th&gt;XGBoost AUC&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;All test variants&lt;/td&gt;
&lt;td&gt;7,513&lt;/td&gt;
&lt;td&gt;0.995&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Missense&lt;/td&gt;
&lt;td&gt;1,065&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.930&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rare missense (AF &amp;lt; 0.1% or absent)&lt;/td&gt;
&lt;td&gt;938&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.909&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Synonymous (almost all benign)&lt;/td&gt;
&lt;td&gt;1,770&lt;/td&gt;
&lt;td&gt;0.749&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The low AUC for synonymous variants mostly reflects how few positives there are (7 out of 1,770). It doesn't make the classifier unsafe, but it shows that a &lt;strong&gt;single overall AUC hides very different sub-problems&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The feature ablation tells the same story. Removing &lt;strong&gt;population frequency&lt;/strong&gt; costs the most (AUC 0.995 → 0.991). Removing amino-acid or consequence features barely changes the overall AUC, because the overall number is dominated by the easy groups.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three zones instead of one yes/no
&lt;/h2&gt;

&lt;p&gt;A clinician needs a model that &lt;strong&gt;says when it is unsure&lt;/strong&gt;. We calibrated every model on the validation genes (Platt scaling). We then chose two thresholds that give at least &lt;strong&gt;99% precision&lt;/strong&gt; on the pathogenic side and &lt;strong&gt;99% NPV&lt;/strong&gt; on the benign side, which splits the scores into three zones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Likely pathogenic&lt;/strong&gt;, &lt;strong&gt;uncertain&lt;/strong&gt; and &lt;strong&gt;likely benign&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;On the test genes, XGBoost puts &lt;strong&gt;94.8%&lt;/strong&gt; of variants in a confident zone, with &lt;strong&gt;98.8% precision&lt;/strong&gt; on the pathogenic side and &lt;strong&gt;98.6% NPV&lt;/strong&gt; on the benign side. The rest are marked uncertain.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9eox51cz2fd9vcu0zkgw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9eox51cz2fd9vcu0zkgw.png" alt="Calibrated scores and the three decision zones" width="800" height="360"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Calibrated scores and the three decision zones&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We also scored 4,000 ClinVar &lt;strong&gt;variants of uncertain significance (VUS)&lt;/strong&gt;. The model left 2,310 of them in its own uncertain zone, called 1,116 likely pathogenic and 574 likely benign. These are hypotheses for expert review, not reclassifications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explaining every score
&lt;/h2&gt;

&lt;p&gt;Each prediction comes with exact &lt;strong&gt;TreeSHAP&lt;/strong&gt; values for XGBoost and sampled Shapley values for the SVM. Where the data allow, it also gives &lt;strong&gt;ACMG/AMP-style hints&lt;/strong&gt;: PVS1 for null variants, PM2/BA1/BS1 from allele frequency, PM4 for in-frame length changes, BP7 for synonymous variants, and PP3/BP4 from the model score itself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Febdyv5gfl7tseraiwfcl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Febdyv5gfl7tseraiwfcl.png" alt="Which features drive the XGBoost scores" width="800" height="461"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Which features drive the XGBoost scores&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;This is a &lt;strong&gt;research and teaching tool, not a clinical classifier&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;ClinVar labels are themselves partly based on frequency and variant type, so some of the "easy" cases are easy by construction.&lt;/li&gt;
&lt;li&gt;The temporal split shows a small drop (AUC 0.993), as expected for newer submissions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaways for any ML-in-biology project
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Split by the unit that leaks.&lt;/strong&gt; Here that is the gene.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remove features that are the label in disguise.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Report subgroup results.&lt;/strong&gt; An overall AUC can hide the case that matters, such as rare missense variants.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give the model an "I don't know" zone&lt;/strong&gt; and report its coverage.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;Full project (report, Python and MATLAB versions, web application with VCF batch scoring): &lt;a href="https://www.protechscacademy.com/projects/bioinformatics/pathogenic-genetic-variant-classification" rel="noopener noreferrer"&gt;Pathogenic genetic variant classification — ProTechSC Academy&lt;/a&gt;. Video walkthrough: &lt;a href="https://youtu.be/NS2jAmZVkAM" rel="noopener noreferrer"&gt;youtu.be/NS2jAmZVkAM&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We guide final-year and PhD research projects in engineering, AI and bioinformatics. WhatsApp +91 97907 09424.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>bioinformatics</category>
      <category>python</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Why a random train/test split flatters concrete-strength models (and what we did instead)</title>
      <dc:creator>ProTechSC Academy</dc:creator>
      <pubDate>Sat, 14 Nov 2026 15:26:55 +0000</pubDate>
      <link>https://dev.to/protechscacademy/why-a-random-traintest-split-flatters-concrete-strength-models-and-what-we-did-instead-k3j</link>
      <guid>https://dev.to/protechscacademy/why-a-random-traintest-split-flatters-concrete-strength-models-and-what-we-did-instead-k3j</guid>
      <description>&lt;p&gt;Predicting the compressive strength of concrete from its mix is one of the most popular machine-learning exercises in civil engineering. Most published models report an R² above 0.9. We rebuilt the problem from scratch and found that &lt;strong&gt;how you split the data matters as much as which model you pick&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The data
&lt;/h2&gt;

&lt;p&gt;We used the public &lt;strong&gt;UCI Concrete Compressive Strength&lt;/strong&gt; dataset (I-C. Yeh, 1998, CC BY 4.0). It contains 1,030 laboratory tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;8 inputs: cement, GGBS (slag), fly ash, water, superplasticizer, coarse and fine aggregate (kg/m³), and age (1–365 days)&lt;/li&gt;
&lt;li&gt;output: compressive strength, 2.3–82.6 MPa&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A detail that is easy to miss is that the 1,030 rows are only &lt;strong&gt;428 distinct mixes&lt;/strong&gt;. The same mix was tested at several ages. We also found 25 exact duplicate rows, which we removed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trap: random splits leak information
&lt;/h2&gt;

&lt;p&gt;With a random 80/20 split by &lt;strong&gt;row&lt;/strong&gt;, the same mix tested at 7 days can land in training while its 28-day result lands in the test set. The model never has to generalise to a &lt;em&gt;new&lt;/em&gt; mix. It only interpolates along an age curve it has already seen.&lt;/p&gt;

&lt;p&gt;A real engineer asks a different question: &lt;em&gt;"what will this new mix give?"&lt;/em&gt; So we compared three protocols:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Random 80/20 by row&lt;/strong&gt;, as in most papers (optimistic)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grouped 80/20 by mix&lt;/strong&gt; and &lt;strong&gt;grouped 10-fold CV&lt;/strong&gt;, where a whole mix is either in training or in test. We used this for model selection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Age extrapolation&lt;/strong&gt;: train on tests up to 28 days, predict 56–365 days&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyx41sarl5om8e1qu208o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyx41sarl5om8e1qu208o.png" alt="RMSE of 11 models under the three validation protocols" width="799" height="441"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;RMSE of 11 models under the three validation protocols&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Physics first, then machine learning
&lt;/h2&gt;

&lt;p&gt;Before any ML, we fitted a white-box baseline with only 7 parameters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Abrams' law&lt;/strong&gt; (strength falls exponentially with the water/binder ratio), with efficiency factors for slag and fly ash&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;ACI 209&lt;/strong&gt; strength-gain curve for age&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This baseline alone gives an RMSE of 7.35 MPa (R² 0.80). It is not accurate enough, but every term can be checked by a civil engineer.&lt;/p&gt;

&lt;p&gt;We then trained 10 ML models: linear, quadratic, tree, SVM, Gaussian process, random forest, boosted trees, neural network and monotonic boosted trees. Finally, we trained a &lt;strong&gt;hybrid&lt;/strong&gt;, in which the physics model gives the trend and a boosted tree learns only the correction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;strength = f_Abrams-ACI(mix, age) × exp(boosted_tree_residual(mix, age))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What we measured
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Grouped test RMSE&lt;/th&gt;
&lt;th&gt;Age-extrapolation RMSE&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Abrams-ACI physics only&lt;/td&gt;
&lt;td&gt;7.35 MPa&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Random forest&lt;/td&gt;
&lt;td&gt;4.74 MPa&lt;/td&gt;
&lt;td&gt;9.54 MPa&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Boosted trees (LSBoost)&lt;/td&gt;
&lt;td&gt;4.82 MPa&lt;/td&gt;
&lt;td&gt;8.93 MPa&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gaussian process&lt;/td&gt;
&lt;td&gt;5.40 MPa&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;5.60 MPa&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hybrid physics + boosted trees&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;4.62 MPa&lt;/strong&gt; (R² 0.92)&lt;/td&gt;
&lt;td&gt;6.03 MPa&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The pure tree models look almost as good as the hybrid on new mixes. &lt;strong&gt;Ask them about a later age and they fail&lt;/strong&gt;, because a tree cannot extrapolate beyond the ages it was trained on. The physics trend in the hybrid keeps it sensible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjyj8hv65yr1l9kd7acii.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjyj8hv65yr1l9kd7acii.png" alt="Trained up to 28 days, tested at 56–365 days" width="800" height="396"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Trained up to 28 days, tested at 56–365 days&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We also report a &lt;strong&gt;90% prediction interval (±7.7 MPa)&lt;/strong&gt; using split-conformal prediction on grouped out-of-fold residuals. It achieved 89% coverage on unseen mixes. A single "R² = 0.92" hides how uncertain any one prediction is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the model in reverse: cheaper, lower-CO₂ mixes
&lt;/h2&gt;

&lt;p&gt;Once the model is trustworthy, it can design mixes. Differential evolution searched for the cheapest or lowest-CO₂ mix for each grade, M25 to M50. The search had to satisfy these constraints:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the &lt;strong&gt;IS 10262 / IS 456 / IS 16415&lt;/strong&gt; limits: target mean strength, maximum w/b, minimum binder, and the slag and fly-ash caps&lt;/li&gt;
&lt;li&gt;the range of the training data&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;physics-consistency check&lt;/strong&gt;: the Abrams-ACI model must also agree within 7 MPa&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last constraint turned out to be essential. Without it, the optimiser found mixes where the ML model predicted 48.6 MPa but physics said 38.5 MPa. In other words, it was &lt;strong&gt;exploiting the model's errors&lt;/strong&gt; instead of finding better concrete.&lt;/p&gt;

&lt;p&gt;With the check in place, the model proposes &lt;strong&gt;22–29% lower material cost and 50–59% lower embodied CO₂&lt;/strong&gt; than a conventional OPC design. The main reason is a higher use of GGBS and fly ash.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyyodzxl81nmn2tft8e3k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyyodzxl81nmn2tft8e3k.png" alt="Conventional vs optimised mixes, M25–M50" width="799" height="287"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Conventional vs optimised mixes, M25–M50&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;These are &lt;strong&gt;model proposals&lt;/strong&gt;. They need trial batches and IS 516 cube tests before use.&lt;/li&gt;
&lt;li&gt;The dataset is from one laboratory's 1990s materials and gives &lt;strong&gt;cylinder&lt;/strong&gt; strengths, not Indian cube strengths. A local calibration is needed.&lt;/li&gt;
&lt;li&gt;Part of the cost saving comes from IS 456 durability limits, which make conventional OPC mixes stronger than needed at low grades.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaways for your own ML project
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check whether your rows are independent.&lt;/strong&gt; If they are not, split by group (here, by mix).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Start with a physics baseline.&lt;/strong&gt; It shows how much the ML actually adds, and it rescues extrapolation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Report an interval, not just R².&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When you optimise on a surrogate, guard against it being exploited.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;The full project (report, MATLAB and Python versions, web application, video walkthrough) is described on our project page: &lt;a href="https://www.protechscacademy.com/projects/civil-engineering/concrete-strength-prediction" rel="noopener noreferrer"&gt;Concrete strength prediction — ProTechSC Academy&lt;/a&gt;. A short video walkthrough: &lt;a href="https://youtu.be/Lu_MFsTvl6o" rel="noopener noreferrer"&gt;youtu.be/Lu_MFsTvl6o&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We guide final-year and PhD research projects in engineering and AI. WhatsApp +91 97907 09424.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>datascience</category>
      <category>engineering</category>
    </item>
  </channel>
</rss>
