Edit scikit-learn decisionTree
<p>I would like to edit sklearn decisionTree, 
e.g. change conditions or cut node/leaf etc.</p>

<p>But there seems to be no functions to do that, if I could export to a file, edit it to import.</p>

<p>How can I edit decisionTree?</p>

<p>Environment:</p>

<ul>
<li>Windows10</li>
<li>python3.3</li>
<li>sklearn 0.17.1</li>
</ul>

<p>Even though the docs say that the <code>splitter</code> kwarg for <code>DecisionTreeClassifier</code> is a string, you could give it a class as well. Evidence:</p>

<p><a href="https://github.com/scikit-learn/scikit-learn/blob/412996f/sklearn/tree/tree.py#L353-L360" rel="nofollow">https://github.com/scikit-learn/scikit-learn/blob/412996f/sklearn/tree/tree.py#L353-L360</a></p>

<p>Looks like you could subclass one of the Splitter classes found here: </p>

<p><a href="https://github.com/scikit-learn/scikit-learn/blob/0.17.X/sklearn/tree/_splitter.pyx" rel="nofollow">https://github.com/scikit-learn/scikit-learn/blob/0.17.X/sklearn/tree/_splitter.pyx</a></p>

<p>And do:</p>

<pre><code>my_decision_tree = sklearn.tree.DecisionTreeClassifier(splitter=mySplitter)
</code></pre>

python scikit-learn