[mlpack] #251

Abhinav Pathak abhi.pat93 at gmail.com
Sat Jan 18 23:09:13 EST 2014


Hey,
Thanks for clarifying that.
If suppose i make a change in the binary_space_tree.hpp located at
mlpack-1.0.7/src/mlpack/core/tree/binary_space_tree,
how should i replace this file to that present in the builld/include
folder? And doing that is necessary right, because all the tests are run on
the files present inside the build folder, right?
And when i try replacing it with the file in build, it says i dont have
permissions to do that?
Can you specify what is the exact procedure to follow after i have made a
change in the file located in the src folder?

Regards,
Abhinav


On Sat, Jan 18, 2014 at 4:19 PM, Marcus Edel <marcus.edel at fu-berlin.de>wrote:

> 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/20140119/678a4dfa/attachment.html>


More information about the mlpack mailing list