[mlpack-git] [mlpack/mlpack] Spill trees (#747)

Ryan Curtin notifications at github.com
Sat Aug 13 21:34:16 EDT 2016

> +  /**
> +   * Create a splitting hyperplane considering the midpoint of the values in a
> +   * certain projection.
> +   *
> +   * @param bound The bound used for this node.
> +   * @param data The dataset used by the tree.
> +   * @param points Vector of indexes of points to be considered.
> +   * @param hyp Resulting splitting hyperplane.
> +   * @return Flag to determine if split is possible.
> +   */
> +  template<typename HyperplaneType>
> +  static bool SplitSpace(
> +      const typename HyperplaneType::BoundType& bound,
> +      const MatType& data,
> +      const arma::Col<size_t>& points,
> +      HyperplaneType& hyp);

I think you mentioned in #726 that @lozhnikov could use this class for splitting the random projection tree.  I agree, that could be done, but maybe it is worth refactoring this as well as the `MeanSplit` and `MedianSplit` classes in order to have the same API.  The key here would be to make `MatType` a template parameter to the `SplitSpace()` method and then you could pass either an Armadillo contiguous subview (i.e. `mat.cols(begin, begin + count - 1)`) or a non-contiguous subview (i.e. `mat.cols(points)` where `points` is an `arma::uvec` with indices of points).

As you wrote in that ticket, it seems reasonable to do some refactoring and have three template parameters: the type of splitting hyperplane, how to choose the hyperplane, and which splitting value we will consider.  What do you think is the best way to do this refactoring?  Should we make a class that is used by `BinarySpaceTree` that has these three parameters, or should we make `BinarySpaceTree` have those three parameters directly and then make sure we can still make the vantage point tree using those parameters?

Whatever we do will be reverse-incompatible for the "internal API", so it would mean the next version is at least a minor version bump (I'm just fine with that).

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160813/3bd187ce/attachment.html>

More information about the mlpack-git mailing list