[mlpack-git] [mlpack/mlpack] Random projection trees (#726)

lozhnikov notifications at github.com
Wed Aug 17 05:14:12 EDT 2016


> +  // Find the median of scalar products of the samples and the normal vector.
> +  for (size_t k = 0; k < samples.n_elem; k++)
> +    values[k] = arma::dot(data.col(samples[k]), direction);
> +
> +  const ElemType maximum = arma::max(values);
> +  const ElemType minimum = arma::min(values);
> +  if (minimum == maximum)
> +    return false;
> +
> +  splitVal = arma::median(values);
> +
> +  // Add a random deviation to the median.
> +  // This algorithm differs from the method suggested in the
> +  // random projection tree paper.
> +  splitVal += math::Random((minimum - splitVal) * 0.75,
> +      (maximum - splitVal) * 0.75);

I am not sure that both children will not be empty. Maybe it is better to use the original algorithm with restricted upper and lower bounds.

-- 
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#r75088188
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160817/cae6d079/attachment.html>


More information about the mlpack-git mailing list