Internal API

General

EvoTrees.EvoTreeType
EvoTree{L,K}

An EvoTree holds the structure of a fitted gradient-boosted tree.

Fields

  • trees::Vector{Tree{L,K}}
  • info::Dict

EvoTree acts as a functor to perform inference on input data:

pred = (m::EvoTree; ntree_limit=length(m.trees))(x)
source
EvoTrees.check_parameterFunction
check_parameter(::Type{<:T}, value, min_value::Real, max_value::Real, label::Symbol) where {T<:Number}

Check model parameter if it's valid

source
EvoTrees.check_argsFunction
check_args(args::Dict{Symbol,Any})

Check model arguments if they are valid

source
check_args(model::EvoTypes{L}) where {L}

Check model arguments if they are valid (eg, after mutation when tuning hyperparams) Note: does not check consistency of model type and loss selected

source

Training utils

EvoTrees.initFunction
init(
    params::EvoTypes,
    dtrain,
    device::Type{<:Device}=CPU;
    target_name,
    fnames=nothing,
    w_name=nothing,
    offset_name=nothing
)

Initialise EvoTree

source
init(
    params::EvoTypes,
    x_train::AbstractMatrix,
    y_train::AbstractVector,
    device::Type{<:Device}=CPU;
    fnames=nothing,
    w_train=nothing,
    offset_train=nothing
)

Initialise EvoTree

source
EvoTrees.grow_evotree!Function
grow_evotree!(evotree::EvoTree{L,K}, cache, params::EvoTypes{L}, ::Type{<:Device}=CPU) where {L,K}

Given a instantiate

source
EvoTrees.update_gains!Function
update_gains!(
    loss::L,
    node::TrainNode{T},
    js::Vector,
    params::EvoTypes, K, monotone_constraints) where {L,T,S}

Generic fallback

source
EvoTrees.predict!Function
predict!(pred::Matrix, tree::Tree, X)

Generic fallback to add predictions of tree to existing pred matrix.

source
EvoTrees.subsampleFunction
subsample(out::AbstractVector, mask::AbstractVector, rowsample::AbstractFloat)

Returns a view of selected rows ids.

source
EvoTrees.split_set_chunk!Function
Multi-threaded split_set!
    Take a view into left and right placeholders. Right ids are assigned at the end of the length of the current node set.
source

Histogram

EvoTrees.get_edgesFunction
get_edges(X::AbstractMatrix{T}; fnames, nbins, rng=Random.TaskLocalRNG()) where {T}
get_edges(df; fnames, nbins, rng=Random.TaskLocalRNG())

Get the histogram breaking points of the feature data.

source
EvoTrees.binarizeFunction
binarize(X::AbstractMatrix; fnames, edges)
binarize(df; fnames, edges)

Transform feature data into a UInt8 binarized matrix.

source