Packages

Elixir bindings for the XGBoost library. `EXGBoost` provides an implementation of XGBoost that works with [Nx](https://hexdocs.pm/nx/Nx.html) tensors.

Current section

Files

Jump to
exgboost lib exgboost training state.ex
Raw

lib/exgboost/training/state.ex

defmodule EXGBoost.Training.State do
@moduledoc false
@enforce_keys [:booster]
defstruct [
:booster,
iteration: 0,
max_iteration: -1,
meta_vars: %{},
metrics: %{},
status: :cont
]
def validate!(%__MODULE__{} = state) do
unless state.status in [:cont, :halt] do
raise ArgumentError,
"`status` must be `:cont` or `:halt`, found: `#{inspect(state.status)}`."
end
state
end
end