Skip to content

Control of random generator #360

@lionelkusch

Description

@lionelkusch

For all the children classes of BasePerturbation, the randomness only appears at the .predict() step. So, for clarity, I suggest we only set/check random_state starting from that stage.

In addition, it would be desirable that the behavior of the fitted class is deterministic: calling twice .importance() on the same data gives the same result.

I suggest that we expose the random_state at the importance/predict methods, but not before.

For compatibility with CFI, this requires modifying the ConditionalSampler, which currently takes the random_state at init but only uses it at .sample() we could thus make it an argument of .sample(random_state=None)

Originally posted by @jpaillard in #344 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions