From 1804076907fd48bad583e1d7b0485af6eefecc80 Mon Sep 17 00:00:00 2001 From: pat-alt Date: Fri, 23 May 2025 10:35:33 +0100 Subject: [PATCH 1/7] removed redundant deps --- Project.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Project.toml b/Project.toml index 71e609a..6cab6f0 100644 --- a/Project.toml +++ b/Project.toml @@ -17,9 +17,7 @@ Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d" MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54" Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a" -Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" -RCall = "6f49c342-dc21-5d91-9882-a32aef131414" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" @@ -36,9 +34,7 @@ KernelFunctions = "0.10" MLJBase = "0.21.3" MLUtils = "0.3.1, 0.4" Parameters = "0.12" -Plots = "1.37.2" ProgressMeter = "1" -RCall = "0.13.14" StatsBase = "0.33" julia = "1.7, 1.8, 1.9" From 7418ae7bf7e341243f56977f9f545b6ed1263759 Mon Sep 17 00:00:00 2001 From: pat-alt Date: Fri, 23 May 2025 11:24:12 +0100 Subject: [PATCH 2/7] strict compat for CE.jl --- .github/workflows/CI.yml | 3 +-- Project.toml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 30eb6b4..61f55b5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,8 +20,7 @@ jobs: version: - '1.7' - '1.8' - - '~1.9.0-0' - - 'nightly' + - '1.9' os: - ubuntu-latest arch: diff --git a/Project.toml b/Project.toml index 6cab6f0..59528d4 100644 --- a/Project.toml +++ b/Project.toml @@ -25,7 +25,7 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] CSV = "0.10" -CounterfactualExplanations = "0.1" +CounterfactualExplanations = "0.1 - 0" DataFrames = "1" Distances = "0.10" Flux = "0.13" From 4194be4ada0e764cc390214fb649bebc90922716 Mon Sep 17 00:00:00 2001 From: pat-alt Date: Fri, 23 May 2025 11:37:44 +0100 Subject: [PATCH 3/7] strict bounds in test/Project.toml --- .github/workflows/CI.yml | 2 +- Project.toml | 4 ++-- test/Project.toml | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 61f55b5..820d17b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -47,7 +47,7 @@ jobs: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 with: - version: '1' + version: '1.9' - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-docdeploy@v1 env: diff --git a/Project.toml b/Project.toml index 59528d4..e50952e 100644 --- a/Project.toml +++ b/Project.toml @@ -28,11 +28,11 @@ CSV = "0.10" CounterfactualExplanations = "0.1 - 0" DataFrames = "1" Distances = "0.10" -Flux = "0.13" +Flux = "0.13 - 0.14" Images = "0.25" KernelFunctions = "0.10" MLJBase = "0.21.3" -MLUtils = "0.3.1, 0.4" +MLUtils = "0.3.1 - 0.4" Parameters = "0.12" ProgressMeter = "1" StatsBase = "0.33" diff --git a/test/Project.toml b/test/Project.toml index 7e08923..6d19643 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -6,3 +6,8 @@ MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[compat] +CounterfactualExplanations = "0.1 - 0" +Flux = "0.13 - 0.14" + From 1bced0615bc4ad1026272ff7b17ef06bccf42e64 Mon Sep 17 00:00:00 2001 From: pat-alt Date: Fri, 23 May 2025 13:40:49 +0100 Subject: [PATCH 4/7] come on then --- Project.toml | 2 +- src/experiments/functions.jl | 13 +++++++------ test/Project.toml | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Project.toml b/Project.toml index e50952e..69da0c2 100644 --- a/Project.toml +++ b/Project.toml @@ -25,7 +25,7 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] CSV = "0.10" -CounterfactualExplanations = "0.1 - 0" +CounterfactualExplanations = "0.1 - 0.1.6" DataFrames = "1" Distances = "0.10" Flux = "0.13 - 0.14" diff --git a/src/experiments/functions.jl b/src/experiments/functions.jl index 74891a3..34267fd 100755 --- a/src/experiments/functions.jl +++ b/src/experiments/functions.jl @@ -172,14 +172,15 @@ function update_experiment!(experiment::Experiment, recourse_system::RecourseSys indices_ = rand(1:experiment.num_counterfactuals, length(results)) # randomly draw from generated counterfactuals X′ = reduce(hcat, @.(selectdim(counterfactual(results), 3, indices_))) y′ = reduce(hcat, @.(selectdim(counterfactual_label(results), 3, indices_))) + y′ = [y[1] for y in y′] - # If for any counterfactuals the returned label is NaN, this is considered as invalid and the current label is not updated: - valid_ces = vec(.!(isnan.(y′))) - chosen_individuals = chosen_individuals[valid_ces] + # If for any counterfactuals the returned label is NaN, this is considered as invalid and the current label is not updated: + valid_ces = vec(.!(isnan.(y′))) + chosen_individuals = chosen_individuals[valid_ces] - # Update data: - X[:, chosen_individuals] = X′[:, valid_ces] - y[:, chosen_individuals] = y′[:, valid_ces] + # Update data: + X[:, chosen_individuals] = X′[:, valid_ces] + y[:, chosen_individuals] = y′[:, valid_ces] # Generative model: gen_mod = deepcopy(counterfactual_data.generative_model) diff --git a/test/Project.toml b/test/Project.toml index 6d19643..c69bb7f 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -8,6 +8,6 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] -CounterfactualExplanations = "0.1 - 0" +CounterfactualExplanations = "0.1 - 0.1.6" Flux = "0.13 - 0.14" From 58e064244921dcf5a66aa812135b3a2d579de544 Mon Sep 17 00:00:00 2001 From: pat-alt Date: Fri, 23 May 2025 14:37:02 +0100 Subject: [PATCH 5/7] Minor changes to unit tests. --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index e363d1e..325b4f4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -26,6 +26,6 @@ using Test generators = Dict(:wachter => generator) experiment = set_up_experiment(data_train, data_test, models, generators) - run!(experiment) + run!(experiment, n_folds=1, n_rounds=5) end From 90be8574e665d6747a4f5aa386002c442535ffba Mon Sep 17 00:00:00 2001 From: pat-alt Date: Mon, 26 May 2025 12:09:35 +0200 Subject: [PATCH 6/7] trying to sort out compat --- .github/workflows/CI.yml | 2 -- Project.toml | 4 +--- README.qmd | 8 ++++---- _quarto.yml | 7 +++---- test/Project.toml | 2 +- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 820d17b..1b2d58b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,8 +18,6 @@ jobs: fail-fast: false matrix: version: - - '1.7' - - '1.8' - '1.9' os: - ubuntu-latest diff --git a/Project.toml b/Project.toml index 69da0c2..6bafe5b 100644 --- a/Project.toml +++ b/Project.toml @@ -9,7 +9,6 @@ CounterfactualExplanations = "2f13d31b-18db-44c1-bc43-ebaf2cff0be0" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c" -Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" KernelFunctions = "ec8451be-7e33-11e9-00cf-bbf324bd1392" LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -25,11 +24,10 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] CSV = "0.10" -CounterfactualExplanations = "0.1 - 0.1.6" +CounterfactualExplanations = "=0.1.6" DataFrames = "1" Distances = "0.10" Flux = "0.13 - 0.14" -Images = "0.25" KernelFunctions = "0.10" MLJBase = "0.21.3" MLUtils = "0.3.1 - 0.4" diff --git a/README.qmd b/README.qmd index 6c9552d..a5b1fd1 100644 --- a/README.qmd +++ b/README.qmd @@ -12,7 +12,9 @@ crossref: fig-prefix: Figure tbl-prefix: Table bibliography: bib.bib -jupyter: julia-1.8 +engine: julia +julia: + exeflags: ["+1.9"] --- [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliatrustworthyai.github.io/AlgorithmicRecourseDynamics.jl/stable) @@ -20,9 +22,7 @@ jupyter: julia-1.8 [![Build Status](https://github.com/juliatrustworthyai/AlgorithmicRecourseDynamics.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/juliatrustworthyai/AlgorithmicRecourseDynamics.jl/actions/workflows/CI.yml?query=branch%3Amain) [![Coverage](https://codecov.io/gh/juliatrustworthyai/AlgorithmicRecourseDynamics.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/juliatrustworthyai/AlgorithmicRecourseDynamics.jl) [![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle) -[![ColPrac: Contributor’s Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet.png)](https://github.com/SciML/ColPrac) -[![Twitter Badge](https://img.shields.io/twitter/url/https/twitter.com/paltmey.svg?style=social&label=Follow%20%40paltmey)](https://twitter.com/paltmey) # AlgorithmicRecourseDynamics -{{< include docs/src/_intro.qmd >}} \ No newline at end of file +{{< include docs/src/_intro.qmd >}} diff --git a/_quarto.yml b/_quarto.yml index f7f40ee..b86dae7 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -14,7 +14,6 @@ execute: echo: true output: false -jupyter: julia-1.8 - - - +engines: ['julia'] +julia: + exeflags: ["+1.9"] diff --git a/test/Project.toml b/test/Project.toml index c69bb7f..ffd18ba 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -8,6 +8,6 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] -CounterfactualExplanations = "0.1 - 0.1.6" +CounterfactualExplanations = "=0.1.6" Flux = "0.13 - 0.14" From 0759d583f1eb64734b6667f678a8b6389f46625c Mon Sep 17 00:00:00 2001 From: pat-alt Date: Mon, 26 May 2025 12:21:55 +0200 Subject: [PATCH 7/7] bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6bafe5b..6e8a632 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "AlgorithmicRecourseDynamics" uuid = "3d1ede72-abb8-4340-bf8e-2ae06849b5ec" authors = ["Patrick Altmeyer"] -version = "0.1.3" +version = "0.1.4" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"