"pvalue: " + info.pvalue + "\n" +
"number of recognized words: " + info.numberOfRecognizedWords(background, pwmLength) + "\n------------\n");
}
static void run_mono_and_di(PWM mono_pwm, BackgroundModel mono_background, Discretizer discretizer, Integer max_hash_size, double threshold) {
DiPWM di_pwm = DiPWM.fromPWM(mono_pwm);
DiBackgroundModel di_background = DiBackground.fromMonoBackground(mono_background);
FindPvalueAPE calculator = new FindPvalueAPE<PWM, BackgroundModel>(mono_pwm,
mono_background,
discretizer, max_hash_size);
FindPvalueAPE dicalculator = new FindPvalueAPE<DiPWM, DiBackgroundModel>(di_pwm,
di_background,
discretizer, max_hash_size);
// Single threshold
try {
System.out.println( "================");
CanFindPvalue.PvalueInfo info = calculator.pvalueByThreshold(threshold);
print_result(info, mono_background, mono_pwm.length());
CanFindPvalue.PvalueInfo di_info = dicalculator.pvalueByThreshold(threshold);
print_result(di_info, di_background, di_pwm.length());
System.out.println( "================");
} catch (HashOverflowException e) {
e.printStackTrace();
}
}