Hello Fernando,
You can find below the code I use without database access. I compiled it
using
g++ -std=c++11 sample.cpp -o sample -lshogun
I get the same error as I mentioned.
Thanks for your interest.
Greetings,
Jose
#include
#include
#include
#include
#include
using namespace shogun;
int main(int argc, char **argv)
{
int iFolders=10;
int i,k;
int iRows=100;
SGMatrix *psFeatures=new SGMatrix[iFolders];
SGVector *psLabels=new SGVector[iFolders];
CDenseFeatures *features=new
CDenseFeatures[iFolders];
CMulticlassLabels *labels=new CMulticlassLabels[iFolders];
double **ppdFeatures= new double*[iFolders];
double **ppdLabels= new double*[iFolders];
CGaussianNaiveBayes *gnb=new CGaussianNaiveBayes[iFolders];
double dAc=0;
for (i=0; i<iFolders; i++)
{
ppdFeatures[i]=(double *)calloc(3*iRows, sizeof(double));
ppdLabels[i]=(double *)calloc(iRows, sizeof(double));
psFeatures[i]=SGMatrix(ppdFeatures[i], iRows, 3);
psLabels[i]=SGVector(ppdLabels[i], iRows);
features[i]=CDenseFeatures(psFeatures[i]);
labels[i]=CMulticlassLabels(psLabels[i]);
gnb[i] = CGaussianNaiveBayes(features+i, labels+i);
gnb[i].train();
}
CMulticlassAccuracy eval = CMulticlassAccuracy();
for (i=0, k=0; i<iFolders;i++)
{
for (int j=0; j<iFolders; j++)
{
if (i!=j)
{
auto labels_predict = gnb[j].apply_multiclass(features+i);
dAc += eval.evaluate(labels_predict, labels+i);
k++;
}
}
}
}
On 03/27/2017 10:03 AM, Fernando J. Iglesias GarcĂa wrote:
Hello Jose,
Could you isolate the error in a minimal example and share the code?
Thank you!
Cheers,
Fernando.
On 27 March 2017 at 07:20, Jose Gomez <jose.gomez.lo...@gmail.com
<mailto:jose.gomez.lo...@gmail.com>> wrote:
Hi all,
I made a test C++ program using a mysql database.
The compilation line I use:
g++ -std=c++11 database.cpp whole_dataset.cpp -o whole_dataset
-lshogun -lmysqlclient
I get
/tmp/ccCFhRAD.o: In function
`shogun::CSGObject::operator=(shogun::CSGObject const&)':
whole_dataset.cpp:(.text._ZN6shogun9CSGObjectaSERKS0_[_ZN6shogun9CSGObjectaSERKS0_]+0x27):
undefined reference to
`shogun::Unique::operator=(shogun::Unique
const&)'
collect2: error: ld returned 1 exit status
I'm using libshogun17 and libshogun-dev stable packages from the
stable ppa repository in ubuntu 14.04
Am I missing some extra dependencies?
Thanks in advance for your help.
Greetings
Jose Gomez