API
Abstract Types
Models.Template
— TypeModels.Model
— TypeModel
A Model is a trained Template
with which one can predict
on inputs. Defined as well are the traits:
Common API
StatsBase.fit
— Functionfit(::Template, output, input, [weights]) -> Model
Fit the Template
to the output
and input
data and return a trained Model
. Convention is that weights
defaults to StatsBase.uweights(Float32, size(outputs, 2))
StatsBase.predict
— Functionpredict(::Model, input)
Predict targets for the provided input
and Model
.
Returns a predictive distribution or point estimates depending on the Model
.
Models.submodels
— Functionsubmodels(::Union{Template, Model})
Return all submodels within a multistage model/template.
Submodels are models within a model that have their own inputs (which may or may not be combined with outputs of earlier submodels, before actually being passed as input to the submodel). Such multistage models take a tuple of inputs (which may be nested if the submodel itself has submodels). The order of submodels returned by submodels
is as per the order of the inputs in the tuple.
For single-stage models, (i.e. ones that simply take a matrix as input), this returns an empty tuple. Wrapper models which do not expose their inner models to seperate inputs, including ones that only wrap a single model, should not define submodels
as they are (from the outside API perspective) single-stage models.
Models.estimate_type
— FunctionModels.output_type
— FunctionTraits
Models.EstimateTrait
— TypeEstimateTrait
The EstimateTrait
specifies if the model outputs a point or distribution estimate, denoted by PointEstimate
or DistributionEstimate
, respectively.
Models.PointEstimate
— TypePointEstimate <: EstimateTrait
Specifies that the Model
returns real-valued response variables.
Models.DistributionEstimate
— TypeDistributionEstimate <: EstimateTrait
Specifies that the Model
returns a posterior distribution over the response variables.
Models.OutputTrait
— TypeOutputTrait
The OutputTrait
specifies if the model supports single or multiple response variables, denoted by SingleOutput
or MultiOutput
, respectively.
Models.SingleOutput
— TypeSingleOutput <: OutputTrait
Specifies that the Model
returns a single, univariate response variable.
Models.MultiOutput
— TypeMultiOutput <: OutputTrait
Specifies that the Model
returns a multivariate response variable.