Skip to content

Commit 48cdc8c

Browse files
committed
more changes to readme
1 parent 8d5f258 commit 48cdc8c

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

README.md

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,68 @@ This is a repository for **IFC1**, a novel algorithm to learn user preferences t
55
## Setup details:
66

77
The code has been written in python 3.11.7 and pytorch 2.2.0+cu121. The remaining requirements are all provided in the requirements.txt which can be used to install via the following commands:
8-
* Windows: `pip install -r requirements.txt`
9-
* Linux: `pip install -r requirements.txt`
8+
* *Windows*: `pip install -r requirements.txt`
9+
* *Linux*: `pip install -r requirements.txt`
1010

1111
To create the environment 'alg4' under the folder 'virtual_environment', we use (make sure that python 3.11 installed in system from before):
12-
* Windows: `py -3.11 -m venv .\virtual_environment\alg4`
13-
* Linux: `python3.11 -m venv .\virtual_environment\alg4`
12+
* *Windows*: `py -3.11 -m venv .\virtual_environment\alg4`
13+
* *Linux*: `python3.11 -m venv .\virtual_environment\alg4`
14+
1415
While using conda, you dont even need to have python 3.11 installed from before. We can use:
15-
* Windows and Linux: `conda create -n .\virtual_environment\alg4 python=3.11`
16+
* *Windows and Linux*: `conda create -n .\virtual_environment\alg4 python=3.11`
1617
When creating with conda, feel free to use pip therafter to install other packages - this is necessary as causal-learn and dowhy are not available on conda.
1718

1819
## How to use:
1920

2021
To run the baselines for the synthetic dataset, run the following command:
21-
* Windows: `python .\src\baselines\compare2.py`
22+
* *Windows*: `python .\src\baselines\compare2.py`
23+
2224
To run the baselines for the dataset 'Give Me Some Credit', run the following command:
23-
* Windows: `python .\src\baselines\alg10_multiple_run.py`
25+
* *Windows*: `python .\src\baselines\alg10_multiple_run.py`
26+
2427
Make sure that folder directory names mentioned within the file are correct and valid for you. The logs will be available in the 'logs' folder under the name 'Log_comparison2.log' and 'Log_give_me_credit_alg10.log' respectively. The graphs will be available in the 'results\graphs' folder, with each user getting a different folder for compare2.py, and the whole run getting two folders for alg10_multiple_run.py.
2528

2629
If we want to run the individual files for a single user, try running the following command:
27-
* Windows: `python .\src\counterfactual_gen\Algorithm10.py`
30+
* *Windows*: `python .\src\counterfactual_gen\Algorithm10.py`
2831

2932

3033
## About the code:
3134

3235
### `counterfactual_gen` module
3336
**Algorithm10.py** contains the actual IFC1 algorithm which has been used for the final results. The other files contain previous versions of the algorithm and are variations of it. The other important baselines that have been used are:
34-
1. manan_algorithmic_recourse2.py -> Manan's base paper (Version 2)
35-
2. manan_with_causality_algorithmic_recourse2.py -> Manan's base paper with causality involved (Version 2)
36-
3. my_method_algorithmic_recourse.py -> Custom 1
37-
4. my_method_algorithmic_recourse3.py -> Custom 2
37+
1. ***manan_algorithmic_recourse2.py*** -> Manan's base paper (Version 2)
38+
2. ***manan_with_causality_algorithmic_recourse2.py*** -> Manan's base paper with causality involved (Version 2)
39+
3. ***my_method_algorithmic_recourse.py*** -> Custom 1
40+
4. ***my_method_algorithmic_recourse3.py*** -> Custom 2
3841

