cd Data/thyroid ; enc hypo 
cd Data/thyroid ; encsmpl -vg S,20,13579 hypo ; echo 
SAMPLING:  20 without replacement from 3772 using seed 13579.
negative 19 F f f f f f f f f f f f f f f t 3.2 t 3.6 t 139 t 1.53 t 91 f ? other
negative 33 F f f f f f f f f f f f f f f f ? f ? f ? f ? f ? f ? other
negative 78 F f f f t f f f f f f f f f f t 4.1 t 1.9 t 116 t 1.05 t 110 f ? other
negative 77 F f f f f f f f f f f f f f f t 0.27 f ? f ? f ? f ? f ? other
negative 58 M t f f f f f f f f f f f f f t 1.2 t 1.7 t 123 t 0.96 t 129 f ? other
negative 73 F t f f f f f f f f f f f f f t 3.1 t 1.5 t 120 t 0.94 t 127 f ? SVI
negative 67 F t f f f f f f t f f f f f f t 2 t 2.5 t 133 t 1.19 t 112 f ? other
negative 32 M f f f f f f f f f f f f f f t 1 t 2.9 t 152 t 1.17 t 130 f ? SVHC
negative 70 F f f f f f f f f f f f f f f t 1.5 t 0.3 t 79 t 0.8 t 98 f ? SVI
negative 30 F f f f f f f f f f f f f f f f ? f ? t 90 t 0.92 t 98 f ? other
negative 55 F f f f f f f f f f f f f f f t 0.28 t 2.1 t 116 t 1.14 t 102 f ? other
negative 34 M f f f f f f f f f f f f f f t 1.7 t 2.4 t 94 t 1.17 t 81 f ? other
negative 72 F f f f f f f f t f f f f f f t 1.1 f ? t 131 t 0.5 t 265 f ? other
negative 64 F f f f f f f f f f f f f f f f ? f ? f ? f ? f ? f ? other
negative 39 F f f f f f t f f t f f f f f t 4 t 1.7 t 63 f ? f ? f ? other
negative 50 F f f f f f f f t f f f f f f t 3.3 t 2.1 t 107 t 1.07 t 100 f ? other
negative 63 F f f f f f f f t f f f f f f t 2.6 t 1.3 t 128 t 1.07 t 120 f ? SVI
negative 80 F f f f f f f f f f f f t f f t 0.005 t 2.7 t 101 t 0.84 t 121 f ? other
negative 31 M f f f f f f f f f f f f f t t 1.2 t 2.7 t 99 t 0.88 t 113 f ? SVHC
negative 29 F f f f f f f f f f f f f f f t 0.84 t 1.5 t 100 t 0.74 t 135 f ? other

cd Data/thyroid ; encsmpl S,400,13579 hypo ; echo 

cd Data/thyroid ; \
mktree -o "-tB2,2 -A1 -Pmml -d6" -p -b -c -slvgt hypo ; echo 
Percentage accuracy for tree 1 = 99.4958 +/- 0.121966
Mean square error for tree 1 = 0.0114824
Expected accuracy for tree 1 = 98.5094
Typical std. dev. of expected accuracy for an example = 4.17361
Neg. Log Posterior for tree 1 = 50.3332 (nits)
Neg. Log Posterior for examples = 154.272 (nits)
Leaf count for tree 1 = 9, expected = 7.011234
Misclassification matrix for tree 1:
 (row = predicted, col = actual, in .attr file order)
  0.048932  0.000593  0.002372  0.000000 | 0.051898
  0.000000  0.922894  0.000000  0.000593 | 0.923488
  0.000000  0.001483  0.023132  0.000000 | 0.024614
  0.000000  0.000000  0.000000  0.000000 | 0.000000
--------------------------------------------------
  0.048932  0.924970  0.025504  0.000593 | 1.00000

cd Data/thyroid ; tprint -ipq hypo ; echo
 0.07294 0.9034 0.02307 0.0006234 (L0)
TSH < 6.05:  0.0007407 0.9978 0.0007407 0.0007407 (L1)
TSH >= 6.05:  0.4535 0.3992 0.1434 0.003876 (L1.72047e-14)
|   TSH_measured = f:  0.01515 0.9545 0.01515 0.01515 (L1)
|   TSH_measured = t:  0.5969 0.2092 0.1888 0.005102 (L1.78036e-08)
|   |   FTI < 63.5:  0.1667 0.02381 0.7857 0.02381 (L0.568568)
|   |   |   FTI_measured = f:  0.5 0.07143 0.3571 0.07143 (L0.33163)
|   |   |   |   TSH < 17.5:  0.3304 0.04721 0.5752 0.04721 (L0.0998022)
|   |   |   |   TSH >= 17.5:  0.2731 0.0497 0.6275 0.0497 (L0.0998022)
|   |   |   FTI_measured = t:  0.1082 0.02702 0.8377 0.02702 (L0.431432)
|   |   FTI >= 63.5:  0.7025 0.2595 0.03165 0.006329 (L4.08224e-05)
|   |   |   on_thyroxine = f:  0.8538 0.1 0.03846 0.007692 (L0.180828)
|   |   |   |   thyroid_surgery = f:  0.881 0.07143 0.03968 0.007937 (L0.158225)
|   |   |   |   |   TT4 < 151:  0.9208 0.03504 0.03583 0.008296 (L0.660907)
|   |   |   |   |   TT4 >= 151:  0.3447 0.4869 0.1149 0.05349 (L0.660907)
|   |   |   |   thyroid_surgery = t:  0.2568 0.5301 0.1093 0.1038 (L0.819132)
|   |   |   on_thyroxine = t:  0.03128 0.9062 0.03125 0.03125 (L0.99996)

