robustx.lib package

Subpackages

Submodules

robustx.lib.DefaultBenchmark module

robustx.lib.DefaultBenchmark.default_benchmark(ct, methods, evaluations, subset=None, **params)[source]

Generates and prints a table summarizing the performance of different counterfactual explanation generation methods.

@param ct: ClassificationTask. @param methods: A list or a set of method names. @param evaluations: A list or a set of evaluator names. @param subset: optional DataFrame, subset of instances you would like to generate CEs on @param **params: Additional parameters to be passed to the CE generation methods and evaluators. @return: None

robustx.lib.OptSolver module

class robustx.lib.OptSolver.OptSolver(ct)[source]

Bases: object

A solver class that uses Gurobi to optimize a model based on a given task and instance.

Attributes / Properties

task: Task

The task to be optimized.

gurobiModel: Model

The Gurobi optimization model.

inputNodes: dict

Dictionary to store Gurobi variables for input nodes.

outputNode: Gurobi variable

The Gurobi variable representing the output node.

setup(instance, desired_output=1, delta=0.5, bias_delta=0, M=1000000000, epsilon=0.0001, fix_inputs=True):

Sets up the Gurobi model with constraints based on the provided instance and parameters.

-------
setup(instance, delta=0, bias_delta=0, M=1000, fix_inputs=True)[source]

Sets up the Gurobi model with constraints based on the provided instance and parameters.

@param instance: pd.DataFrame or list, The input data instance for which to set up the model. @param desired_output: int, Optional, The desired output value (default is 1). @param delta: float, Optional, The delta value used in constraints (default is 0.5). @param bias_delta: float, Optional, The bias delta value used in constraints (default is 0). @param M: float, Optional, A large constant used in constraints (default is 1000000000). @param epsilon: float, Optional, The epsilon value used in constraints (default is 0.0001). @param fix_inputs: bool, Optional, Whether to fix input values or use variable bounds (default is True).

@return: None

robustx.lib.PyTorchConversions module

Module contents