[mlpack] unable to compile sample det program
Ryan Curtin
ryan at ratml.org
Mon Dec 5 20:45:14 EST 2016
On Tue, Dec 06, 2016 at 03:53:19AM +0530, Piyush Jaiswal wrote:
> Hello everyone,
> I am new to mlpack and was trying to compile a sample program regarding
> 'det' but I keep getting some errors.
> OS - Ubuntu 16.04
>
>
>
> *The program:*
>
>
>
>
>
>
>
> *#include <mlpack/methods/det/dtree.hpp>using namespace mlpack::det;// The
> dataset matrix, on which to learn the density estimation tree.extern
> arma::Mat<float> data;// Initialize the tree. This function also creates
> and saves the bounding box// of the data. Note that it does not actually
> build the tree.DTree<> det(data);*
>
>
>
>
> Error link - http://pastie.org/10977207
>
> Compile command: g++ Dtree_test.cpp -I/usr/include/libxml2/ -lxml2
> -L/usr/lib/ -larmadillo -L/usr/local/lib -lmlpack -std=c++11
>
> I tried removing and building mlpack again from source (as I though it
> might be an installation error), but the error message didn't change.
> Any kind of suggestion would be really helpful.
Hi there Piyush,
It seems that you're using an old version of mlpack, where DTree is not
templatized. The templatization of DTree happened after the release of
mlpack 2.1.0, so if you are using mlpack 2.1.0 then you should use the
class "DTree", and if git master, you can use "DTree<arma::Mat<float>>".
I hope this is helpful. Let me know if I can clarify anything.
Thanks,
Ryan
--
Ryan Curtin | "Do I sound like I'm ordering a pizza?"
ryan at ratml.org | - John McClane
More information about the mlpack
mailing list