From 9346eeb6b0a6bf5a31cfa81b59a5e41d347c3885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Poisot?= Date: Fri, 13 Oct 2023 11:37:55 -0400 Subject: [PATCH] color update --- slides.qmd | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/slides.qmd b/slides.qmd index 8575abc..b55e951 100644 --- a/slides.qmd +++ b/slides.qmd @@ -63,9 +63,9 @@ See also @higino2021 for more quality 🦝 content include(joinpath("code", "pkg.jl")); # Dependencies include(joinpath("code", "nbc.jl")); # Naive Bayes Classifier include(joinpath("code", "bioclim.jl")); # BioClim model +include(joinpath("code", "confusion.jl")); # Confusion matrix utilities include(joinpath("code", "splitters.jl")); # Cross-validation include(joinpath("code", "crossvalidate.jl")); # Cross-validation -include(joinpath("code", "confusion.jl")); # Confusion matrix utilities include(joinpath("code", "variableselection.jl")); # Variable selection include(joinpath("code", "shapley.jl")); # Shapley values include(joinpath("code", "palettes.jl")); # Color palettes @@ -636,7 +636,7 @@ end fig = Figure(; resolution=(900, 500)) ax = Axis(fig[1,1]; xlabel="Longitude", ylabel="Latitude", aspect=DataAspect()) -hm = heatmap!(ax, entropy.(prediction), colormap=Reverse(:linear_gow_65_90_c35_n256), colorrange=(0., 1.)) +hm = heatmap!(ax, entropy.(prediction), colormap=cgrad(iridescent), colorrange=(0., 1.)) heatmap!(ax, presence_layer; colormap=[:black,:black]) Colorbar(fig[1,2], hm; tellheight=false) current_figure() @@ -677,7 +677,7 @@ shapval = [similar(first(predictors)) for i in eachindex(available_variables)] Threads.@threads for k in keys(shapval[1]) x = [p[k] for p in predictors[available_variables]] for i in axes(shapval, 1) - shapval[i][k] = shapleyvalues(finalmodel, tX, x, i; M=50) + shapval[i][k] = shapleyvalues(finalmodel, tX[:,available_variables], x, i; M=50) if isnan(shapval[i][k]) shapval[i][k] = 0.0 end @@ -715,19 +715,19 @@ fpos = 1 for i in sortperm(varimp; rev=true)[1:3] ax_mp = Axis(gl[fpos,1]) # Absolute contribution scl = maximum(abs.(extrema(shapval[i]))).*(-1,1) - heatmap!(ax_mp, shapval[i], colorrange=scl, colormap=Reverse(:diverging_bwr_20_95_c54_n256), aspect=DataAspect()) - hidexdecorations!(ax_mp) + heatmap!(ax_mp, shapval[i], colorrange=scl, colormap=cgrad(sunset), aspect=DataAspect()) + hidexdecorations!(ax_mp)nightfall hideydecorations!(ax_mp) ax_pp = Axis(gl[fpos,2]) # Relative contribution relcon = abs(shapval[i])/totalvar - heatmap!(ax_pp, relcon, colorrange=extrema(relcon), colormap=Reverse(:linear_gow_65_90_c35_n256), aspect=DataAspect()) + heatmap!(ax_pp, relcon, colorrange=extrema(relcon), colormap=cgrad(iridescent), aspect=DataAspect()) hidexdecorations!(ax_pp) hideydecorations!(ax_pp) ax_pr = Axis(gl[fpos,3], title=variables[available_variables[i]][2]) # Partial response ylims!(ax_pr, scl) - hexbin!(ax_pr, predictors[available_variables[i]], shapval[i], bins=200, colormap=:linear_bgy_10_95_c74_n256) + hexbin!(ax_pr, predictors[available_variables[i]], shapval[i], bins=200, colormap=cgrad(incandescent)) fpos += 1 end