diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..ed9d9f1 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + project: + default: + threshold: 0.5% + patch: + default: + target: 80% \ No newline at end of file diff --git a/Project.toml b/Project.toml index 2a7aa8d..d1b325d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MLJDecisionTreeInterface" uuid = "c6f25543-311c-4c74-83dc-3ea6d1015661" authors = ["Anthony D. Blaom "] -version = "0.4.0" +version = "0.4.1" [deps] CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" @@ -21,7 +21,8 @@ julia = "1.6" MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d" MLJTestInterface = "72560011-54dd-4dc2-94f3-c5de45b75ecd" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" +StatisticalMeasures = "a19d573c-0a75-4610-95b3-7071388c7541" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["MLJBase", "MLJTestInterface", "StableRNGs", "Test"] +test = ["MLJBase", "MLJTestInterface", "StableRNGs", "StatisticalMeasures", "Test"] diff --git a/README.md b/README.md index d972e17..5a14e86 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# DecisionTree.jl +# MLJDecisionTreeInterface.jl Repository implementing the MLJ model interface for [DecisionTree](https://github.com/bensadeghi/DecisionTree.jl) models. diff --git a/src/MLJDecisionTreeInterface.jl b/src/MLJDecisionTreeInterface.jl index d85dbf0..ca639bf 100644 --- a/src/MLJDecisionTreeInterface.jl +++ b/src/MLJDecisionTreeInterface.jl @@ -15,9 +15,10 @@ const PKG = "MLJDecisionTreeInterface" struct TreePrinter{T} tree::T + features::Vector{Symbol} end -(c::TreePrinter)(depth) = DT.print_tree(c.tree, depth) -(c::TreePrinter)() = DT.print_tree(c.tree, 5) +(c::TreePrinter)(depth) = DT.print_tree(c.tree, depth, feature_names = c.features) +(c::TreePrinter)() = DT.print_tree(c.tree, 5, feature_names = c.features) Base.show(stream::IO, c::TreePrinter) = print(stream, "TreePrinter object (call with display depth)") @@ -71,7 +72,7 @@ function MMI.fit( cache = nothing report = ( classes_seen=classes_seen, - print_tree=TreePrinter(tree), + print_tree=TreePrinter(tree, features), features=features, ) return fitresult, cache, report @@ -765,6 +766,8 @@ The fields of `fitted_params(mach)` are: # Report +The fields of `report(mach)` are: + - `features`: the names of the features encountered in training @@ -862,6 +865,8 @@ The fields of `fitted_params(mach)` are: # Report +The fields of `report(mach)` are: + - `features`: the names of the features encountered in training @@ -968,6 +973,8 @@ The fields of `fitted_params(mach)` are: # Report +The fields of `report(mach)` are: + - `features`: the names of the features encountered in training @@ -1079,6 +1086,8 @@ The fields of `fitted_params(mach)` are: # Report +The fields of `report(mach)` are: + - `features`: the names of the features encountered in training diff --git a/test/runtests.jl b/test/runtests.jl index a2932a2..7252294 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,6 +6,7 @@ using StableRNGs using Random using Tables import MLJTestInterface +using StatisticalMeasures # load code to be tested: import DecisionTree