Mixed-integer approximators
These are the functions that help generate MI approximations of global optimization problems using the BlackBoxLearners.
Work in progress...
Main.OCTHaGOn.add_feas_constraints!
— FunctionCreates a set of binary feasibility constraints from a binary classification tree. Arguments:
- m: JuMP Model
- x: independent JuMP.Variables (features in lnr)
- lnr: A fitted OptimalTreeClassifier
- equality: whether the constraint is an equality.
NOTE: lcs, mic and lv are only nonempty if we are adding an OCT approximation of a BBR. Leave defaults empty for basic usage.
Main.OCTHaGOn.add_regr_constraints!
— Functionadd_regr_constraints!(m::JuMP.Model, x::Array{JuMP.VariableRef}, y::JuMP.VariableRef, lnr::IAI.OptimalTreeLearner,
ul_data::Dict; equality::Bool = false)
Creates a set of MIO constraints from a OptimalTreeClassifier that thresholds a BlackBoxRegressor.
Arguments:
- m: JuMP.Model
- x:: independent JuMP.Variables (features of learner)
- y:: dependent JuMP.Variables
- lnr:: A fitted OptimalTreeLearner
- ul_data:: Upper and lower bounding hyperplanes for data in leaves of lnr (empty by default)
Main.OCTHaGOn.add_tree_constraints!
— Functionadd_tree_constraints!(gm::GlobalModel, bbl::BlackBoxLearner)
add_tree_constraints!(gm::GlobalModel, bbls::Vector{BlackBoxLearner})
add_tree_constraints!(gm::GlobalModel)
Generates MI constraints from gm.learners, and adds them to gm.model.
Main.OCTHaGOn.all_mi_constraints
— Functionall_mi_constraints(bbl::BlackBoxLearner)
Returns all JuMP.ConstraintRefs associated with BBL.
Main.OCTHaGOn.clear_data!
— Functionclear_data!(bbc::BlackBoxClassifier) -> Array{Any,1}
Deletes all data (NOT constraints) associated with object. Please clear constraints using the clear_tree_constraints!
function.
Clears all sampling, training and optimization data from GlobalModel.
Main.OCTHaGOn.clear_tree_constraints!
— Functionclear_tree_constraints!(gm::GlobalModel, bbc::Union{BlackBoxClassifier, LinkedClassifier})
Clears the MI-approximating constraints and variables in GlobalModel and its sub-structs.
Main.OCTHaGOn.clear_tree_data!
— Functionclear_tree_data!(bbc::BlackBoxClassifier)
clear_tree_data!(bbr::BlackBoxRegressor)
Deletes tree data associated with object.
Main.OCTHaGOn.update_tree_constraints!
— Functionupdate_tree_constraints!(gm::GlobalModel, bbr::BlackBoxRegressor, idx = length(bbr.learners))
update_tree_constraints!(gm::GlobalModel, bbc::BlackBoxClassifier, idx = length(bbc.learners))
Updates the MI constraints associated with a BBL. For BBRs, makes sure to replace the appropriate lower/upper/regressor approximations.
Main.OCTHaGOn.clear_lower_constraints!
— FunctionClears lower-bounding constraints from a BBR and its associated GM.
Main.OCTHaGOn.clear_upper_constraints!
— FunctionClears upper-bounding constraints from a BBR and its associated GM.
Main.OCTHaGOn.add_relaxation_variables!
— Functionfunction add_relaxation_variables!(gm::GlobalModel, bbl::Union{BlackBoxLearner, LinkedLearner})
function add_relaxation_variables!(gm::GlobalModel, bbls::Array)
Populates relax_var attributes of all substructs.
Main.OCTHaGOn.clear_relaxation_variables!
— Functionclear_relaxation_variables!(gm::GlobalModel, bbl::Union{BlackBoxClassifier, BlackBoxRegressor, LinkedClassifier, LinkedRegressor})
Clears slack variables in GlobalModel.