[mlpack-git] [mlpack/mlpack] Modeling LSH For Performance Tuning (#749)

Ryan Curtin notifications at github.com
Sat Aug 13 12:01:54 EDT 2016


> +template <typename SortPolicy, typename ObjectiveFunction>
> +void LSHModel<SortPolicy, ObjectiveFunction>::Train(
> +    const arma::mat &referenceSet,
> +    const double sampleRate,
> +    const size_t k)
> +{
> +  // Sanity check - sample rate must be in (0, 1].
> +  if (sampleRate > 1 || sampleRate <= 0)
> +    Log::Fatal << "Sampling rate must be floating point number in (0, 1]"
> +        << std::endl;
> +
> +  // Update the object's max K value information.
> +  maxKValue = k;
> +
> +  // Save pointer to training set.
> +  this->referenceSet = &referenceSet;

Don't forget to update `ownsSet` here, and possibly delete the old reference set first.

-- 
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/749/files/cdcb575826bfb3bd0ef4cafacf465435b3d6d144#r74688619
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160813/3d7d8f8b/attachment.html>


More information about the mlpack-git mailing list