当前位置: 首页>>代码示例>>C++>>正文


C++ LabelledClassificationData::addSample方法代码示例

本文整理汇总了C++中LabelledClassificationData::addSample方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelledClassificationData::addSample方法的具体用法?C++ LabelledClassificationData::addSample怎么用?C++ LabelledClassificationData::addSample使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LabelledClassificationData的用法示例。


在下文中一共展示了LabelledClassificationData::addSample方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:gaurav38,项目名称:HackDuke13,代码行数:29,代码来源:LabelledClassificationData.cpp

示例2: getClassData

LabelledClassificationData LabelledClassificationData::getClassData(UINT classLabel) const{
    
    LabelledClassificationData classData;
    classData.setNumDimensions( this->numDimensions );
    classData.setAllowNullGestureClass( allowNullGestureClass );

    for(UINT i=0; i<totalNumSamples; i++){
        if( data[i].getClassLabel() == classLabel ){
            classData.addSample(classLabel, data[i].getSample());
        }
    }

    return classData;
}
开发者ID:gaurav38,项目名称:HackDuke13,代码行数:14,代码来源:LabelledClassificationData.cpp

示例3: getBootstrappedDataset

LabelledClassificationData LabelledClassificationData::getBootstrappedDataset(UINT numSamples){
    
    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());
    }
    
    return newDataset;
}
开发者ID:MarkusKonk,项目名称:Geographic-Interaction,代码行数:16,代码来源:LabelledClassificationData.cpp

示例4: 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() );
	}

    return testData;
}
开发者ID:MarkusKonk,项目名称:Geographic-Interaction,代码行数:20,代码来源:LabelledClassificationData.cpp


注:本文中的LabelledClassificationData::addSample方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。