Decision-Tree-Prediction

Sat 17 May 2025

title: "Decision Tree Prediction" author: "Raja CSP Raman" date: 2019-04-20 description: "-" type: technical_note draft: false


from sklearn import tree
X = [[0, 0], [2, 2]]
y = [0.5, 2.5]
clf = tree.DecisionTreeRegressor()
clf = clf.fit(X, y)
predicted = clf.predict([[1, 1]])
print(predicted)
[0.5]


Score: 5

Category: basics