<p dir="auto">I think it should be computed in terms of <code class="notranslate">zero_one_loss</code> to avoid code duplication.</p>
<p dir="auto">Hi, I would like to report what seems to be a bug in the treatment of the <code class="notranslate">copy_X</code> parameter of the <code class="notranslate">LassoLarsIC</code> class. Because it's a simple bug, it's much easier to see in the code directly than in the execution, so I am not posting steps to reproduce it.</p>
<p dir="auto">As you can see here, LassoLarsIC accepts a copy_X parameter.<br>
</p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/scikit-learn/scikit-learn/blob/7389dbac82d362f296dc2746f10e43ffa1615660/sklearn/linear_model/least_angle.py#L1487">scikit-learn/sklearn/linear_model/least_angle.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 1487
      in
      <a data-pjax="true" class="commit-tease-sha" href="/scikit-learn/scikit-learn/commit/7389dbac82d362f296dc2746f10e43ffa1615660">7389dba</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L1487" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1487"></td>
          <td id="LC1487" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">self</span>.<span class="pl-s1">copy_X</span> <span class="pl-c1">=</span> <span class="pl-s1">copy_X</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">However, it also takes a copy_X parameter a few lines below, in the definition of <code class="notranslate">fit</code>.<br>
<code class="notranslate">def fit(self, X, y, copy_X=True):</code></p>
<p dir="auto">Now there are two values (potentially contradicting each other) for copy_X and each one is used once. Therefore <code class="notranslate">fit</code> can have a mixed behaviour. Even worse, this can be completely invisible to the user, since copy_X has a default value of True. Let's assume that I'd like it to be False, and have set it to False in the initialization, <code class="notranslate">my_lasso = LassoLarsIC(copy_X=False)</code>. I then call <code class="notranslate">my_lasso.fit(X, y)</code> and my choice will be silently overwritten.</p>
<p dir="auto">Ideally I think that copy_X should be removed as an argument in <code class="notranslate">fit</code>. No other estimator seems to have a duplication in class parameters and fit arguments (I've checked more than ten in the linear models module). However, this would break existing code. Therefore I propose that <code class="notranslate">fit</code> takes a default value of <code class="notranslate">None</code> and only overwrites the existing value if the user has explicitly passed it as an argument to <code class="notranslate">fit</code>. I will submit a PR to that effect.</p>