[mlpack-git] [mlpack/mlpack] Universal B tree implementation (#746)
Ryan Curtin
notifications at github.com
Thu Aug 25 11:53:24 EDT 2016
> +template<typename BoundType, typename MatType>
> +bool UBTreeSplit<BoundType, MatType>::SplitNode(BoundType& bound,
> + MatType& data,
> + const size_t begin,
> + const size_t count,
> + SplitInfo& splitInfo)
> +{
> + constexpr size_t order = sizeof(AddressElemType) * CHAR_BIT;
> + if (begin == 0 && count == data.n_cols)
> + {
> + // Calculate all addresses.
> + InitializeAddresses(data);
> +
> + // Probably this is not a good idea. Maybe it is better to get
> + // a number of distinct samples and find the median.
> + std::sort(addresses.begin(), addresses.end(), ComparePair);
I think this is an okay approach for now. Generally tree construction time is pretty minimal compared to the actual search time, so I don't know if there's much need to actually do the sampling to calculate the median.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/746/files/f17843fc8e8ef2b1c4b04d572c521575f20a1f3c#r76270969
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160825/bc3ffee0/attachment.html>
More information about the mlpack-git
mailing list