Interface

Public

DecisionFocusedLearningBenchmarks.Utils.DataSampleType
struct DataSample{I, F<:AbstractArray, S<:Union{Nothing, AbstractArray}, C<:Union{Nothing, AbstractArray}}

Data sample data structure.

Fields

  • x::AbstractArray: features

  • θ_true::Union{Nothing, AbstractArray}: target cost parameters (optional)

  • y_true::Union{Nothing, AbstractArray}: target solution (optional)

  • instance::Any: instance object (optional)

source
DecisionFocusedLearningBenchmarks.Utils.compute_gapFunction
compute_gap(
    bench::AbstractBenchmark,
    dataset::AbstractVector{<:DataSample},
    statistical_model,
    maximizer
) -> Any
compute_gap(
    bench::AbstractBenchmark,
    dataset::AbstractVector{<:DataSample},
    statistical_model,
    maximizer,
    op
) -> Any

Default behaviour of compute_gap for a benchmark problem where features, solutions and costs are all defined.

source
DecisionFocusedLearningBenchmarks.Utils.grid_graphMethod
grid_graph(
    costs::AbstractArray{R, 2};
    acyclic
) -> SimpleWeightedGraphs.SimpleWeightedDiGraph{Int64}

Convert a grid of cell costs into a weighted directed graph from SimpleWeightedGraphs.jl, where the vertices correspond to the cells and the edges are weighted by the cost of the arrival cell.

  • If acyclic = false, a cell has edges to each one of its 8 neighbors.
  • If acyclic = true, a cell has edges to its south, east and southeast neighbors only (ensures an acyclic graph where topological sort will work)

This can be used to model the Warcraft shortest paths problem of

Differentiation of Blackbox Combinatorial Solvers, Vlastelica et al. (2019)

source

Private

StatsAPI.fitMethod
fit(
    transform_type,
    dataset::AbstractVector{<:DataSample};
    kwargs...
)

Fit the given transform type (ZScoreTransform or UnitRangeTransform) on the dataset.

source
StatsBase.reconstruct!Method
reconstruct!(t, dataset::AbstractVector{<:DataSample})

Reconstruct the features in the dataset in place.

source
StatsBase.reconstructMethod
reconstruct(t, dataset::AbstractVector{<:DataSample}) -> Any

Reconstruct the features in the dataset.

source
StatsBase.transform!Method
transform!(t, dataset::AbstractVector{<:DataSample})

Transform the features in the dataset in place.

source
StatsBase.transformMethod
transform(t, dataset::AbstractVector{<:DataSample}) -> Any

Transform the features in the dataset.

source