Commit 05ffaa4d authored by Jussi Lindgren's avatar Jussi Lindgren
Browse files

Plugins: Fixes for 0,...,k-1 indexing to classifiers

parent ceffcf0e
......@@ -194,7 +194,7 @@ boolean CAlgorithmClassifierLDA::train(const IFeatureVectorSet& rFeatureVectorSe
{
if(l_vClassCounts[l_ui32classIdx]>0)
{
const float64 l_f64Label = m_vLabelList[l_ui32classIdx];
// const float64 l_f64Label = m_vLabelList[l_ui32classIdx];
const uint32 l_ui32nExamplesInClass = l_vClassCounts[l_ui32classIdx];
// Copy all the data of the class to a matrix
......
......@@ -158,7 +158,7 @@ boolean CAlgorithmClassifierMLP::train(const IFeatureVectorSet &rFeatureVectorSe
{
VectorXd l_oTarget = VectorXd::Zero(l_ui32ClassCount);
//class 1 is at index 0
l_oTarget[static_cast<uint32>(m_oLabelList[i]) -1 ] = 1.;
l_oTarget[static_cast<uint32>(m_oLabelList[i]) ] = 1.;
l_oTargetList[m_oLabelList[i]] = l_oTarget;
}
......
......@@ -365,6 +365,7 @@ boolean CAlgorithmClassifierSVM::classify(const IFeatureVector& rFeatureVector,
}
rf64Class=svm_predict_probability(m_pModel,l_pX,l_pProbEstimates);
//std::cout<<rf64Class<<std::endl;
//std::cout<<"probability"<<std::endl;
......@@ -377,7 +378,7 @@ boolean CAlgorithmClassifierSVM::classify(const IFeatureVector& rFeatureVector,
for(int i=0;i<m_pModel->nr_class;i++)
{
this->getLogManager() << LogLevel_Trace << "index:"<<i<<" label:"<< m_pModel->label[i]<<" probability:"<<l_pProbEstimates[i]<<"\n";
rProbabilityValue[ (m_pModel->label[i])-1 ]=l_pProbEstimates[i];
rProbabilityValue[ (m_pModel->label[i]) ]=l_pProbEstimates[i];
}
}
else
......
......@@ -72,7 +72,7 @@ boolean CAlgorithmPairwiseDecisionVoting::compute(std::vector< SClassificationIn
for(uint32 i =0 ; i < pClassificationValueList.size() ; ++i)
{
SClassificationInfo & l_rTemp = pClassificationValueList[i];
if(l_rTemp.m_f64ClassLabel == 1)
if(l_rTemp.m_f64ClassLabel == 0)
{
++(l_pWinCount[(uint32)(l_rTemp.m_f64FirstClass)]);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment