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!Function

Creates 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.

source
Main.OCTHaGOn.add_regr_constraints!Function
add_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)
source
Main.OCTHaGOn.add_tree_constraints!Function
add_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.

source
Main.OCTHaGOn.clear_data!Function
clear_data!(bbc::BlackBoxClassifier) -> Array{Any,1}

Deletes all data (NOT constraints) associated with object. Please clear constraints using the clear_tree_constraints! function.

source

Clears all sampling, training and optimization data from GlobalModel.

source
Main.OCTHaGOn.clear_tree_constraints!Function
clear_tree_constraints!(gm::GlobalModel, bbc::Union{BlackBoxClassifier, LinkedClassifier})

Clears the MI-approximating constraints and variables in GlobalModel and its sub-structs.

source
Main.OCTHaGOn.update_tree_constraints!Function
update_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.

source
Main.OCTHaGOn.add_relaxation_variables!Function
function add_relaxation_variables!(gm::GlobalModel, bbl::Union{BlackBoxLearner, LinkedLearner})
function add_relaxation_variables!(gm::GlobalModel, bbls::Array)

Populates relax_var attributes of all substructs.

source