dateline   Tue Sep 13 19:44:24 2016
progname   c:\beagling\p3\berries.py
id         c:\beagling\parapath\cardiac.txt
testdat    C:\op\cardiac_dat2.dat
targval    plasvol

====holdout trial :

rank  safeness case  ID                            pred:true        cellsize    abdsiff    diffsqrd
   1      0.98   30  725                           478 + 547           77      69.0000    4761.0000
   2      0.94   13  592                           471 - 531           77      60.0000    3600.0000
   3      0.94    6  705                           491 - 656           77     165.0000   27225.0000
   4      0.93   27  691                           470 - 319           77     151.0000   22801.0000
   5      0.92    4  684                           494 - 668           77     174.0000   30276.0000
   6      0.91    1  630                           467 + 425           77      42.0000    1764.0000
   7      0.89   11  734                           499 + 483           77      16.0000     256.0000
   8      0.82    3  664                           448 + 433           77      15.0000     225.0000
   9      0.77   16  526                           524 - 653           77     129.0000   16641.0000
  10      0.76   33  529                        435.54 - 335           77     100.5400   10108.2854
  11      0.72   15  515                           423 - 747           77     324.0000  104976.0000
  12      0.71   34  588                           540 + 479           77      61.0000    3721.0000
  13      0.71   32  660                        420.54 - 262           77     158.5400   25134.9218
  14      0.70    8  742                           542 - 398           77     144.0000   20736.0000
  15      0.70    9  625                        418.54 - 324           77      94.5400    8937.8058
  16      0.65    2  639                           559 - 620           77      61.0000    3721.0000
  17      0.64   22  554                           398 + 459           77      61.0000    3721.0000
  18      0.63   14  598                        394.54 + 395           77       0.4600       0.2116
  19      0.62   12  426                        389.54 - 373           77      16.5400     273.5706
  20      0.59   29  733                           380 - 504           77     124.0000   15376.0000
  21      0.59   31  707                           583 + 780           77     197.0000   38809.0000
  22      0.59   26  704                        377.54 + 417           77      39.4600    1557.0940
  23      0.57   25  718                           372 - 407           77      35.0000    1225.0000
  24      0.57   10  672                        371.54 + 321           77      50.5400    2554.2885
  25      0.57    7  713                           591 - 463           77     128.0000   16384.0000
  26      0.56    5  687                           364 - 397           77      33.0000    1089.0000
  27      0.53   18  720                           611 + 712           77     101.0000   10201.0000
  28      0.53   17  657                           350 - 490           77     140.0000   19600.0000
  29      0.53   28  662                      348.9126 - 436           77      87.0874    7584.2225
  30      0.53   24  535                      348.9126 - 437           77      88.0874    7759.3974
  31      0.53   23  653                      348.9126 - 442           77      93.0874    8665.2718
  32      0.53   21  540                      348.9126 + 308           77      40.9126    1673.8374
  33      0.53    0  517                      348.9126 - 562           77     213.0874   45406.2579
  34      0.44   20  731                           668 + 585           77      83.0000    6889.0000
  35      0.42   35  543                           686 + 663           77      23.0000     529.0000
  36      0.21   19  723                          1038 + 1066          77      28.0000     784.0000
+----+++---+----++--++-+--+----+-+++

'success' percentage = 41.67
pearson correlation between predicted & true vals = 0.7342
spearman rank-correlation between predicted & true vals = 0.5503

mean abs.error = 92.969
mean error ^ 2 = 13193.4768
correlation between safeness & abs.error (negative better) = 0.1575

Resultant rule from all training cases :
##  Using RUNSTER Py template, version of 12/09/2016 :
##  rule written by pear.py ;
##  derived from training data : C:\op\cardiac_dat1.dat;
##  generated on creation date : Tue Sep 13 14:37:53 2016;
##  dumped on Tue Sep 13 19:33:22 2016.
##
beag_gold = 5.0 ** 0.5 * 0.5 + 0.5  ##  global

import  math  ##  math library called upon

##  helper functions :
def beag_bool (v):
	##  ensures same bool/math treatment as in Beagle :
	return  (v > 0) + 0

def beag_exor (v1,v2):
	##  exclusive or, as in Beagle :
	return  ((v1>0) != (v2>0))

def beag_root(v):
	##  safe square root :
	if v >= 0.0:
		return  math.sqrt(v)
	else:
		return  -math.sqrt(abs(v))

def beag_slog (v):
	##  safe natural logarithm :
	if v < 0:
		return -math.log1p(abs(v))
	else:
		return  math.log1p(v)

def runster_stabprep ():
	##  sets up fallout table :

	stab = {}
	stab['0'] = [1, 471, 146.05413640382775]

	##  unpacks stab lines.

	return (stab)
	##  stabprep ends.


def runster_regrule (vals,stab):
	##  input vals should be an object with appropriate attribute names.
	##  target : plasvol.
	##  rule mode is standard.

	bins = ['0','1']  ##  omit if demonic
	catlist = [207, 377.0, 471.0, 569.0, 867]
	priorvec = [77, 480.85714285714283, 146.05413640382775, 98]
	subrules = 1
	rule = [0] * 1
	##  compute rule values :
	rule[0] = max(min((3.0160556 * vals.yo),178),max(min((279.5399691 + vals.ci),(vals.ci + vals.circtime)),348.9125581))

	p = 0 ; b = []
	while (p < subrules):
		v = rule[p]  ##  omit if tabular
		b = ['0']  ##  omit if tabular
		p = p + 1  ##  early-r, late-py

	b = ''.join(b)  ##  should work in both modes
	##  standard :
	predval = v  ##  omit if tabular
	cellvals = priorvec  ##  omit if tabular
	cellsize = priorvec[0] ; standev = priorvec[2]  ##  omit if tabular
	smalldif = priorvec[3]  ## should work in both modes
	##  tabular :
	##  retrieve cell frequencies :

	return ([b,predval,standev,smalldif,cellsize])
##  regression rule ends.

##  should be loadable into berries.py .

##  ending.


Parameter settings :
casefold  1
catfrex   <class 'dict'> of 36 items.
catlist   <class 'list'> of 36 items.
cats      36
cols      20
cols2use  <class 'set'> of 19 items.
datamat   <class 'list'> of 36 items.
dateline  Tue Sep 13 19:44:24 2016
dumpfile  ~ ..\op\cardiac_pout.dat
foldcase  1
goodcols  <class 'set'> of 19 items.
goodlist  <class 'list'> of 19 items.
id        c:\beagling\parapath\cardiac.txt
idfield   ID
jobname   cardiac
listfile  ~ ..\op\cardiac_prop.txt
nres      36
outfile   ..\op\berries.txt
outpath   ..\op\
priorvec  [77, 480.85714285714283, 146.05413640382775, 98]
progfile  ~ ..\op\cardiac_prog.py
progname  c:\beagling\p3\berries.py
randseed  3433
rows      36
rulecats  [207, 377.0, 471.0, 569.0, 867]
rulemode  standard
skipvars  ID
strcols   [0]
tagdict   <class 'dict'> of 20 items.
taglist   <class 'list'> of 20 items.
targcol   15
targval   plasvol
targvals  <class 'list'> of 36 items.
testdat   C:\op\cardiac_dat2.dat
zonk      0

