Skip to content

Commit 44afabe

Browse files
committed
percentage option in gap method
1 parent 4cbcbc2 commit 44afabe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Utils/interface.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ function compute_gap(
137137
bench::AbstractBenchmark,
138138
dataset::AbstractVector{<:DataSample},
139139
statistical_model,
140-
maximizer,
140+
maximizer;
141+
percentage::Bool=false,
141142
)
142143
res = 0.0
143144
check = is_minimization_problem(bench)
@@ -151,5 +152,6 @@ function compute_gap(
151152
Δ = check ? obj - target_obj : target_obj - obj
152153
res += Δ / abs(target_obj)
153154
end
154-
return res / length(dataset)
155+
gap = res / length(dataset)
156+
return percentage ? gap * 100 : gap
155157
end

0 commit comments

Comments
 (0)