<div dir="ltr">Hi Sebastian,<div><br></div><div>I think the random state is used to select the features that go into each split (look at the `max_features` parameter)</div><div><br></div><div>Cheers,</div><div>Javier</div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 28, 2018 at 12:07 AM Sebastian Raschka <<a href="mailto:mail@sebastianraschka.com">mail@sebastianraschka.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
when I was implementing a bagging classifier based on scikit-learn's DecisionTreeClassifier, I noticed that the results were not deterministic and found that this was due to the random_state in the DescisionTreeClassifier (which is set to None by default).<br>
<br>
I am wondering what exactly this random state is used for? I can imaging it being used for resolving ties if the information gain for multiple features is the same, or it could be that the feature splits of continuous features is different? (I thought the heuristic is to sort the features and to consider those feature values next to each associated with examples that have different class labels -- but is there maybe some random subselection involved?)<br>
<br>
If someone knows more about this, where the random_state is used, I'd be happy to hear it :)<br>
<br>
Also, we could then maybe add the info to the DecisionTreeClassifier's docstring, which is currently a bit too generic to be useful, I think:<br>
<br>
<a href="https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/tree.py" rel="noreferrer" target="_blank">https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/tree.py</a><br>
<br>
<br>
    random_state : int, RandomState instance or None, optional (default=None)<br>
        If int, random_state is the seed used by the random number generator;<br>
        If RandomState instance, random_state is the random number generator;<br>
        If None, the random number generator is the RandomState instance used<br>
        by `np.random`.<br>
<br>
<br>
Best,<br>
Sebastian<br>
_______________________________________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn</a><br>
</blockquote></div>