python - Scikit-learn 1 node decision tree? -
i’m bit perplexed issue, i’ve created list of lists (which passed numpy’s asarray stored in x) each sublist features sample (current same value in each column haven’t parsed each feature integer yet). created y variable numpy.fill same value testing. i’m passing these 2 numpy arrays in fit(x,y) x =
array([[ 0, 1, 2, ..., -1, -1, -1], [ 0, -1, 2, ..., -1, -1, -1], [ 0, -1, -1, ..., -1, -1, -1], ..., [ 0, -1, -1, ..., -1, -1, -1], [ 0, -1, -1, ..., -1, -1, -1], [ 0, -1, 2, ..., -1, -1, -1]])
and y =
[4 4 4 ..., 4 4 4]
however resulting output 1 node decision tree gini value 0. wondering if shed light on why may occurring. thanks!
from understood target value 4 samples. suppose tree has 1 node, predicts target value 4 test data since target value 4 training data. , gini index 0 since of samples in same class. hope helps !
Comments
Post a Comment