Internal API
General
EvoTrees.TrainNode — TypeTrainNode{S,V,M}Carries training information for a given tree node
EvoTrees.EvoTree — TypeEvoTree{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)EvoTrees.check_parameter — Functioncheck_parameter(::Type{<:T}, value, min_value::Real, max_value::Real, label::Symbol) where {T<:Number}Check model parameter if it's valid
EvoTrees.check_args — Functioncheck_args(args::Dict{Symbol,Any})Check model arguments if they are valid
check_args(model::EvoTypes)Check model arguments if they are valid (eg, after mutation when tuning hyperparams) Note: does not check consistency of model type and loss selected
Training utils
EvoTrees.init — Functioninit(
params::EvoTypes,
dtrain,
device::Type{<:Device}=CPU;
target_name,
feature_names=nothing,
weight_name=nothing,
offset_name=nothing
)Initialise EvoTree
init(
params::EvoTypes,
x_train::AbstractMatrix,
y_train::AbstractVector,
device::Type{<:Device}=CPU;
feature_names=nothing,
w_train=nothing,
offset_train=nothing
)Initialise EvoTree
EvoTrees.grow_evotree! — Functiongrow_evotree!(evotree::EvoTree{L,K}, cache, params::EvoTypes) where {L,K}Given a instantiate
EvoTrees.get_best_split — Functionget_best_split(
::Type{L},
node::TrainNode,
js,
params::EvoTypes,
feattypes::Vector{Bool},
monotone_constraints,
)Generic fallback
EvoTrees.update_gains! — Functionupdate_gains!(
::Type{L},
node::TrainNode,
js,
params::EvoTypes,
feattypes::Vector{Bool},
monotone_constraints,
)EvoTrees.predict! — Functionpredict!(pred::Matrix, tree::Tree, X)Generic fallback to add predictions of tree to existing pred matrix.
EvoTrees.subsample — Functionsubsample(left::AbstractVector, is::AbstractVector, mask_cond::AbstractVector{UInt8}, rowsample::AbstractFloat, rng)Returns a view of selected rows ids.
EvoTrees.split_set_chunk! — Functionsplit_set_chunk!(
left,
right,
is,
bid,
nblocks,
x_bin,
feat,
cond_bin,
feattype,
offset,
chunk_size,
)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.
Histogram
EvoTrees.get_edges — Functionget_edges(X::AbstractMatrix{T}; feature_names, nbins, rng=Random.TaskLocalRNG()) where {T}
get_edges(df; feature_names, nbins, rng=Random.TaskLocalRNG())Get the histogram breaking points of the feature data.
EvoTrees.binarize — Functionbinarize(X::AbstractMatrix; feature_names, edges)
binarize(df; feature_names, edges)Transform feature data into a UInt8 binarized matrix.
EvoTrees.update_hist! — Functionupdate_hist!
GradientRegressionupdate_hist!
MLE2Pupdate_hist!Generic fallback - Softmax