<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ensembles on Programmer.ie: Modern AI programming</title>
    <link>http://programmer.ie/tags/ensembles/</link>
    <description>Recent content in Ensembles on Programmer.ie: Modern AI programming</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 14 Sep 2026 05:00:24 +0100</lastBuildDate>
    <atom:link href="http://programmer.ie/tags/ensembles/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>The Models Were Different. Their Mistakes Weren&#39;t</title>
      <link>http://programmer.ie/books/applied-ai/24-chapter/</link>
      <pubDate>Mon, 14 Sep 2026 05:00:24 +0100</pubDate>
      <guid>http://programmer.ie/books/applied-ai/24-chapter/</guid>
      <description>&lt;p&gt;&lt;em&gt;Part 5 — More Intelligence Is Not Automatically Better&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;seven-repairs-one-unresolved-bug&#34;&gt;Seven repairs, one unresolved bug&lt;/h2&gt;&#xA;&lt;p&gt;Open on the stubborn task, before any percentage. The problem statement asks for a function that returns the mean of the list it is given, on every call. The starter code caches its first answer and never lets go:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;average&lt;/span&gt;(xs):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;not&lt;/span&gt; hasattr(average, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;_n&amp;#39;&lt;/span&gt;):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        average&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;_n &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; len(xs)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        average&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;_s &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; sum(xs)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; average&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;_s &lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt; average&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;_n&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The reference repair is one line: &lt;code&gt;return sum(xs) / len(xs)&lt;/code&gt;. Delete the state.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
