Ансамбль деревьев
Author
function mse_evo(X, y, n_trees=200)
X_df = DataFrame(X, :auto)
y_vec = y
model = EvoTreeRegressor(
loss=:mse,
nrounds=n_trees,
nbins=50,
eta=0.1,
max_depth=6,
min_weight=1.0
)
mach = machine(model, X_df, y_vec)
fit!(mach)
fitted_model = mach.fitresult
if :importance in propertynames(fitted_model)
importance = fitted_model.importance
if sum(importance) > 0
importance = importance / sum(importance)
end
return importance
else
return zeros(size(X, 2))
end
end