Skip to content

feat: RBR Implementation#27

Merged
zkhotanlou merged 28 commits intocharmlab:mainfrom
HashirA123:RBR-model
Nov 22, 2025
Merged

feat: RBR Implementation#27
zkhotanlou merged 28 commits intocharmlab:mainfrom
HashirA123:RBR-model

Conversation

@HashirA123
Copy link
Contributor

@HashirA123 HashirA123 commented Oct 5, 2025

The reproduction is functional and can be marked as a level one on the reproduction scale. I believe that the only metric that seems not to be in line exactly with the original paper/code is the "current validity", which in the reproduction seems to come consistently lower than it should.

I believe that the method is implemented correctly, so the most probable cause for the difference is the training for the base model.

@zkhotanlou
Copy link
Collaborator

That's a good implementation. Please add the reproduce tests as well.

Copy link
Collaborator

@amirhk amirhk left a comment

Choose a reason for hiding this comment

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

some high-level feedback/requests

cc @zkhotanlou for detailed implementation review

@HashirA123 agree with Zahra that next steps is reproduce.py

Initially had the PROBE model commits inside this branch.
They have now been moved to their own branch, and this branch
now only contains the RBR model commits.
@HashirA123 HashirA123 changed the title Rbr model RBR Implementation Oct 21, 2025
(WIP) since the method is implemented, the main thing
left is making the data processing and experiment process
the same as the original paper. They fo use the same datasets
but process thems slightly different (like using different features).
Their model (mlp) is also different. So running with the
dataset and model as they are (the way we have them) will definitly
not get the same results. Will have to think of how to best combine
with their format. One option is not using our model and data catalogs
to load the data, and simply port over their model and data creation/processing
code.
Initially had the PROBE model commits inside this branch.
They have now been moved to their own branch, and this branch
now only contains the RBR model commits.
(WIP) since the method is implemented, the main thing
left is making the data processing and experiment process
the same as the original paper. They fo use the same datasets
but process thems slightly different (like using different features).
Their model (mlp) is also different. So running with the
dataset and model as they are (the way we have them) will definitly
not get the same results. Will have to think of how to best combine
with their format. One option is not using our model and data catalogs
to load the data, and simply port over their model and data creation/processing
code.
Ran throught the code to simply get the mothod to simply run. Need more work to
confirm correctness of results.

WIP commit with debug prints and small fixes.
Getting the reproduce for this method was a bit tricky.

The main challenges seem to be just making sure that the
dataset and models are processed and trained correctly.

I have tried my best to build the model just like they
have and also processing the dataset the same as them.
Although the results are not identical, they can be classified
atleast a level 1 on the reproduction scale and definitly can be improved
in the near future. The Method does infact work well in finding robust
recourse and some metrics seem to be inline with the results of the paper.
@HashirA123 HashirA123 marked this pull request as ready for review November 9, 2025 18:57
@HashirA123 HashirA123 changed the title RBR Implementation feat: RBR Implementation Nov 9, 2025
@HashirA123 HashirA123 marked this pull request as draft November 11, 2025 22:24
@HashirA123 HashirA123 marked this pull request as ready for review November 19, 2025 16:44
I worked to resolve several issues, mainly stemming from the predict function I implemented in the rbr_loss script.

The method results in the reproduce file now fairly closely align with those from the original authors code.

The method does seem to heavily rely on the effectiveness of the trained model for its recourse finding.
That means that if the model is very poor, then this method may not be able to actually get recourse.

Overall, in terms of reproduction, I believe this can be marked between a 1-2.
Copy link
Collaborator

@zkhotanlou zkhotanlou left a comment

Choose a reason for hiding this comment

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

This is an implementation of the "RBR"[1] recourse method. The level of reproduction is on level1 as the unit tests checks the implementation could reproduce results reported in the paper for german dataset on neural network.

[1] Nguyen, Tuan-Duy Hien, Ngoc Bui, Duy Nguyen, Man-Chung Yue, and Viet Anh Nguyen. 2022. "Robust Bayesian Recourse." (UAI 2022)

@zkhotanlou zkhotanlou merged commit 4b565db into charmlab:main Nov 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants