[mlpack-git] [mlpack] Mean shift clustering (#388)

Ryan Curtin notifications at github.com
Mon Jan 26 21:51:32 EST 2015


> +  BOOST_REQUIRE_NE(firstClass, secondClass);
> +  
> +  for (size_t i = 13; i < 20; i++)
> +    BOOST_REQUIRE_EQUAL(assignments(i), secondClass);
> +  
> +  size_t thirdClass = assignments(20);
> +  
> +  // To ensure that this is the third class which we haven't seen yet.
> +  BOOST_REQUIRE_NE(firstClass, thirdClass);
> +  BOOST_REQUIRE_NE(secondClass, thirdClass);
> +  
> +  for (size_t i = 20; i < 30; i++)
> +    BOOST_REQUIRE_EQUAL(assignments(i), thirdClass);
> +  
> +}
> +

Once we merge this I will probably add at least one more test where I generate observations from a mixture of Gaussians (that are sufficiently far apart) and ensure that the mean shift algorithm will properly label each point.  You can do this now if you like, but I wanted to let you know that I'm planning to do that.  More tests, in general, is a good thing.  It may be worth adding some simple tests like "if I set the duplicate threshold to 0, do I get dataset.n_cols clusters?"; this is helpful to people who might be modifying the code later on and want to make sure it still functions the same way.

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/388/files#r23584112
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150126/f3a1d8ef/attachment-0001.html>


More information about the mlpack-git mailing list