cd Data/thyroid ; \
tchar hypo.attr hypo.tree hypo.chtr ; cat hypo.chtr ; echo 
SIZE: 17 9 3 -50.3332 -154.272 1
PRIOR: 1 0 0 0 2 6 0
11,  0.0729426+0.903367+0.0230673+0.000623441 = 400 (0,0) 0 2 18 6.05 (-5.06914 1 -50.3332)
11,  0.453488+0.399225+0.143411+0.00387597 = 63.5 (1.72047e-14,0) 0 4 17 (0 1 -38.8836)
  11,  0.596939+0.209184+0.188776+0.00510204 = 48 (1.78036e-08,0) 0 2 26 63.5 (-3.51014 1 -34.1475)
    11,  0.702532+0.259494+0.0316456+0.00632911 = 38.5 (4.08224e-05,2.18087) 0 4 3 (0 1 -22.2479)
      12,  0.03125+0.90625+0.03125+0.03125 = 7 (0.99996,0)
      11,  0.853846+0.1+0.0384615+0.00769231 = 31.5 (0.180828,0) 0 4 8 (0 1 -18.3001)
        12,  0.125+0.625+0.125+0.125 = 1 (0.819132,0)
        11,  0.880952+0.0714286+0.0396825+0.00793651 = 30.5 (0.158225,0) 0 2 22 151 (-3.2738 1 -15.7421)
          12,  0.0769231+0.692308+0.153846+0.0769231 = 2.25 (0.660907,0)
          12,  0.948718+0.00854701+0.034188+0.00854701 = 28.25 (0.660907,0)
    11,  0.166667+0.0238095+0.785714+0.0238095 = 9.5 (0.568568,0) 0 4 25 (0 1 -8.53704)
      12,  0.03125+0.03125+0.90625+0.03125 = 7 (0.431432,0)
      11,  0.5+0.0714286+0.357143+0.0714286 = 2.5 (0.33163,0) 0 2 18 17.5 (-0.730826 1 -5.85367)
        12,  0.125+0.125+0.625+0.125 = 1 (0.0998022,0)
        12,  0.7+0.1+0.1+0.1 = 1.5 (0.0998022,0)
  12,  0.0151515+0.954545+0.0151515+0.0151515 = 15.5 (1,0)
12,  0.000740741+0.997778+0.000740741+0.000740741 = 336.5 (1,0)

cd Data/thyroid ; thead -ps hypo.tree ; echo 
Tree 1 has 9 leaves and 17 nodes (weight -50.3332)

cd Data/thyroid ; \
  mktree -o "-Pnull -C10 -it -Sfull -d6" -p -n -c -slvGt hypo ; echo 
Percentage accuracy for tree 1 = 99.1103 +/- 0.161708
Mean square error for tree 1 = 0.0168788
Expected accuracy for tree 1 = 98.8047
Typical std. dev. of expected accuracy for an example = 3.3198
Estimated accuracy from X-val = 97.4986+/-0.780843
Leaf count for tree 1 = 5, expected = 5.000000
Misclassification matrix for tree 1:
 (row = predicted, col = actual, in .attr file order)
  0.048932  0.004448  0.002372  0.000000 | 0.055753
  0.000000  0.919039  0.000000  0.000593 | 0.919632
  0.000000  0.001483  0.023132  0.000000 | 0.024614
  0.000000  0.000000  0.000000  0.000000 | 0.000000
--------------------------------------------------
  0.048932  0.924970  0.025504  0.000593 | 1.00000

cd Data/thyroid ; tprint -p hypo ; echo

TSH < 6.05:  7.429e-11 1 7.429e-11 7.429e-11
TSH >= 6.05: 
|   TSH_measured = f:  1.613e-09 1 1.613e-09 1.613e-09
|   TSH_measured = t: 
|   |   FTI < 63.5:  0.1579 2.632e-09 0.8421 2.632e-09
|   |   FTI >= 63.5: 
|   |   |   on_thyroxine = f:  0.873 0.09524 0.03175 7.937e-10
|   |   |   on_thyroxine = t:  3.571e-09 1 3.571e-09 3.571e-09

cd Data/thyroid ; mkclean hypo
cd Data/thyroid ; yes | rm -f hypo.enc* hypo.chtr
