lib/apparatus/classifier/randomforest_classifier.js
function predictOneDT(inst) { 
    
    var n=0;
    for(var i=0;i<this.maxDepth;i++) {
        var dir= this.testFun(inst, this.models[n]);
        if(dir === 1) n= n*2+1; // descend left
        else n= n*2+2; // descend right
    }
    
    return (this.leafPositives[n] + 0.5) / (this.leafNegatives[n] + 1.0); // bayesian smoothing!
}
function predictOneDT(inst) { 
    
    var n=0;
    for(var i=0;i<this.maxDepth;i++) {
        var dir= this.testFun(inst, this.models[n]);
        if(dir === 1) n= n*2+1; // descend left
        else n= n*2+2; // descend right
    }
    
    return (this.leafPositives[n] + 0.5) / (this.leafNegatives[n] + 1.0); // bayesian smoothing!
}
function predictOneDT ( inst ) { var n = 0 ; for ( var i = 0 ; i < this . maxDepth ; i ++ ) { var dir = this . testFun ( inst , this . models [ n ] ) ; if ( dir === 1 ) n = n * 2 + 1 ; // descend left else n = n * 2 + 2 ; // descend right } return ( this . leafPositives [ n ] + 0.5 ) / ( this . leafNegatives [ n ] + 1.0 ) ; // bayesian smoothing! }
returns probability that example inst is 1.
returns probability that example inst is 1 .