Computes some kind of error by comparing the trees' predictions to the validation set
FrequencyError sets up the most common case when dealing with discrete distributions: - compute and sum errors separately for each component of the actual distribution - provide a zero for when predictions or actuals are missing
A Predicate
is a function which accepts or rejects feature values.
A Predicate
is a function which accepts or rejects feature values.
Given a value of type V
, apply()
will return a Boolean
indicating whether the predicate matches or not.
There are six types of predicates:
Predicates can be negated using !
, and can be transformed using
map
. Evaluating a predicate requires an Ordering, but this
constraint is not enforced during construction, only when apply()
is invoked.
Simple data type that provides rules to order nodes during traversal.
Simple data type that provides rules to order nodes during traversal.
In some cases subtypes of Reorder will also wraps RNG state, for instances that need to randomly select instances. Thus, Reorder is not guaranteed to be referentially-transparent. Fresh instances should be used with each traversal.
Reorder will also continue to recurse into a given structure using a provided callback method.
The reason that the node type is provided to apply
(instead of
Reorder
) has to do with how generic trees are specified. Since
TreeOps uses path-dependent types to specify node types, the
current design is a bit of a kludge that makes it easy to get the
types right when handling a Reorder instance to a TreeTraversal
instance (which is parameterized on a generic tree type).
A TreeTraversal
provides a way to find all of the leaves in a tree that
some row can evaluate to.
A TreeTraversal
provides a way to find all of the leaves in a tree that
some row can evaluate to. Specifically, there may be cases where multiple
predicates in a single split node return true
for a given row (eg missing
features). A tree traversal chooses which paths to go down (which may be all
of them) and the order in which they are traversed.
Combines multiple targets into a single prediction *
Allows for typeclasses to be requested, but for fallbacks to be used if the preferred typeclass isn't available.
Allows for typeclasses to be requested, but for fallbacks to be used if the
preferred typeclass isn't available. For example, if you'd prefer a Group
because the algorithm will run faster, but can make do with a Monoid
you
could use an implicit like implicit ev: Group[A] WithFallback Monoid[A]
.