col_gen_estimator.BDRSubProblem¶
- class col_gen_estimator.BDRSubProblem(D, solver_str='cbc')[source]¶
The subproblem for boolean decision rule generation described in ‘Boolean decision rules via column generation’ by Sanjeeb Dash et. al. 2018. This extends the BaseSubproblem for column generation classifier.
- Parameters:
- Dint,
A parameter used for controlling the complexity of the clause being generated.
- solver_strstring, default=’cbc’
Describes the solver used for solving the subproblem (2).
- Attributes:
- X_ndarray, shape (n_samples, n_features)
The input passed during
generate_columns(). The inputs should only contain values in {0,1}.- y_ndarray, shape (n_samples,)
The labels passed during
generate_columns(). The labels should only contain values in {0,1}.- solver_MPSolver from OR-Tools,
The solver used for solving the subproblem.
- delta_vars_list(int),
Stores the indices of delta variables in (2).
- z_vars_list(int),
Stores the indices of z variables in (2).
- generated_boolean,
True when the master problem model has been generated. False otherwise.
- create_submip(cc_dual, cs_duals)[source]¶
Creates the model for the subproblem. This should be called only once for a given problem. Parameters ———- cc_dual : float,
dual cost of clause complexity constraint (1b).
- cs_dualslist(float),
dual costs of clause satisfaction constraints (1a).
- generate_columns(X, y, dual_costs, params='')[source]¶
Generates the new columns to be added to the RMP. In this case instead of directly generating the coefficients, this method returns the list of generated clauses. The Master problem can find the coefficients from it.
- Parameters:
- Xndarray, shape (n_samples, n_features)
The input. The inputs should only contain values in {0,1}.
- yndarray, shape (n_samples,)
The labels. The labels should only contain values in {0,1}.
- dual_coststuple(float), size=2
Dual costs of constraints (1b) and (1a) in a tuple.
- paramsstring, default=””
Solver parameters.
- update_objective(cc_dual, cs_duals)[source]¶
Updates the objective of the generated subproblem. This can be called only after the create_submip method has been called. Parameters ———- cc_dual : float,
dual cost of clause complexity constraint (1b).
- cs_dualslist(float),
dual costs of clause satisfaction constraints (1a).