<p dir="auto">Since RandomForestClassifier and RandomForestRegressor do not have a max_samples attribute unlike BaggingClassifier and BaggingRegressor, there is no way to set the sub sample size in case of former. This is undesirable in case of large datasets where the individual estimators of the random forest may need to be built on smaller sub-samples of the datasets in order to save computational time.</p>
<h4 dir="auto">Description</h4>
<p dir="auto"><code class="notranslate">train_test_split</code> splits the single sample data such that train part has 0 samples and test has that sample. Also this behaviour is not affected by setting the <code class="notranslate">test_size</code> to any value.</p>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
from sklearn.model_selection import train_test_split

data = np.random.normal(0, 1, [1, 100])
print(A.shape)
#Output:  (1, 100)

data_train, data_test = train_test_split(data)
print(data_train.shape, data_test.shape)
#Output:  ((0, 100), (1, 100))"><pre class="notranslate"><code class="notranslate">import numpy as np
from sklearn.model_selection import train_test_split

data = np.random.normal(0, 1, [1, 100])
print(A.shape)
#Output:  (1, 100)

data_train, data_test = train_test_split(data)
print(data_train.shape, data_test.shape)
#Output:  ((0, 100), (1, 100))
</code></pre></div>
<h4 dir="auto">Expected Results</h4>
<p dir="auto">I am not sure of expected results as this seems like an unintended usage. But still think that at-least a warning (if not error) should be given when splitting.</p>
<h4 dir="auto">Versions</h4>
<p dir="auto">Linux-3.16.0-77-generic-x86_64-with-Ubuntu-14.04-trusty<br>
('Python', '2.7.6 (default, Nov 23 2017, 15:49:48) \n[GCC 4.8.4]')<br>
('NumPy', '1.14.2')<br>
('SciPy', '1.0.1')<br>
('Scikit-Learn', '0.19.1')</p>
<p dir="auto">I am sorry if its a duplicate. I tried searching for similar issues but could not find (even though I thought that this would have been discussed somewhere).</p>