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{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
Training utils
EvoTrees.init
— Functioninit(
params::EvoTypes,
dtrain,
device::Type{<:Device}=CPU;
target_name,
fnames=nothing,
w_name=nothing,
offset_name=nothing
)
Initialise EvoTree
init(
params::EvoTypes,
x_train::AbstractMatrix,
y_train::AbstractVector,
device::Type{<:Device}=CPU;
fnames=nothing,
w_train=nothing,
offset_train=nothing
)
Initialise EvoTree
EvoTrees.grow_evotree!
— Functiongrow_evotree!(evotree::EvoTree{L,K}, cache, params::EvoTypes{L}, ::Type{<:Device}=CPU) where {L,K}
Given a instantiate
EvoTrees.update_gains!
— Functionupdate_gains!(
loss::L,
node::TrainNode{T},
js::Vector,
params::EvoTypes, K, monotone_constraints) where {L,T,S}
Generic fallback
EvoTrees.predict!
— Functionpredict!(pred::Matrix, tree::Tree, X)
Generic fallback to add predictions of tree
to existing pred
matrix.
EvoTrees.subsample
— Functionsubsample(out::AbstractVector, mask::AbstractVector, rowsample::AbstractFloat)
Returns a view of selected rows ids.
EvoTrees.split_set_chunk!
— FunctionMulti-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}; fnames, nbins, rng=Random.TaskLocalRNG()) where {T}
get_edges(df; fnames, nbins, rng=Random.TaskLocalRNG())
Get the histogram breaking points of the feature data.
EvoTrees.binarize
— Functionbinarize(X::AbstractMatrix; fnames, edges)
binarize(df; fnames, edges)
Transform feature data into a UInt8 binarized matrix.
EvoTrees.update_hist!
— Functionupdate_hist!
GradientRegression
update_hist!
MLE2P
update_hist!
Generic fallback - Softmax