-
Notifications
You must be signed in to change notification settings - Fork 111
/
show.jl
34 lines (27 loc) · 837 Bytes
/
show.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function Base.show(io::IO, dm::DMatrix)
show(io, typeof(dm))
print(io, "(", size(dm,1), ", ", size(dm,2), ")")
end
function Base.show(io::IO, b::Booster)
show(io, typeof(b))
print(io, "()")
end
"""
importancereport(b::Booster)
Show a convenient text display of the table output by [`importancetable`](@ref).
This is intended entirely for display purposes, see [`importance`](@ref) for how to retrieve
feature importance statistics directly.
!!! note
In Julia >= 1.9, you have to load Term.jl to be able to use this functionality.
"""
function importancereport end
function Base.show(io::IO, node::Node)
show(io, typeof(node))
print(io, "(")
if isempty(children(node))
print(io, "leaf=", node.leaf)
else
print(io, "split_feature=", node.split)
end
print(io, ")")
end