Skip to content

Commit 962ec13

Browse files
committed
add feature_names to accessor functions
1 parent 5e08aab commit 962ec13

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/accessor_functions.jl

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,25 @@ LearnAPI.strip(LearnAPI.strip(model)) == LearnAPI.strip(model)
9393
"""
9494
LearnAPI.strip(model) = model
9595

96+
"""
97+
LearnAPI.feature_names(model)
98+
99+
Return the names of features encountered when fitting or updating some `learner` to obtain
100+
`model`.
101+
102+
The value returned value is a vector of symbols.
103+
104+
This method is implemented if `:(LearnAPI.feature_names) in LearnAPI.functions(learner)`.
105+
106+
See also [`fit`](@ref).
107+
108+
# New implementations
109+
110+
$(DOC_IMPLEMENTED_METHODS(":(LearnAPI.feature_names)")).
111+
112+
"""
113+
function feature_names end
114+
96115
"""
97116
LearnAPI.feature_importances(model)
98117
@@ -291,14 +310,14 @@ $(DOC_IMPLEMENTED_METHODS(":(LearnAPI.training_labels)")).
291310
"""
292311
function training_labels end
293312

294-
295313
# :extras intentionally excluded:
296314
const ACCESSOR_FUNCTIONS_WITHOUT_EXTRAS = (
297315
learner,
298316
coefficients,
299317
intercept,
300318
tree,
301319
trees,
320+
feature_names,
302321
feature_importances,
303322
training_labels,
304323
training_losses,

0 commit comments

Comments
 (0)