aiim-research/GRETEL

Possible error in IRandExplainer

Davide-F5-Marincione opened this issue · 2 comments

Good morning,
I was about to test this explainer but found the following fallacy in the code: since the explainer drops and adds edges at random, the edge weights should too be added or dropped by the explainer... right? If that makes sense; then the code doesn't do so! And, indeed this leads to inference errors when running the produced counterfactual in the oracle.

I propose to solve this by a simple fix: substitute

result.data = cf_cand_matrix
# TODO this resetting of the nx representation it is not very robust
result._nx_repr = None

with

result = GraphInstance(instance.id, label=instance.label, data=cf_cand_matrix, node_features=instance.node_features)

Hopefully this makes sense, have a good day,
solaire_of_astora

I think it was already solved in the meanwhile by  @MarioTheOne .
Please double check it and close it in case it is solved.

Thanks @Davide-F5-Marincione

The problem was solved, thanks!