From 6d8015ead6a40cb930b2927429b960cafd7c9a08 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 8 Mar 2021 17:28:32 +1300 Subject: [PATCH] add supports_training_losses --- src/StatisticalTraits.jl | 4 +++- test/runtests.jl | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/StatisticalTraits.jl b/src/StatisticalTraits.jl index 003df24..cb22274 100644 --- a/src/StatisticalTraits.jl +++ b/src/StatisticalTraits.jl @@ -32,7 +32,8 @@ const TRAITS = [ :aggregation, :is_feature_dependent, :distribution_type, - :iteration_parameter + :iteration_parameter, + :supports_training_losses ] @@ -166,6 +167,7 @@ is_feature_dependent(::Type) = false reports_each_observation(::Type) = false distribution_type(::Type) = missing iteration_parameter(::Type) = nothing +supports_training_losses(::Type) = false # Returns a tuple, with one entry per field of `T` (the type of some # statistical model, for example). Each entry is `nothing` or defines diff --git a/test/runtests.jl b/test/runtests.jl index ed9c3b7..a0fd79a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -83,8 +83,7 @@ const NONCONSTANT = [:docstring, :name, :human_name, :hyperparameters, - :hyperparameter_types, - :iteration_parameter] + :hyperparameter_types] @testset "traits with constant fall-back" begin for trait in setdiff(StatisticalTraits.TRAITS, NONCONSTANT)