Skip to content

Commit

Permalink
Merge pull request #175 from Evovest/dev
Browse files Browse the repository at this point in the history
print initial metric only if verbose > 0. Fix for #174
  • Loading branch information
jeremiedb authored Oct 25, 2022
2 parents 3c45c5e + f42b30e commit a786e19
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
authors = ["jeremiedb <[email protected]>"]
name = "EvoTrees"
uuid = "f6006082-12f8-11e9-0c9c-0d5d367ab1e5"
version = "0.12.2"
version = "0.12.3"

[deps]
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
Expand Down
2 changes: 1 addition & 1 deletion experiments/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ params1 = EvoTreeRegressor(T=Float32,

# asus laptopt: for 1.25e6 no eval: 9.650007 seconds (893.53 k allocations: 2.391 GiB, 5.52% gc time)
@time model = fit_evotree(params1; x_train, y_train);
@time model = fit_evotree(params1; x_train, y_train, metric=:mse, x_eval, y_eval, print_every_n=100);
@time model = fit_evotree(params1; x_train, y_train, metric=:mse, x_eval, y_eval, print_every_n=50, verbosity=0);
@btime model = fit_evotree(params1; x_train, y_train);
@time pred_train = predict(model, x_train);
@btime pred_train = predict(model, x_train);
Expand Down
8 changes: 4 additions & 4 deletions src/fit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ function fit_evotree(
w_eval = isnothing(w_eval) ? CUDA.ones(T, size(y_eval)) : CuArray(T.(w_eval))
p_eval = predict(model.trees[1], x_eval, model.K)
!isnothing(offset_eval) && (p_eval .+= CuArray(offset_eval'))
eval_vec = CUDA.zeros(T, size(y_eval, 1))
else # params.device == "cpu"
x_eval = T.(x_eval)
y_eval = eltype(cache.y).(y_eval)
Expand All @@ -363,9 +362,10 @@ function fit_evotree(
metric_best = Metric()
metric_track.metric =
eval_metric(Val{metric}(), p_eval, y_eval, w_eval, params.alpha)
tracker = (iter = [0], metric = [metric_track.metric])
@info "Initial tracking info" iter = model.params.nrounds metric =
metric_track.metric
if verbosity > 0
@info "Initial tracking info" iter = model.params.nrounds metric =
metric_track.metric
end
end

while model.params.nrounds < nrounds_max && iter_since_best < early_stopping_rounds
Expand Down

2 comments on commit a786e19

@jeremiedb
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/71006

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.12.3 -m "<description of version>" a786e19d495d53e5589d67cfeb95e599b29c2d6c
git push origin v0.12.3

Please sign in to comment.