<div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">Hello,</div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">I would like to obtain final intervals from the decision tree structure. I am not interested in every node, just the limits that take a sample to a final decision /leaf.</div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">For example, if the tree structure is this one:</div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);"><pre><code>|--- feature_0 <= 0.08
| |--- class: 0
|--- feature_0 > 0.08
| |--- feature_0 <= 8.50
| | |--- feature_0 <= 1.50
| | | |--- class: 1
| | |--- feature_0 > 1.50
| | | |--- class: 1
| |--- feature_0 > 8.50
| | |--- feature_0 <= 60.25
| | | |--- class: 0
| | |--- feature_0 > 60.25
| | | |--- class: 0</code></pre>Then, I would like to obtain these limits:</div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);"><p>0-0.08 ; 0.08-1.50; 1.50-8.50 ; 8.50-60; >60</p>Potentially as the following numpy array:</div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);"><pre><code>[-np.inf, 0.08, 1.5, 8.5, 60, np.inf]</code></pre><br></div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">Is it possible?</div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">I have a stackoverflow question here for more details and code<br></div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);"><span><a target="_blank" rel="noreferrer nofollow noopener" href="https://stackoverflow.com/questions/75663472/how-to-obtain-the-interval-limits-from-a-decision-tree-with-scikit-learn">https://stackoverflow.com/questions/75663472/how-to-obtain-the-interval-limits-from-a-decision-tree-with-scikit-learn</a><br></span></div><div><br></div><div>Thank you<span>!</span></div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);"><span>Sole<br></span></div><div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0);"><br></div><div class="protonmail_signature_block" style="font-family: Arial, sans-serif; font-size: 14px;"><div class="protonmail_signature_block-proton">
Sent with <a target="_blank" href="https://proton.me/" rel="noopener noreferrer">Proton Mail</a> secure email.
</div>
</div>