hi
i want to classify a instance of a dataset,the class of my instances is categorical,how can with predict return a categorical?
but my program do not work true
please help me
GMatrix* pData= GMatrix::loadArff("/home/t3/yousefian/dataset/darpa99/Extract-features/W4-2.arff"); // load some data //Holder hm(pM); // make sure it will be cleaned up later Holder<GMatrix> hData(pData); cout<<"pdata"<<"RowSize: "<<pData->rows()<<"ColSize: "<<pData->cols()<<endl;//return: pdataRowSize: 19158 ColSize: 20 GMatrix* pFeatures = pData->cloneSub(0, 0, pData->rows(), pData->cols() - 1); cout<<"pFeatures"<<"RowSize: "<<pFeatures->rows()<<"ColSize: "<<pFeatures->cols()<<endl;//return: pFeaturesRowSize: 19158 ColSize: 19 Holder<GMatrix> hFeatures(pFeatures); GMatrix* pLabels = pData->cloneSub(0, pData->cols() - 1, pData->rows(), 1); cout<<"pLables"<<"RowSize: "<<pLabels->rows()<<"ColSize: "<<pLabels->cols()<<endl;//return: pLablesRowSize: 19158 ColSize: 1 Holder<GMatrix> hLabels(pLabels); GRand rand(0); GKNN modell(rand); modell.setNeighborCount(3); modell.train(*pFeatures, *pLabels); double pOut[1]; modell.predict(pFeatures->row(37), pOut);
thanks
Anonymous
You seem to have CSS turned off. Please don't fill out this field.
Your code looks right to me. Can you describe how your actual results differ from your expected results?
thanks for you attention
how can return lable of row(37)??
cout<< pOut dont worked!!
hi
i want to classify a instance of a dataset,the class of my instances is
categorical,how can with predict return a categorical?
but my program do not work true
please help me
thanks
Your code looks right to me. Can you describe how your actual results differ
from your expected results?
thanks for you attention
how can return lable of row(37)??
cout<< pOut dont worked!!