public void setProb ( int cat , double prob ) { if ( cat > probabilities . length ) throw new IndexOutOfBoundsException ( "There are only " + probabilities . length + " posibilties, " + cat + " is invalid" ) ; else if ( prob < 0 || Double . isInfinite ( prob ) || Double . isNaN ( prob ) ) throw new ArithmeticException ( "Only zero and positive values are valid, not " + prob ) ; probabilities [ cat ] = prob ; }
Sets the probability that a sample belongs to a given category .