Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ styleguide.txt
makefile
.DS_Store
Manifest.toml
.vscode
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "DecisionTree"
uuid = "7806a523-6efd-50cb-b5f6-3fa6f1930dbb"
license = "MIT"
desc = "Julia implementation of Decision Tree (CART) and Random Forest algorithms"
version = "0.11.2"
version = "0.11.3"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
7 changes: 4 additions & 3 deletions src/abstract_trees.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ in "Towards Data Science":
["If things are not ready to use"](https://towardsdatascience.com/part-iii-if-things-are-not-ready-to-use-59d2db378bec)
"""


"""
InfoNode{S, T}
InfoLeaf{T}
Expand All @@ -30,15 +29,17 @@ In analogy to the type definitions of `DecisionTree`, the generic type `S` is
the type of the feature values used within a node as a threshold for the splits
between its children and `T` is the type of the classes given (these might be ids or labels).
"""
struct InfoNode{S, T}
struct InfoNode{S, T} <: AbstractTrees.AbstractNode{DecisionTree.Node{S,T}}
node :: DecisionTree.Node{S, T}
info :: NamedTuple
end
AbstractTrees.nodevalue(n::InfoNode) = n.node

struct InfoLeaf{T}
struct InfoLeaf{T} <: AbstractTrees.AbstractNode{DecisionTree.Leaf{T}}
leaf :: DecisionTree.Leaf{T}
info :: NamedTuple
end
AbstractTrees.nodevalue(l::InfoLeaf) = l.leaf

"""
wrap(node::DecisionTree.Node, info = NamedTuple())
Expand Down