[mlpack] Student looking to contribute to mlpack

Ryan Curtin ryan at ratml.org
Mon Apr 13 13:55:09 EDT 2015


On Mon, Apr 13, 2015 at 10:58:42PM +0530, Rohit Shinde wrote:
> I am trying to implement a quadtree right now. What is the depth limit that
> I should use? Also, should each node be able to store one element only?

Hi Rohit,

Maybe IRC would be a better place for you to ask questions?  Mailing
list responses aren't generally instant.

In general, mlpack classes should be configurable and flexible.  So I
would suggest that your quadtree implementation should have a
user-configurable depth-limit (with a default) and a user-configurable
leaf size (i.e. how many elements can be stored in a node), also with a
default.

> > Why are all the files in the src/mlpack/core/trees folder .hpp files? Even
> > the implementation of all the methods is defined in the .hpp files? Why is
> > this so?

This is because we are using templates.  Here's a Stack Overflow
question that may provide some good further reading:

http://stackoverflow.com/questions/5180357/why-do-c-template-definitions-need-to-be-in-the-header

> >> Also, I was looking at octrees and quadtrees. They seem pretty simple. I
> >> checked in the src/mlpack/core/tree folder and I could not find their
> >> implementation (or at least a file with the name "octree" or "quadtree") so
> >> I assume they're not implemented. Is it okay if I implement them? They are
> >> pretty easy to understand and implementation should not be too difficult.
> >>
> >> Once I get this task done, I would approach metric trees. Is that okay?

Of course, this is fine.  It's open source, so you are welcome to do
what you like.  The code will have to be rigorously tested and adhere to
mlpack's coding guidelines (found on the Github wiki) before we accept
it into the master branch.

Note that the quadtree and octree are basically the same thing, but in 2
or 3 dimensions.  It is probably worth writing a tree general enough to
support any dimensions.  (Although, in reality, generalized octrees for
dimensions higher than 3 probably aren't likely to perform all that
well; even so, it would be useful to include them.)

-- 
Ryan Curtin    | "Avoid the planet Earth at all costs."
ryan at ratml.org |   - The President


More information about the mlpack mailing list