예제 #1
0
//实际值-预测值-置信度
void CEvaluate::CalcChart(CDoubleMatrix &m, CPtrArray *pArr)
{
	int nValue = 0;
	int i=0, j=0, nSize=0, nRow=0;
	double fSum = 0;
	CDoubleVector v;
	
	m_fValCnt = 0;
	bool bString = m_pDecTree->m_TargetField.cFieldType == fString ? true : false;
	//转化非Hit值的置信度
	nRow = m.mrow();
	if (bString)
	{
		for (i=0; i<nRow; i++)
		{
		}
	}
	else
	{
		for (i=0; i<nRow; i++)
		{
			nValue = m(1)(i);//预测值
			if (In(nValue)) continue;
			m(2)(i) = 1-m(2)(i); //置信度
		}
	}
	//计算Value
	for (i=0; i<nRow; i++)
	{
		CalcConfidence(m(0)(i),m(2)(i),pArr);
	}
	//换算
	double fSX = 0, fSY=0;
	nSize = pArr->GetSize();
	for (i=nSize-1; i>=0; i--)
	{
		CEv *pEv = (CEv *)pArr->GetAt(i);
		fSX += pEv->fX;
		fSY += pEv->fY;
		pEv->fX = fSX;
		pEv->fY = fSY;
		pEv->fX /= nRow;             //转换为百分位数
		pEv->fY /= m_fValCnt;        //转换为Gain值
	}
}
예제 #2
0
double PathRecord::CalcConfidence() const
{
	double	w, v;
	GetPrediction( w, v );
	return CalcConfidence(w, v);
}