def assemble_results(input_averages, input_variances, baseline_error, errortype, ntree):
 results = ['Model   Random Forests', ('Error type    %s' % errortype)]
 ave_error = float(mean(input_averages))
 if (errortype in ['cv5', 'cv10']):
  ave_stdev = pooled_standard_deviation(input_variances)
  est_error = ('%s +/- %s' % (ave_error, ave_stdev))
  est_error_line = ' DCTB '.join(['Estimated Error (mean +/- s.d)', est_error])
 elif (errortype in ['oob', 'loo']):
  est_error_line = ' DCTB '.join(['Estimated Error (mean)', str(ave_error)])
 results.append(est_error_line)
 results.append(' DCTB '.join(['Baseline Error (for random guessing', str(baseline_error)]))
 ratio = calc_baseline_error_to_observed_error(baseline_error, ave_error)
 results.append(' DCTB '.join(['Ratio baseline error to observed error', str(ratio)]))
 results.append(' DCTB '.join(['Number of trees', str(ntree)]))
 return results

def assemble_results ( input_averages , input_variances , baseline_error , errortype , ntree ) : results = [ 'Model   Random Forests' , ( 'Error type    %s' % errortype ) ] ave_error = float ( mean ( input_averages ) ) if ( errortype in [ 'cv5' , 'cv10' ] ) : ave_stdev = pooled_standard_deviation ( input_variances ) est_error = ( '%s +/- %s' % ( ave_error , ave_stdev ) ) est_error_line = ' DCTB ' . join ( [ 'Estimated Error (mean +/- s.d)' , est_error ] ) elif ( errortype in [ 'oob' , 'loo' ] ) : est_error_line = ' DCTB ' . join ( [ 'Estimated Error (mean)' , str ( ave_error ) ] ) results . append ( est_error_line ) results . append ( ' DCTB ' . join ( [ 'Baseline Error (for random guessing' , str ( baseline_error ) ] ) ) ratio = calc_baseline_error_to_observed_error ( baseline_error , ave_error ) results . append ( ' DCTB ' . join ( [ 'Ratio baseline error to observed error' , str ( ratio ) ] ) ) results . append ( ' DCTB ' . join ( [ 'Number of trees' , str ( ntree ) ] ) ) return results
the summary format below is done on the r backend .