rcurtin commented on this pull request.


> +      rdata(j, i) = dist(generator);
+
+  // fit results with only data
+  GammaDistribution gDist;
+  gDist.Train(rdata);
+
+  // fit results with data and each probability as 1
+  GammaDistribution gDist2;
+  arma::vec allProbabilities1(N, arma::fill::ones);
+  gDist2.Train(rdata, allProbabilities1);
+
+  BOOST_REQUIRE_EQUAL(gDist2.Alpha(0), gDist.Alpha(0));
+  BOOST_REQUIRE_EQUAL(gDist2.Beta(0), gDist.Beta(0));
+
+  BOOST_REQUIRE_EQUAL(gDist2.Alpha(1), gDist.Alpha(1));
+  BOOST_REQUIRE_EQUAL(gDist2.Beta(1), gDist.Beta(1));

We should make this `BOOST_REQUIRE_CLOSE()` with a tolerance of `1e-5` or so, 
because floating-point errors in some implementations could provide slightly 
different results.  It looks like your current implementation appears to 
produce the exact same result, but that may not be true in the future if the 
code is modified (but still valid), so we should be careful to try and make our 
test future-proof.

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/834#pullrequestreview-14337810
_______________________________________________
mlpack mailing list
[email protected]
http://knife.lugatgt.org/cgi-bin/mailman/listinfo/mlpack

Reply via email to