<p dir="auto">Couple of issues to investigate regarding the documentation on CircleCI:</p>
<ul dir="auto">
<li>The recently merged PR for OPTICS <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="360535371" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/12087" data-hovercard-type="pull_request" data-hovercard-url="/scikit-learn/scikit-learn/pull/12087/hovercard" href="https://github.com/scikit-learn/scikit-learn/pull/12087">#12087</a> has an issue with an image which is not generated:</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/home/circleci/project/doc/modules/clustering.rst:: WARNING: image file not readable: modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001.png
/home/circleci/project/doc/modules/clustering.rst:: WARNING: image file not readable: modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001.png"><pre class="notranslate"><code class="notranslate">/home/circleci/project/doc/modules/clustering.rst:: WARNING: image file not readable: modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001.png
/home/circleci/project/doc/modules/clustering.rst:: WARNING: image file not readable: modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001.png
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="LaTeX Warning: File `{modules/../auto_examples/cluster/images/sphx_glr_plot_opt
ics_001}.png' not found on input line 2.


LaTeX Warning: File `{modules/../auto_examples/cluster/images/sphx_glr_plot_opt
ics_001}.png' not found on input line 2.


! Package pdftex.def Error: File `modules/../auto_examples/cluster/images/sphx_
glr_plot_optics_001.png' not found.

See the pdftex.def package documentation for explanation.
Type  H &lt;return&gt;  for immediate help.
 ...                                              
                                                  
l.25435 .../images/sphx_glr_plot_optics_001}.png}}
                                                  ^^M
!  ==&gt; Fatal error occurred, no output PDF file produced!
Transcript written on user_guide.log.
Latexmk: Index file 'user_guide.idx' was written
Latexmk: Missing input file: '{modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001}.png' from line
  'LaTeX Warning: File `{modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001}.png' not found on input line 2.'
Latexmk: Missing input file: '{modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001}.png' from line
  'LaTeX Warning: File `{modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001}.png' not found on input line 2.'
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 256
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.
Latexmk: Errors, so I did not complete making targets
Makefile:33: recipe for target 'user_guide.pdf' failed
make[1]: *** [user_guide.pdf] Error 12
make[1]: Leaving directory '/home/circleci/project/doc/_build/latex'
Makefile:79: recipe for target 'latexpdf' failed
make: *** [latexpdf] Error 2
Exited with code 2"><pre class="notranslate"><code class="notranslate">LaTeX Warning: File `{modules/../auto_examples/cluster/images/sphx_glr_plot_opt
ics_001}.png' not found on input line 2.


LaTeX Warning: File `{modules/../auto_examples/cluster/images/sphx_glr_plot_opt
ics_001}.png' not found on input line 2.


! Package pdftex.def Error: File `modules/../auto_examples/cluster/images/sphx_
glr_plot_optics_001.png' not found.

See the pdftex.def package documentation for explanation.
Type  H &lt;return&gt;  for immediate help.
 ...                                              
                                                  
l.25435 .../images/sphx_glr_plot_optics_001}.png}}
                                                  ^^M
!  ==&gt; Fatal error occurred, no output PDF file produced!
Transcript written on user_guide.log.
Latexmk: Index file 'user_guide.idx' was written
Latexmk: Missing input file: '{modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001}.png' from line
  'LaTeX Warning: File `{modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001}.png' not found on input line 2.'
Latexmk: Missing input file: '{modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001}.png' from line
  'LaTeX Warning: File `{modules/../auto_examples/cluster/images/sphx_glr_plot_optics_001}.png' not found on input line 2.'
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 256
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.
Latexmk: Errors, so I did not complete making targets
Makefile:33: recipe for target 'user_guide.pdf' failed
make[1]: *** [user_guide.pdf] Error 12
make[1]: Leaving directory '/home/circleci/project/doc/_build/latex'
Makefile:79: recipe for target 'latexpdf' failed
make: *** [latexpdf] Error 2
Exited with code 2
</code></pre></div>
<ul dir="auto">
<li>Something linked with a missing module:</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="WARNING: /home/circleci/project/doc/modules/generated/sklearn.utils.arrayfuncs.cholesky_delete.rst:6: (WARNING/2) autodoc: failed to import function 'cholesky_delete' from module 'arrayfuncs'; the following exception was raised:
Traceback (most recent call last):
  File &quot;/home/circleci/miniconda/envs/testenv/lib/python3.6/site-packages/Sphinx-1.6.2-py3.6.egg/sphinx/ext/autodoc.py&quot;, line 657, in import_object
    __import__(self.modname)
