Trying to build a sklearn DecisionTreeRegressor, I'm following the steps listed
Linear model
X_train = np.array([[100],[500],[1500],[3500]])
y_train = np.array([23, 43, 44, 55])
reg = LinearRegression().fit(X_train, y_train)
x_outside_range = np.array([[4000], [10000]])
plt.plot(X_train,y_train, label='train data')
plt.plot(x_outside_range ,reg.predict(x_outside_range), label='prediction outside train data range')
plt.legend()