[mlpack-git] [mlpack/mlpack] DatasetMapper & Imputer (#694)
Tham
notifications at github.com
Sun Jul 17 00:00:09 EDT 2016
> + // MissingPolicy should convert strings to nans
> + BOOST_REQUIRE(std::isnan(input(0, 0)) == true);
> + BOOST_REQUIRE_CLOSE(input(0, 1), 5.0, 1e-5);
> + BOOST_REQUIRE_CLOSE(input(0, 2), 8.0, 1e-5);
> + BOOST_REQUIRE_CLOSE(input(1, 0), 2.0, 1e-5);
> + BOOST_REQUIRE_CLOSE(input(1, 1), 6.0, 1e-5);
> + BOOST_REQUIRE_CLOSE(input(1, 2), 9.0, 1e-5);
> + BOOST_REQUIRE_CLOSE(input(2, 0), 3.0, 1e-5);
> + BOOST_REQUIRE(std::isnan(input(2, 1)) == true);
> + BOOST_REQUIRE_CLOSE(input(2, 2), 10.0, 1e-5);
> +
> + CustomImputation<double> customStrategy(99); // convert missing vals to 99.
> + Imputer<double,
> + DatasetMapper<MissingPolicy>,
> + CustomImputation<double>> imputer(info, customStrategy);
> + imputer.Impute(input, output, "a", 0); // convert a -> 99 for dimension 0
I think the comments should be
`// convert a or nan to 99 for dimension 0`
---
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/e5d591e511ae449eae1523a80346357b93b968d1#r71076094
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160716/cf1bac2e/attachment.html>
More information about the mlpack-git
mailing list