Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Add new sumLeaves method (or similar) #40

Closed
tixxit opened this issue Mar 12, 2015 · 1 comment
Closed

Add new sumLeaves method (or similar) #40

tixxit opened this issue Mar 12, 2015 · 1 comment

Comments

@tixxit
Copy link
Contributor

tixxit commented Mar 12, 2015

We currently get only 1 leaf in leafFor, but it is possible we may want to allow paths to diverge during tree evaluation (eg feature is missing). To do this, we should add a new sumLeaves method which allows us traverse down multiple paths and aggregate the results using the prior probabilities of each diverging path.

During tree traversal, we'd always follow edges whose predicates return true. We would also allow nodes to have multiple true predicates. For each true edge, we'd determine their prior probabilities relative to all true edges and use it to scale the result returned for each edge, then sum the result. The method may look something like:

def sumLeaves[C[_], A: Numeric](row: Map[K, V])(f: Leaf => C[A])(implicit vs: VectorSpace[A, C]): C[A] = ???
@tixxit
Copy link
Contributor Author

tixxit commented Oct 9, 2015

This is covered by the TreeTraversal work.

@tixxit tixxit closed this as completed Oct 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant