[mlpack] #251

Marcus Edel marcus.edel at fu-berlin.de
Sat Jan 18 05:49:08 EST 2014


Hello Abhinav,

The tests in mlpack are written with the Boost Unit Test Framework. You can run all the tests with 'bin/mlpack_test’ and a specific test suite with 'bin/mlpack_test -t TestSuite' or a specific test case with 'bin/mlpack_test -t TestSuite/TestCase'. For instance you can run the complete tree test suite with 'bin/mlpack_test -t TreeTest' (BOOST_AUTO_TEST_SUITE(TestSuite)) and a single tree test case with 'bin/mlpack_test -t TreeTest/HRectBoundEmptyConstructor' (BOOST_AUTO_TEST_CASE(TestCase)). If you make a new test you have to build the test with 'make mlpack_test' before you can run the test.

Regards,
Marcus

On 18 Jan 2014, at 07:00, Abhinav Pathak <abhi.pat93 at gmail.com> wrote:

> Is this how we do it?
> ./bin/mlpack_test
> from the terminal ?
> Please clarify the exact procedure :)
> 
> Regards,
> Abhinav
> 
> 
> On Sat, Jan 18, 2014 at 11:23 AM, Abhinav Pathak <abhi.pat93 at gmail.com> wrote:
> Yeah this was pretty helpful :)
> Just one more thing, this maybe little naive but i'm actually not clear that how do we run mlpack_test ?
> i'm not able to run it when i try running it like other files in build/bin. I didnt get any direct documentation also for it.
> Can you clarify how exactly do we run mlpack_test?
> 
> Regards,
> Abhinav
> 
> 
> On Sat, Jan 18, 2014 at 1:35 AM, Ryan Curtin <gth671b at mail.gatech.edu> wrote:
> On Fri, Jan 17, 2014 at 12:07:13PM +0530, Abhinav Pathak wrote:
> > Hey,
> > sorry for the delay, now i would be continuing with the work.
> 
> No worries, there's no hurry.
> 
> > So basically i'm going to shift the split node function from the
> > BinarySpaceTree class and put it in a new function. I wanted to ask that
> > should i create a new class which would for now split the data as it is
> > doing now and later we can add more methods for splitting the data in this
> > new class.
> > But can i let the splitnode be there in BinarySpaceTree class and inside it
> > remove the splitting code and rather instantiate the object of the new
> > class and use the splitting method? Is it the correct approach for it?
> 
> So the approach here is policy-based design [1].  The idea is that we
> give the user flexibility by allowing them to define their own policy
> for how the splitting occurs.  So the BinarySpaceTree template signature
> will look like this...
> 
> template<
>     typename BoundType,
>     typename MetricType,
>     typename StatisticType,
>     typename SplitType
> >
> class BinarySpaceTree;
> 
> And then the user can choose whatever class they want for SplitType
> presuming it has a function
> 
>   void SplitNode(...).
> 
> Then, in the BinarySpaceTree code, instead of calling
> BinarySpaceTree::SplitNode(), call SplitType::SplitNode().  Each
> SplitType class should not need to know anything about the tree itself,
> just that it needs to split the points it is given into a left and right
> set according to some heuristic in a particular dimension.
> 
> Right now the BinarySpaceTree::SplitNode() function implements mean
> split, which means that in whichever dimension it is splitting the
> points on, it finds the mean, then anything above the mean goes to the
> right and otherwise it goes to the left.  So you could move that into a
> MeanSplit class.
> 
> If you wanted, you could also make a MedianSplit class, which a user
> could plug in.
> 
> The last thing: tests.
> 
> Once you've refactored BinarySpaceTree, ensure that it still compiles
> and that when you run mlpack_test, there are no new failures.  If you
> decide to make a MedianSplit class, you should write tests for that too.
> 
> Let me know if I can further clarify anything.
> 
> Thanks,
> 
> Ryan
> 
> --
> Ryan Curtin    | "Aw, Brian's doing it again, dude.  Brian, you ain't
> ryan at ratml.org | no pimp, dude."   "Where's my money?"
> 
> 
> _______________________________________________
> mlpack mailing list
> mlpack at cc.gatech.edu
> https://mailman.cc.gatech.edu/mailman/listinfo/mlpack

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20140118/3c779762/attachment.html>


More information about the mlpack mailing list