Skip to content

Commit

Permalink
perf(demo): avoid some GC but not all
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoisot committed Dec 20, 2024
1 parent 7c1c3a0 commit bf15015
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SDeMo/src/explanations/shapley.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ function explain(
samples = 200,
kwargs...,
) where {T <: AbstractSDM}
predictor = (x) -> predict(model, x; kwargs...)
function predictor(x)
return predict(model, x; kwargs...)
end
instances = isnothing(instances) ? features(model) : instances
if isnothing(observation)
return shap_all_points(predictor, instances, features(model), j, samples)
Expand Down

0 comments on commit bf15015

Please sign in to comment.