本文整理汇总了C++中LabelledClassificationData::sortClassLabels方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelledClassificationData::sortClassLabels方法的具体用法?C++ LabelledClassificationData::sortClassLabels怎么用?C++ LabelledClassificationData::sortClassLabels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabelledClassificationData
的用法示例。
在下文中一共展示了LabelledClassificationData::sortClassLabels方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTrainingFoldData
LabelledClassificationData LabelledClassificationData::getTrainingFoldData(UINT foldIndex){
LabelledClassificationData trainingData;
trainingData.setNumDimensions( numDimensions );
trainingData.setAllowNullGestureClass( allowNullGestureClass );
if( !crossValidationSetup ){
errorLog << "getTrainingFoldData(UINT foldIndex) - Cross Validation has not been setup! You need to call the spiltDataIntoKFolds(UINT K,bool useStratifiedSampling) function first before calling this function!" << endl;
return trainingData;
}
if( foldIndex >= kFoldValue ) return trainingData;
//Add the data to the training set, this will consist of all the data that is NOT in the foldIndex
UINT index = 0;
for(UINT k=0; k<kFoldValue; k++){
if( k != foldIndex ){
for(UINT i=0; i<crossValidationIndexs[k].size(); i++){
index = crossValidationIndexs[k][i];
trainingData.addSample( data[ index ].getClassLabel(), data[ index ].getSample() );
}
}
}
trainingData.sortClassLabels();
return trainingData;
}
示例2: getBootstrappedDataset
LabelledClassificationData LabelledClassificationData::getBootstrappedDataset(UINT numSamples) const{
Random rand;
LabelledClassificationData newDataset;
newDataset.setNumDimensions( getNumDimensions() );
newDataset.setAllowNullGestureClass( allowNullGestureClass );
if( numSamples == 0 ) numSamples = totalNumSamples;
for(UINT i=0; i<numSamples; i++){
UINT randomIndex = rand.getRandomNumberInt(0, totalNumSamples);
newDataset.addSample(data[randomIndex].getClassLabel(), data[randomIndex].getSample());
}
newDataset.sortClassLabels();
return newDataset;
}
示例3: getTestFoldData
LabelledClassificationData LabelledClassificationData::getTestFoldData(UINT foldIndex){
LabelledClassificationData testData;
testData.setNumDimensions( numDimensions );
testData.setAllowNullGestureClass( allowNullGestureClass );
if( !crossValidationSetup ) return testData;
if( foldIndex >= kFoldValue ) return testData;
//Add the data to the training
UINT index = 0;
for(UINT i=0; i<crossValidationIndexs[ foldIndex ].size(); i++){
index = crossValidationIndexs[ foldIndex ][i];
testData.addSample( data[ index ].getClassLabel(), data[ index ].getSample() );
}
testData.sortClassLabels();
return testData;
}