[mlpack-git] [mlpack/mlpack] Random projection trees (#726)
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:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mlpack-git