I’m trying to go through the code in Julia for DataScience and this line does not work:

fit!(regr_1, XX, y)

in:

srand(100)

X = sort(5 * rand(80))

XX = reshape(X, 80, 1)

y = sin(X)

y[1:5:end] += 3 * (0.5 - rand(16))

# Fit regression model

regr_1 = DecisionTreeRegressor()

regr_2 = DecisionTreeRegressor(pruning_purity_threshold=0.05)

fit!(regr_1, XX, y)

fit!(regr_2, XX, y)

Any help would be appreciated!