[mlpack-git] [mlpack/mlpack] Random projection trees (#726)
Ryan Curtin
notifications at github.com
Tue Aug 16 14:56:22 EDT 2016
> +{
> + ElemType dist = 0;
> +
> + for (size_t i = 0; i < samples.n_elem; i++)
> + for (size_t j = i + 1; j < samples.n_elem; j++)
> + dist += metric::SquaredEuclideanDistance::Evaluate(data.col(samples[i]),
> + data.col(samples[j]));
> +
> + dist /= (samples.n_elem * (samples.n_elem - 1) / 2);
> +
> + return dist;
> +}
> +
> +template<typename BoundType, typename MatType>
> +void RPTreeMeanSplit<BoundType, MatType>::GetRandomDirection(
> + arma::Col<ElemType>& direction)
I don't know if I have already written this somewhere else, but would it be better to move this to `core/math/` as a standalone function?
--
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/726/files/ea66e5d17914460289974cc61f0669941edc2524#r74998123
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160816/d9cadbdd/attachment.html>
More information about the mlpack-git
mailing list