Apologies for this newbie question. I have a scikit learn DecisionTreeRegressor
with muti-variable output. If the output is in the format [ output_var1, output_var2 ], where each variable is a continuous number not an integer, why the result is [1, 1] instead of [1.5, 1.5] ? What needs to be changed in this model to get [1.5, 1.5] ?
from sklearn.tree import DecisionTreeRegressor
X = [ [1,1], [2,2], [3,3] ]
y = [ [1,1], [2,2], [3,3] ]
print('X:' , X)
print('-----------------------------')
print('y:' , y)
print('-----------------------------')
regr = DecisionTreeRegressor()
regr.fit(X, y)
X_test = [ [1.5, 1.5] ]
print('X_test:' , X_test)
print('-----------------------------')
y_result = regr.predict(X_test)
print('y_result:' , y_result )
Result:
X: [[1, 1], [2, 2], [3, 3]]
-----------------------------
y: [[1, 1], [2, 2], [3, 3]]
-----------------------------
X_test: [[1.5, 1.5]]
-----------------------------
y_result: [[1. 1.]]
y
. $\endgroup$