Skip to content

Commit

Permalink
add supports_training_losses
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed Mar 8, 2021
1 parent 3fedc33 commit 6d8015e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/StatisticalTraits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const TRAITS = [
:aggregation,
:is_feature_dependent,
:distribution_type,
:iteration_parameter
:iteration_parameter,
:supports_training_losses
]


Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6d8015e

Please sign in to comment.