コード例 #1
0
ファイル: Classifier.cpp プロジェクト: GaoXiaojian/grt
Classifier* Classifier::deepCopy() const{
    
    Classifier *newInstance = createInstanceFromString( classifierType );
    
    if( newInstance == NULL ) return NULL;
    
    if( !newInstance->deepCopyFrom( this ) ){
        delete newInstance;
        return NULL;
    }
    return newInstance;
}
コード例 #2
0
ファイル: BAG.cpp プロジェクト: eboix/Myo-Gesture
bool BAG::addClassifierToEnsemble(const Classifier &classifier,double weight){
    
    trained = false;
    
    Classifier *newClassifier = classifier.createNewInstance();

    if( newClassifier == NULL ){
        return false;
    }
    
    if( !newClassifier->deepCopyFrom( &classifier ) ){
        return false;
    }

    weights.push_back( weight );
    ensemble.push_back( newClassifier );
    
    return false;
}