ModuleNotFoundError: No module named 'arrayfuncs'"><pre class="notranslate"><code class="notranslate">WARNING: /home/circleci/project/doc/modules/generated/sklearn.utils.arrayfuncs.cholesky_delete.rst:6: (WARNING/2) autodoc: failed to import function 'cholesky_delete' from module 'arrayfuncs'; the following exception was raised:
Traceback (most recent call last):
  File "/home/circleci/miniconda/envs/testenv/lib/python3.6/site-packages/Sphinx-1.6.2-py3.6.egg/sphinx/ext/autodoc.py", line 657, in import_object
    __import__(self.modname)
ModuleNotFoundError: No module named 'arrayfuncs'
</code></pre></div>
<h4 dir="auto">Description</h4>
<p dir="auto">I've been working on <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="174180878" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/7301" data-hovercard-type="pull_request" data-hovercard-url="/scikit-learn/scikit-learn/pull/7301/hovercard" href="https://github.com/scikit-learn/scikit-learn/pull/7301">#7301</a>, and I found some seemingly duplicate logic in the decision tree code. At the least, it's something that requires more documentation; at the most, it's a bug.</p>
<p dir="auto">So I was poking around, trying to figure out why I couldn't get equal trees for uniform sample weights when i set <code class="notranslate">min_weight_fraction_leaf</code> and <code class="notranslate">min_samples_leaf</code> to the same float value. I saw that the two built trees actually had radically different values of <code class="notranslate">min_samples_split</code>, despite me not setting this value at all. In the code (<a href="https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/tree.py#L229">https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/tree.py#L229</a>), it shows that <code class="notranslate">min_samples_split</code> is set to the <code class="notranslate">max(min_samples_split, 2 * min_samples_leaf)</code>. This isn't documented at all, and should be if we decide to keep this statement.</p>
<p dir="auto">Now this logic makes sense to me, as you can't make a split if there's no way to split it in such a manner that each leaf has the minimum number of samples. However, isn't this sort of logic encapsulated when we're building the tree? Namely, I'm thinking of the <code class="notranslate">is_leaf</code> conditional, which determines whether to split on a node or not (<a href="https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_tree.pyx#L219">https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_tree.pyx#L219</a>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="is_leaf = ((depth &gt;= max_depth) or
  (n_node_samples &lt; min_samples_split) or
  (n_node_samples &lt; 2 * min_samples_leaf) or
   (weighted_n_node_samples &lt; min_weight_leaf))"><pre class="notranslate"><code class="notranslate">is_leaf = ((depth &gt;= max_depth) or
  (n_node_samples &lt; min_samples_split) or
  (n_node_samples &lt; 2 * min_samples_leaf) or
   (weighted_n_node_samples &lt; min_weight_leaf))
</code></pre></div>
<p dir="auto">I think the statement <code class="notranslate">(n_node_samples &lt; 2 * min_samples_leaf)</code> has the same effect as setting <code class="notranslate">min_samples_split</code> explicitly to the max of itself or <code class="notranslate">2*min_samples_leaf</code>. Indeed, removing the max call does not cause any tests to fail.</p>
<p dir="auto">Should we be removing the explicit call to max? It seems like a piece of duplicate logic, but maybe I'm missing something. ping <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/glouppe/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/glouppe">@glouppe</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/raghavrv/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/raghavrv">@raghavrv</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jmschrei/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jmschrei">@jmschrei</a> / anyone else.</p>