# Interpreting 'values' of a Decision Tree

I am trying to interpret my decision tree here which was resulted as a part of pre-pruning-

I am trying to understand why the values in my nodes are in decimal places. Ideally, they should represent the #observations that belong to a particular class in my binary classifier, they should have been absolute numbers they are not percentages as well since they don't add up to 100.

this is the code I used to plot this tree-

plt.figure(figsize=(15, 10))

out = tree.plot_tree(
best_model2,
feature_names=feature_names,
filled=True,
fontsize=9,
node_ids=False,
class_names=None,
)
for o in out:
arrow = o.arrow_patch
if arrow is not None:
arrow.set_edgecolor("black")
arrow.set_linewidth(1)
plt.show()



This tree was a post pruned tree with code as -

best_model2 = DecisionTreeClassifier(
ccp_alpha=0.002, class_weight={0: 0.15, 1: 0.85}, random_state=1
)
best_model2.fit(X_train, y_train)

• These values represent the weighted observations for each class, i.e. number of observations per class multiplied by the respective class weight. Since your class weights aren't integers, the resulting values are the way they are. If you want to get class counts, you can simply divide your values by class weights. Jan 9 at 20:41