public double getAnomalyScore ( Instance inst ) { if ( this . referenceWindow ) return 0.5 ; else { double accumulatedScore = 0.0 ; int massLimit = ( int ) ( Math . ceil ( this . sizeLimit * this . windowSize ) ) ; double maxScore = this . windowSize * Math . pow ( 2.0 , this . maxDepth ) ; for ( int i = 0 ; i < this . numTrees ; i ++ ) { accumulatedScore += ( forest [ i ] . score ( inst , massLimit ) / maxScore ) ; } accumulatedScore = accumulatedScore / ( ( ( double ) this . numTrees ) ) ; return 0.5 - accumulatedScore + this . anomalyThreshold ; } }
Returns the anomaly score for the argument instance .