Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mkdir #10

Merged
merged 1 commit into from Nov 22, 2022
Merged

fix mkdir #10

merged 1 commit into from Nov 22, 2022

Conversation

jiaqima
Copy link
Collaborator

@jiaqima jiaqima commented Nov 22, 2022

Description

Changed os.mkdir(...) to os.makedirs(..., exist_ok=True) to fix the bug when pretrained folder already exists.

Together with commit da70155 by @chirag126, this should fix #4.

Test

Tested locally by running python openxai/api.py.

Also tested locally by running the following piece of code outside the OpenXAI folder:

from openxai.api import OpenXAI
oxai = OpenXAI(data_name="german", model_name="ann", explainer_name="lime")
df_full = oxai.query()
print(df_full.head())

and obtained the following outputs:

   duration    amount  installment-rate  ...  label  prediction  is_test
0  0.205882  0.228094          0.666667  ...    0.0         1.0      0.0
1  0.294118  0.072564          1.000000  ...    1.0         1.0      0.0
2  0.294118  0.064395          1.000000  ...    1.0         1.0      0.0
3  0.470588  0.355607          1.000000  ...    1.0         1.0      0.0
4  0.470588  0.421916          1.000000  ...    1.0         1.0      0.0

[5 rows x 123 columns]

@jiaqima jiaqima linked an issue Nov 22, 2022 that may be closed by this pull request
@jiaqima jiaqima merged commit f9fd545 into AI4LIFE-GROUP:main Nov 22, 2022
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.

[FEATURE REQUEST] Clean up hard-coded paths
1 participant