<p dir="auto">Forgive me if this has been discussed already, but why does <code class="notranslate">sklearn.cross_validation._fit_and_score</code> use a <code class="notranslate">verbosity</code> parameter and the <code class="notranslate">print</code> function, rather than using python's <code class="notranslate">logging</code> module? As someone who is building a library that uses sklearn, it means that I have to expose that <code class="notranslate">verbosity</code> parameter in my code, rather than letting the user set the logging level (or even hide the logging from that module).</p>
<p dir="auto">For instance in lines 1434-1440 of sklearn/cross_validation.py</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    if verbose &gt; 1:
        if parameters is None:
            msg = &quot;no parameters to be set&quot;
        else:
            msg = '%s' % (', '.join('%s=%s' % (k, v)
                          for k, v in parameters.items()))
        print(&quot;[CV] %s %s&quot; % (msg, (64 - len(msg)) * '.'))"><pre class="notranslate"><code class="notranslate">    if verbose &gt; 1:
        if parameters is None:
            msg = "no parameters to be set"
        else:
            msg = '%s' % (', '.join('%s=%s' % (k, v)
                          for k, v in parameters.items()))
        print("[CV] %s %s" % (msg, (64 - len(msg)) * '.'))
</code></pre></div>
<p dir="auto">This is a proposal to use python's logging module instead of using stdout and verbose flags in the models API.</p>
<p dir="auto">Using the logging module would make it easier for the user to control the verbosity of the scikit using a single and well documented configuration interface and logging API.</p>
<p dir="auto"><a href="http://docs.python.org/library/logging.html" rel="nofollow">http://docs.python.org/library/logging.html</a></p>