3942
Some of the other files have been shifted to a separate folder and are described as below:
40-
* manan_algorithmic_recourse.py -> Original implementation of Manan's base paper which was later modified in version 2 (see above) to get better results and more optimized outcomes.
41-
* manan_with_causality_algorithmic_recourse.py -> Original implementation of Manan's base paper but with added causality changes, which was later modified in version 2 (see above) to get better results and more optimized outcomes.
42-
* my_method_algorithmic_recourse2.py -> Some older implementation of Custom 2
43-
* my_method_algorithmic_recourse4.py -> First attempt at involving causality in Custom 2 (which is basically our actual method)
44-
* Algorithm5.py-Algorithm9.py -> Older implementations of our full workflow, with some not involving the full causality module with causal-learn and dowhy possibly. As we approach Algorithm9 we get closer to the final full version Algorithm10.py. Algorithm10.py has the final optimized version of Algorithm9 (along with sone metric fixes).
43+
* ***manan_algorithmic_recourse.py*** -> Original implementation of Manan's base paper which was later modified in version 2 (see above) to get better results and more optimized outcomes.
44+
* ***manan_with_causality_algorithmic_recourse.py*** -> Original implementation of Manan's base paper but with added causality changes, which was later modified in version 2 (see above) to get better results and more optimized outcomes.
45+
* ***my_method_algorithmic_recourse2.py*** -> Some older implementation of Custom 2
46+
* ***my_method_algorithmic_recourse4.py*** -> First attempt at involving causality in Custom 2 (which is basically our actual method)
47+
* ***Algorithm5.py***-***Algorithm9.py*** -> Older implementations of our full workflow, with some not involving the full causality module with causal-learn and dowhy possibly. As we approach Algorithm9 we get closer to the final full version Algorithm10.py. Algorithm10.py has the final optimized version of Algorithm9 (along with sone metric fixes).
4548

4649
### `algorithms` module
4750
This folder contains the algorithms to generate counterfactuals. **TenthMethod.py** contains the final method to generate counterfactuals.
4851
The other important baselines that have been used are:
49-
1. WachterCF.py -> Manan's base paper uses this - this is the original Wachter implementation of the code along with the optimized version
50-
2. MananWithCausalityCF.py -> Manan's base paper with causality uses this along with the optimized version
51-
3. baseCF.py -> Base class which is the basis for all the methods
52+
1. ***WachterCF.py*** -> Manan's base paper uses this - this is the original Wachter implementation of the code along with the optimized version
53+
2. ***MananWithCausalityCF.py*** -> Manan's base paper with causality uses this along with the optimized version
54+
3. ***baseCF.py*** -> Base class which is the basis for all the methods
5255

5356
Some of the other files have been shifted to a separate folder and are described as below:
54-
* FirstMethod.py-NinthMethod.py -> Older implementations of 'TenthMethod.py'. Some older ones dont have the proper causality model, some in between are unoptimized for causality (not involving the use of the dictionary) and some near the end are just similar files but used by the corresponding files Algorithm5-Algorithm9.
57+
* ***FirstMethod.py***-***NinthMethod.py*** -> Older implementations of 'TenthMethod.py'. Some older ones dont have the proper causality model, some in between are unoptimized for causality (not involving the use of the dictionary) and some near the end are just similar files but used by the corresponding files Algorithm5-Algorithm9.
5558

5659
### `dataset_gen` module
57-
* dataset_generator.py -> Used to create the synthetic datasets and save as csv files
58-
* dataset_pickler.py -> Used to pickle the datasets - it may or may not be working as it was tested a long time ago
60+
* ***dataset_generator.py*** -> Used to create the synthetic datasets and save as csv files
61+
* ***dataset_pickler.py*** -> Used to pickle the datasets - it may or may not be working as it was tested a long time ago
5962

6063
### `model` module
61-
* create_model.py -> Used to create the models we use to run our method using custom_sequential.py
62-
* custom_sequential.py -> Model definitions are available here
63-
* mlp_classifier.py -> Model definitions of a simple MLP model - it may not be working as of now
64+
* ***create_model.py*** -> Used to create the models we use to run our method using custom_sequential.py
65+
* ***custom_sequential.py*** -> Model definitions are available here
66+
* ***mlp_classifier.py*** -> Model definitions of a simple MLP model - it may not be working as of now
6467

6568
### `scm` module
66-
* Node.py and SCM.py-> Used to create the custom SCM models we use with MananWithCausalityCF.py
69+
* ***Node.py*** and ***SCM.py***-> Used to create the custom SCM models we use with MananWithCausalityCF.py
6770
This folder also contains causallearn, dowhy and graphviz packages in its entirety - this was done because there were some issues with respect to imports.
6871

6972
### `util` module

0 commit comments

Comments
 (0)