|
@@ -82,9 +82,9 @@ void KCGPApproxOneClass::teach (const LabeledSetVector &teachSet)
|
|
|
|
|
|
//now sum up all entries of each row in the original kernel matrix
|
|
|
double kernelScore(0.0);
|
|
|
- for (int i = 0; i < this->vecSetLabels.size(); i++)
|
|
|
+ for (int i = 0; i < (int)this->vecSetLabels.size(); i++)
|
|
|
{
|
|
|
- for (int j = i; j < this->vecSetLabels.size(); j++)
|
|
|
+ for (int j = i; j < (int)this->vecSetLabels.size(); j++)
|
|
|
{
|
|
|
kernelScore = this->kernelFunction->K(vecSet[i],vecSet[j]);
|
|
|
this->matrixDInv[i] += kernelScore;
|
|
@@ -94,7 +94,7 @@ void KCGPApproxOneClass::teach (const LabeledSetVector &teachSet)
|
|
|
}
|
|
|
|
|
|
//compute its inverse
|
|
|
- for (int i = 0; i < this->vecSetLabels.size(); i++)
|
|
|
+ for (int i = 0; i < (int)this->vecSetLabels.size(); i++)
|
|
|
{
|
|
|
this->matrixDInv[i] = 1.0 / this->matrixDInv[i];
|
|
|
}
|
|
@@ -103,7 +103,7 @@ void KCGPApproxOneClass::teach (const LabeledSetVector &teachSet)
|
|
|
if(this->mode==MEAN_DETECTION_MODE)
|
|
|
{
|
|
|
this->InvDY.resize ( this->vecSetLabels.size() );
|
|
|
- for (int i = 0; i < this->vecSetLabels.size(); i++)
|
|
|
+ for (int i = 0; i < (int)this->vecSetLabels.size(); i++)
|
|
|
{
|
|
|
this->InvDY[i] = this->vecSetLabels[i] * this->matrixDInv[i];
|
|
|
}
|
|
@@ -133,7 +133,7 @@ ClassificationResult KCGPApproxOneClass::classifyKernel ( const NICE::Vector & k
|
|
|
kernelVector.size() << " does not match number of training points " << this->vecSetLabels.size() );
|
|
|
|
|
|
NICE::Vector rightPart (this->vecSetLabels.size());
|
|
|
- for (int i = 0; i < this->vecSetLabels.size(); i++)
|
|
|
+ for (int i = 0; i < (int)this->vecSetLabels.size(); i++)
|
|
|
{
|
|
|
rightPart[i] = kernelVector[i] * this->matrixDInv[i];
|
|
|
}
|
|
@@ -170,4 +170,4 @@ void KCGPApproxOneClass::restore(std::istream& ifs, int type)
|
|
|
|
|
|
void KCGPApproxOneClass::clear()
|
|
|
{
|
|
|
-}
|
|
|
+}
|