Skip to content

Commit 3b35cd7

Browse files
committed
add human_name to MODEL_TRAITS and metadata_model
1 parent 1766340 commit 3b35cd7

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/MLJModelInterface.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const MODEL_TRAITS = [
2020
:supports_online,
2121
:docstring,
2222
:name,
23+
:human_name,
2324
:is_supervised,
2425
:prediction_type,
2526
:abstract_type,

src/metadata_utils.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ function metadata_model(
110110
supports_class_weights::Union{Nothing,Bool}=weights,
111111
docstring::Union{Nothing,String}=descr,
112112
load_path::Union{Nothing,String}=path,
113+
human_name::Union{Nothing,String}=nothing
113114
)
114115

115116
load_path === nothing && @warn WARN_MISSING_LOAD_PATH
@@ -126,6 +127,7 @@ function metadata_model(
126127
_extend!(program, :supports_class_weights,supports_class_weights, T)
127128
_extend!(program, :docstring, docstring, T)
128129
_extend!(program, :load_path, load_path, T)
130+
_extend!(program, :human_name, human_name, T)
129131

130132
parentmodule(T).eval(program)
131133
end

test/metadata_utils.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ infos = Dict(trait => eval(:(MLJModelInterface.$trait))(FooRegressor) for
5151
@test !infos[:supports_online]
5252
@test infos[:docstring] == "Cool model\n"
5353
@test infos[:name] == "FooRegressor"
54+
@test infos[:human_name] == "foo regressor"
5455
@test infos[:is_supervised]
5556
@test infos[:prediction_type] == :deterministic
5657
@test infos[:implemented_methods] == [:clean!]

0 commit comments

Comments
 (0)