Skip to content

Commit a819b1f

Browse files
authored
Merge pull request #55 from JuliaAI/dev
For a 0.4.1 release
2 parents 9232329 + 9e3146d commit a819b1f

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

.github/codecov.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
threshold: 0.5%
6+
patch:
7+
default:
8+
target: 80%

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJDecisionTreeInterface"
22
uuid = "c6f25543-311c-4c74-83dc-3ea6d1015661"
33
authors = ["Anthony D. Blaom <[email protected]>"]
4-
version = "0.4.0"
4+
version = "0.4.1"
55

66
[deps]
77
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
@@ -21,7 +21,8 @@ julia = "1.6"
2121
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
2222
MLJTestInterface = "72560011-54dd-4dc2-94f3-c5de45b75ecd"
2323
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
24+
StatisticalMeasures = "a19d573c-0a75-4610-95b3-7071388c7541"
2425
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2526

2627
[targets]
27-
test = ["MLJBase", "MLJTestInterface", "StableRNGs", "Test"]
28+
test = ["MLJBase", "MLJTestInterface", "StableRNGs", "StatisticalMeasures", "Test"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DecisionTree.jl
1+
# MLJDecisionTreeInterface.jl
22

33
Repository implementing the MLJ model interface for
44
[DecisionTree](https://github.com/bensadeghi/DecisionTree.jl) models.

src/MLJDecisionTreeInterface.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ const PKG = "MLJDecisionTreeInterface"
1515

1616
struct TreePrinter{T}
1717
tree::T
18+
features::Vector{Symbol}
1819
end
19-
(c::TreePrinter)(depth) = DT.print_tree(c.tree, depth)
20-
(c::TreePrinter)() = DT.print_tree(c.tree, 5)
20+
(c::TreePrinter)(depth) = DT.print_tree(c.tree, depth, feature_names = c.features)
21+
(c::TreePrinter)() = DT.print_tree(c.tree, 5, feature_names = c.features)
2122

2223
Base.show(stream::IO, c::TreePrinter) =
2324
print(stream, "TreePrinter object (call with display depth)")
@@ -71,7 +72,7 @@ function MMI.fit(
7172
cache = nothing
7273
report = (
7374
classes_seen=classes_seen,
74-
print_tree=TreePrinter(tree),
75+
print_tree=TreePrinter(tree, features),
7576
features=features,
7677
)
7778
return fitresult, cache, report
@@ -765,6 +766,8 @@ The fields of `fitted_params(mach)` are:
765766
766767
# Report
767768
769+
The fields of `report(mach)` are:
770+
768771
- `features`: the names of the features encountered in training
769772
770773
@@ -862,6 +865,8 @@ The fields of `fitted_params(mach)` are:
862865
863866
# Report
864867
868+
The fields of `report(mach)` are:
869+
865870
- `features`: the names of the features encountered in training
866871
867872
@@ -968,6 +973,8 @@ The fields of `fitted_params(mach)` are:
968973
969974
# Report
970975
976+
The fields of `report(mach)` are:
977+
971978
- `features`: the names of the features encountered in training
972979
973980
@@ -1079,6 +1086,8 @@ The fields of `fitted_params(mach)` are:
10791086
10801087
# Report
10811088
1089+
The fields of `report(mach)` are:
1090+
10821091
- `features`: the names of the features encountered in training
10831092
10841093

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ using StableRNGs
66
using Random
77
using Tables
88
import MLJTestInterface
9+
using StatisticalMeasures
910

1011
# load code to be tested:
1112
import DecisionTree

0 commit comments

Comments
 (0)