[mlpack-git] [mlpack/mlpack] DatasetMapper & Imputer (#694)

Ryan Curtin notifications at github.com
Fri Jul 8 16:21:31 EDT 2016


> +  {
> +    // Nothing to initialize here.
> +  }
> +
> +
> +  template <typename MapType>
> +  mapped_type MapString(const std::string& string,
> +                        const size_t dimension,
> +                        MapType maps,
> +                        std::vector<Datatype>& types)
> +  {
> +    // If this condition is true, either we have no mapping for the given string
> +    // or we have no mappings for the given dimension at all.  In either case,
> +    // we create a mapping.
> +    const double NaN = std::numeric_limits<double>::quiet_NaN();
> +    if (missingSet.count(string) != 0 &&

I see what you mean.  My thinking was, everything in `missingSet` is something we might expect to be in `maps` by the end of loading.  So you can save a little bit of time by just putting everything in `missingSet` into `maps` pre-emptively.  The code as it is written here only adds things into `maps` from `missingSet` when it is seen, but I am not sure it is important to have a different, standalone `missingSet`.  What do you think?

---
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/694/files/a8818316a04506530e2269a2e0a32ba2f6a1c83b#r70135106
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160708/c8f8b979/attachment.html>


More information about the mlpack-git mailing list