packages feed

Emping 0.4 → 0.5

raw patch · 28 files changed

+1256/−595 lines, 28 filesdep +fglbinary-added

Dependencies added: fgl

Files

Emping.cabal view
@@ -1,8 +1,8 @@ name:                Emping-version:             0.4+version:             0.5 license:             GPL license-file:        LICENSE-build-depends:       base, parsec+build-depends:       base, parsec, fgl copyright:           Hans van Thiel 2006 - 2008 author:              Hans van Thiel maintainer:          hthiel.char@zonnet.nl@@ -10,19 +10,13 @@ build-type:          Simple  stability:           experimental-homepage:            http://j-van-thiel.speedlinq.nl/+homepage:            http://home.telfort.nl/sp969709/ synopsis:            derives heuristic rules from nominal data-description:         utility that reads a table in a csv (comma-                     separated) format that can be generated from-                     Open Office Calc (spreadsheet), derives all shortest rules-                     for a selected attribute, and writes them to a .csv file-                     that can be read by OO Calc. The shortest rules may be-                     partially ordered by implication (entailment) and equivalence-                     (equality) and the top level is also shown in .csv format.-                     Optionally all logical entailments and equalities are listed-                     as well. If the data set contains ambiguous rules or more-                     occurrences of the same rule the user is warned. Version 0.4-                     allows blank fields for values and has a Gtk2Hs based GUI.+description:         utility that reads a table in a csv (comma separated) format that can be generated from+                     Open Office Calc (spreadsheet), derives all shortest rules for a selected attribute,+                     and writes them to a .csv file that can be read by OO Calc. The shortest rules may be+                     partially ordered by implication (entailment) and equivalence (equality) and this partial+                     order is shown in Graphviz readable .dot files. Emping has a Gtk2Hs based GUI. category:            Data Mining extra-source-files:  README @@ -30,7 +24,7 @@ hs-source-dirs:    src main-is:           Main.hs -ghc-options:       -O2 -Wall -optl-Wl,-s+ghc-options:       -O2 -Wall  other-modules:     CSVParse                    Codec                    Reduce
README view
@@ -1,6 +1,6 @@ The compressed archive contains source files in the functional programming language Haskell. -Emping should compile on any platform which has the Glasgow Haskell compiler version 6.8 installed,+Emping should compile on any platform which has the Glorious Haskell Compiler version 6.8 installed, and a Gtk2Hs library 0.9.12 or higher.   One way to install Emping is through Cabal, for example:@@ -23,6 +23,6 @@  Or, put the source files in a directory of your choice and compile them with: -ghc --make -O2 -Wall -Werror -optl-Wl,-s -o emping+ghc --make -O2 -Wall Main.hs -o emping -where 'ghc' is the Haskell compiler and emping is the executable.+where 'ghc' is the Haskell compiler, Main.hs is the source file of that name, and emping is the executable.
+ doc/examples/Audiology.csv view
@@ -0,0 +1,201 @@+"age_gt_60","Air ()","airBoneGap","ar_c()","ar_u()","bone","boneAbnormal","bser()","history_buzzing","history_dizziness","history_fluctuating","history_fullness","history_hereditary","history_nausea","history_noise","history_recruitment","history_ringing","history_roaring","history_vomiting","late_wave_poor","m_at_2k","m_cond_lt_1k","m_gt_1k","m_m_gt_2k","m_m_sn","m_m_sn_gt_1k","m_m_sn_gt_2k","m_m_sn_gt_500","m_p_sn_gt_2k","m_s_gt_500","m_s_sn","m_s_sn_gt_1k","m_s_sn_gt_2k","m_s_sn_gt_3k","m_s_sn_gt_4k","m_sn_2_3k","m_sn_gt_1k","m_sn_gt_2k","m_sn_gt_3k","m_sn_gt_4k","m_sn_gt_500","m_sn_gt_6k","m_sn_lt_1k","m_sn_lt_2k","m_sn_lt_3k","middle_wave_poor","mod_gt_4k","mod_mixed","mod_s_mixed","mod_s_sn_gt_500","mod_sn","mod_sn_gt_1k","mod_sn_gt_2k","mod_sn_gt_3k","mod_sn_gt_4k","mod_sn_gt_500","notch_4k","notch_at_4k","o_ar_c()","o_ar_u()","s_sn_gt_1k","s_sn_gt_2k","s_sn_gt_4k","speech()","static_normal","tymp()","viith_nerve_signs","wave_V_delayed","waveform_ItoV_prolonged","indentifier","Class"+"no","mild","no","normal","normal","?","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p1","cochlear_unknown"+"no","moderate","no","normal","normal","?","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p2","cochlear_unknown"+"yes","mild","yes","?","absent","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","?","absent","no","no","no","normal","yes","as","no","no","no","p3","mixed_cochlear_age_fixation"+"yes","mild","yes","?","absent","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","?","absent","no","no","no","normal","yes","b","no","no","no","p4","mixed_cochlear_age_otitis_media"+"yes","mild","no","normal","normal","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p5","cochlear_age"+"yes","mild","no","normal","normal","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_good","yes","a","no","no","no","p6","cochlear_age"+"no","mild","no","normal","normal","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p7","cochlear_unknown"+"no","mild","no","normal","normal","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_good","yes","a","no","no","no","p8","cochlear_unknown"+"no","severe","no","?","?","?","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","?","?","no","no","no","?","yes","a","no","no","no","p9","cochlear_unknown"+"yes","mild","no","elevated","absent","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","absent","no","no","no","good","yes","a","no","no","no","p10","cochlear_age"+"yes","mild","no","normal","absent","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","absent","no","no","no","very_good","yes","a","no","no","no","p11","cochlear_age"+"yes","mild","no","normal","normal","?","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p12","cochlear_age"+"no","severe","no","normal","normal","moderate","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_poor","yes","a","no","no","no","p13","cochlear_unknown"+"no","normal","no","elevated","normal","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","elevated","no","no","no","normal","yes","a","no","no","no","p14","normal_ear"+"yes","mild","no","normal","normal","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","very_good","yes","a","no","no","no","p15","cochlear_age"+"yes","mild","no","normal","elevated","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","good","yes","a","no","no","no","p16","cochlear_age"+"no","mild","no","normal","normal","mild","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","normal","elevated","no","no","no","very_good","yes","a","no","no","no","p17","cochlear_poss_noise"+"no","mild","no","normal","elevated","mild","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","normal","normal","no","no","no","normal","yes","a","no","no","no","p18","cochlear_poss_noise"+"no","normal","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","normal","yes","a","no","no","no","p19","normal_ear"+"no","normal","no","normal","elevated","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p20","cochlear_unknown"+"yes","mild","no","normal","normal","?","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","yes","no","no","very_poor","yes","a","no","no","no","p21","cochlear_age_and_noise"+"yes","mild","no","normal","normal","?","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","yes","no","normal","yes","a","no","no","no","p22","cochlear_age_and_noise"+"no","normal","no","normal","normal","?","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","normal","normal","no","yes","no","good","yes","a","no","no","no","p23","cochlear_poss_noise"+"no","normal","no","normal","normal","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p24","normal_ear"+"no","moderate","no","elevated","elevated","?","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_poor","yes","a","no","no","no","p25","cochlear_unknown"+"no","normal","no","normal","normal","normal","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","normal","elevated","no","no","no","very_good","yes","a","no","no","no","p26","cochlear_unknown"+"no","normal","no","normal","elevated","normal","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_good","yes","a","no","no","no","p27","cochlear_unknown"+"no","mild","no","normal","normal","?","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","yes","normal","yes","a","no","no","no","p28","cochlear_poss_noise"+"no","mild","no","absent","absent","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","normal","no","no","no","very_poor","yes","a","no","no","no","p29","acoustic_neuroma"+"no","mild","no","elevated","normal","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","a","no","no","no","p30","cochlear_unknown"+"no","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","elevated","normal","no","no","no","normal","yes","a","no","no","no","p31","cochlear_poss_noise"+"no","normal","no","elevated","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p32","normal_ear"+"no","normal","no","normal","elevated","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","elevated","normal","no","no","no","good","yes","a","no","no","no","p33","cochlear_unknown"+"no","normal","no","elevated","elevated","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","yes","no","normal","normal","no","no","no","good","yes","a","no","no","no","p34","cochlear_unknown"+"no","moderate","yes","absent","absent","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","normal","no","no","no","very_good","yes","b","no","no","no","p35","mixed_cochlear_unk_ser_om"+"no","mild","no","absent","normal","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","a","no","no","no","p36","cochlear_unknown"+"yes","mild","no","absent","absent","mild","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","absent","absent","no","no","no","very_good","yes","a","no","no","no","p37","cochlear_age_and_noise"+"no","normal","no","absent","elevated","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","a","no","no","no","p38","normal_ear"+"no","severe","yes","absent","absent","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","elevated","no","no","no","very_poor","yes","ad","no","no","no","p39","conductive_discontinuity"+"yes","normal","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","good","yes","a","no","no","no","p40","cochlear_age"+"yes","normal","no","elevated","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_good","yes","a","no","no","no","p41","cochlear_age"+"no","normal","no","normal","elevated","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","a","no","no","no","p42","normal_ear"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p43","cochlear_age"+"no","mild","no","elevated","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","elevated","elevated","no","no","no","normal","yes","a","no","no","no","p44","cochlear_unknown"+"no","mild","no","elevated","elevated","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","elevated","normal","no","no","no","normal","yes","a","no","no","no","p45","cochlear_unknown"+"no","moderate","no","absent","absent","moderate","yes","?","yes","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","very_poor","yes","a","no","yes","no","p46","retrocochlear_unknown"+"no","mild","yes","absent","absent","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","?","yes","as","no","no","no","p47","conductive_fixation"+"no","mild","no","absent","absent","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","elevated","no","no","no","normal","yes","a","no","no","no","p48","cochlear_unknown"+"no","normal","no","absent","elevated","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","a","no","no","no","p49","normal_ear"+"yes","moderate","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","yes","no","very_poor","no","a","no","no","no","p50","cochlear_age"+"yes","moderate","no","normal","elevated","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","yes","no","very_poor","no","a","no","no","no","p51","cochlear_age"+"yes","normal","no","elevated","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p52","cochlear_age"+"no","normal","no","absent","elevated","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","a","no","no","no","p53","normal_ear"+"no","moderate","yes","absent","absent","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","elevated","no","no","no","good","yes","ad","no","no","no","p54","conductive_discontinuity"+"no","normal","no","elevated","absent","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","elevated","no","no","no","normal","yes","a","no","no","no","p55","normal_ear"+"no","normal","no","elevated","elevated","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","elevated","absent","no","no","no","normal","yes","a","no","no","no","p56","cochlear_unknown"+"no","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p57","cochlear_unknown"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","very_good","no","a","no","no","no","p58","cochlear_age"+"yes","mild","no","normal","elevated","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","poor","yes","a","no","no","no","p59","cochlear_age"+"no","normal","no","normal","elevated","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","elevated","normal","no","no","no","very_good","yes","a","no","no","no","p60","cochlear_poss_noise"+"no","normal","no","elevated","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","normal","elevated","no","no","no","normal","yes","a","no","no","no","p61","cochlear_poss_noise"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","yes","no","normal","normal","no","no","no","good","yes","a","no","no","no","p62","cochlear_age_and_noise"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","yes","no","normal","normal","no","no","no","poor","yes","a","no","no","no","p63","cochlear_age_and_noise"+"no","normal","no","elevated","elevated","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","yes","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p64","cochlear_unknown"+"no","normal","no","normal","normal","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","elevated","no","no","no","normal","yes","a","no","no","no","p65","normal_ear"+"no","mild","no","absent","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","absent","no","no","no","good","yes","a","no","no","no","p66","cochlear_unknown"+"no","normal","no","elevated","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","absent","no","no","no","normal","yes","a","no","no","no","p67","normal_ear"+"yes","mild","no","absent","?","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","absent","absent","no","no","no","good","yes","a","no","no","no","p68","cochlear_age_and_noise"+"yes","mild","no","absent","absent","mild","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","very_good","yes","a","no","no","no","p69","cochlear_age_and_noise"+"no","mild","no","elevated","elevated","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","elevated","normal","no","no","no","poor","yes","a","no","no","no","p70","cochlear_unknown"+"no","mild","no","elevated","normal","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","elevated","elevated","no","no","no","poor","yes","a","no","no","no","p71","cochlear_unknown"+"no","normal","no","absent","normal","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","absent","no","no","no","normal","yes","a","no","no","no","p72","normal_ear"+"yes","normal","no","normal","elevated","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","normal","no","no","no","normal","yes","a","no","no","no","p73","cochlear_age"+"yes","normal","no","elevated","normal","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","good","yes","a","no","no","no","p74","cochlear_age"+"yes","mild","no","absent","elevated","mild","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","absent","absent","no","no","no","poor","yes","a","no","no","no","p75","cochlear_age_and_noise"+"no","normal","no","absent","normal","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","a","no","no","no","p76","normal_ear"+"no","mild","no","absent","absent","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","normal","no","no","no","normal","yes","a","yes","no","no","p77","bells_palsy"+"no","normal","no","normal","normal","?","no","?","no","no","no","no","yes","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","yes","no","very_good","yes","a","no","no","no","p78","cochlear_noise_and_heredity"+"no","normal","no","normal","elevated","?","no","?","no","no","no","no","yes","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","yes","no","good","yes","a","no","no","no","p79","cochlear_noise_and_heredity"+"no","normal","no","absent","normal","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","a","no","no","no","p80","cochlear_unknown"+"no","moderate","yes","absent","absent","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","very_good","yes","b","no","no","no","p81","mixed_cochlear_unk_ser_om"+"no","mild","yes","absent","absent","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","as","no","no","no","p82","mixed_cochlear_unk_fixation"+"no","moderate","yes","absent","absent","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","very_good","yes","as","no","no","no","p83","mixed_cochlear_unk_fixation"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p84","cochlear_age"+"no","mild","no","elevated","normal","mild","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","normal","no","no","no","very_good","yes","c","no","no","no","p85","mixed_poss_noise_om"+"no","mild","no","elevated","normal","mild","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","normal","no","no","no","poor","yes","c","no","no","no","p86","mixed_poss_noise_om"+"no","mild","yes","absent","absent","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","elevated","no","no","no","normal","yes","b","no","no","no","p87","otitis_media"+"no","normal","no","absent","elevated","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","c","no","no","no","p88","otitis_media"+"no","mild","no","elevated","normal","mild","no","?","no","yes","yes","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","good","no","a","no","no","no","p89","possible_menieres"+"no","normal","no","normal","elevated","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","normal","no","no","no","very_good","yes","a","no","no","no","p90","normal_ear"+"no","normal","no","normal","normal","?","no","?","no","yes","no","no","no","yes","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","no","a","no","no","yes","p91","possible_brainstem_disorder"+"no","mild","no","normal","normal","?","no","?","no","yes","yes","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","no","a","no","no","no","p92","possible_menieres"+"no","normal","no","normal","normal","?","no","?","no","yes","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","no","a","no","no","no","p93","cochlear_unknown"+"no","normal","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","yes","normal","normal","no","no","no","normal","yes","a","no","no","no","p94","cochlear_poss_noise"+"yes","severe","no","normal","normal","?","no","?","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_poor","yes","a","no","no","no","p95","cochlear_age_plus_poss_menieres"+"no","mild","no","normal","normal","?","no","?","no","yes","yes","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","no","a","no","no","no","p96","possible_menieres"+"yes","moderate","no","normal","normal","moderate","no","?","no","yes","yes","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_poor","yes","a","no","no","no","p97","possible_menieres"+"yes","moderate","no","elevated","normal","unmeasured","no","?","no","no","no","no","no","yes","yes","no","no","yes","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_poor","yes","a","no","no","no","p98","possible_menieres"+"no","mild","no","normal","normal","?","no","?","no","yes","no","no","no","yes","yes","no","no","yes","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p99","cochlear_unknown"+"yes","normal","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p100","cochlear_age"+"no","moderate","yes","absent","absent","normal","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","very_poor","yes","b","no","no","no","p101","otitis_media"+"no","severe","yes","absent","absent","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","elevated","no","no","no","poor","yes","b","no","no","no","p102","mixed_cochlear_unk_ser_om"+"no","mild","yes","absent","elevated","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","very_good","yes","a","no","no","no","p103","otitis_media"+"yes","moderate","yes","normal","absent","mild","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","very_poor","yes","b","no","no","no","p104","mixed_cochlear_age_s_om"+"yes","normal","no","absent","absent","normal","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","normal","absent","no","no","no","good","yes","a","no","no","no","p105","cochlear_age"+"no","normal","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p106","cochlear_unknown"+"no","mild","no","normal","elevated","unmeasured","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","normal","elevated","yes","no","no","poor","yes","a","no","no","no","p107","cochlear_poss_noise"+"no","normal","no","normal","normal","normal","no","?","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","elevated","no","no","no","very_good","yes","a","no","no","no","p108","normal_ear"+"no","mild","no","elevated","elevated","mild","no","?","no","yes","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","normal","normal","no","no","no","good","yes","a","no","yes","no","p109","retrocochlear_unknown"+"no","mild","no","absent","absent","normal","no","?","no","yes","no","no","no","no","yes","no","yes","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","elevated","no","no","no","very_good","yes","ad","no","no","no","p110","mixed_cochlear_unk_discontinuity"+"no","normal","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","yes","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p111","cochlear_unknown"+"no","moderate","yes","absent","absent","mild","no","?","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","normal","no","no","no","normal","yes","as","no","no","no","p112","mixed_cochlear_unk_fixation"+"no","normal","no","absent","normal","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","very_good","yes","a","no","no","no","p113","normal_ear"+"no","mild","no","absent","absent","mild","no","?","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","elevated","no","no","no","very_good","yes","a","no","no","no","p114","possible_menieres"+"yes","normal","no","absent","absent","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","?","absent","no","no","no","normal","yes","c","no","no","no","p115","mixed_cochlear_age_otitis_media"+"yes","normal","no","absent","absent","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","absent","absent","no","no","no","poor","yes","b","no","no","no","p116","mixed_cochlear_age_s_om"+"no","mild","no","absent","absent","normal","no","normal","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","c","no","no","no","p117","mixed_poss_central_om"+"no","normal","no","absent","absent","normal","no","normal","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","poor","yes","a","no","no","no","p118","poss_central"+"yes","moderate","yes","elevated","absent","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","elevated","no","no","no","good","yes","c","no","no","no","p119","mixed_cochlear_age_otitis_media"+"no","normal","no","normal","normal","unmeasured","no","degraded","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","no","a","no","no","no","p120","possible_brainstem_disorder"+"no","profound","no","?","?","?","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","?","?","no","no","no","?","yes","a","no","no","no","p121","cochlear_unknown"+"yes","mild","no","normal","normal","?","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p122","cochlear_age"+"yes","mild","no","normal","elevated","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","good","yes","a","no","no","no","p123","cochlear_age"+"no","mild","no","normal","normal","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p124","cochlear_unknown"+"no","normal","no","normal","normal","normal","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","normal","elevated","no","no","no","very_good","yes","a","no","no","no","p125","cochlear_unknown"+"no","mild","no","normal","normal","?","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","yes","normal","yes","a","no","no","no","p126","cochlear_poss_noise"+"yes","mild","no","normal","normal","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","poor","yes","a","no","no","no","p127","cochlear_age"+"yes","mild","no","normal","normal","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p128","cochlear_age"+"yes","mild","no","absent","absent","mild","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","absent","absent","no","no","no","very_good","yes","a","no","no","no","p129","cochlear_age_and_noise"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p130","cochlear_age"+"no","mild","yes","absent","absent","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","?","yes","as","no","no","no","p131","conductive_fixation"+"yes","normal","no","elevated","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p132","cochlear_age"+"no","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p133","cochlear_unknown"+"no","severe","yes","absent","absent","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","poor","yes","as","no","no","no","p134","conductive_fixation"+"no","severe","yes","absent","absent","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","poor","yes","as","no","no","no","p135","conductive_fixation"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_good","yes","a","no","no","no","p136","cochlear_age"+"no","normal","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p137","normal_ear"+"no","mild","no","normal","normal","?","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p138","cochlear_unknown"+"yes","moderate","no","normal","normal","?","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","elevated","no","no","no","very_poor","yes","a","no","no","no","p139","cochlear_age_and_noise"+"yes","mild","no","elevated","elevated","?","yes","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_poor","yes","a","no","no","no","p140","cochlear_age_and_noise"+"no","normal","no","normal","normal","?","no","?","no","yes","no","no","no","yes","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","no","a","no","no","yes","p141","possible_brainstem_disorder"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p142","cochlear_age"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_good","yes","a","no","no","no","p143","cochlear_age"+"no","normal","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","yes","normal","normal","no","no","no","normal","yes","a","no","no","no","p144","cochlear_poss_noise"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p145","cochlear_age"+"no","normal","no","normal","elevated","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","normal","normal","no","no","no","normal","yes","a","no","no","no","p146","cochlear_poss_noise"+"no","normal","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","normal","elevated","no","no","no","normal","yes","a","no","no","no","p147","cochlear_poss_noise"+"no","mild","no","normal","normal","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p148","cochlear_unknown"+"no","mild","no","normal","normal","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p149","cochlear_unknown"+"no","normal","no","normal","normal","?","no","?","no","yes","yes","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","no","a","no","no","no","p150","possible_menieres"+"yes","normal","no","normal","normal","normal","no","?","no","yes","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p151","normal_ear"+"no","normal","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","normal","normal","no","no","no","normal","yes","a","no","no","no","p152","cochlear_poss_noise"+"no","normal","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","yes","normal","normal","no","no","no","good","yes","a","no","no","no","p153","cochlear_poss_noise"+"yes","mild","no","normal","normal","unmeasured","no","?","no","no","no","no","no","yes","yes","no","no","yes","yes","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","normal","no","no","no","poor","yes","a","no","no","no","p154","cochlear_age_and_noise"+"no","mild","no","normal","normal","?","no","?","no","yes","no","no","no","yes","yes","no","no","yes","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p155","cochlear_unknown"+"yes","normal","no","normal","normal","?","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p156","cochlear_age"+"no","normal","no","normal","normal","normal","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p157","normal_ear"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","normal","normal","no","no","no","very_poor","yes","a","no","no","no","p158","cochlear_age_and_noise"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_poor","yes","a","no","no","no","p159","cochlear_age_and_noise"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","normal","normal","no","no","no","?","yes","a","no","no","no","p160","cochlear_age_and_noise"+"yes","mild","no","normal","normal","?","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","normal","normal","no","no","no","?","yes","a","no","no","no","p161","cochlear_age_and_noise"+"yes","mild","no","absent","normal","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","absent","no","no","no","good","yes","a","no","no","no","p162","cochlear_age"+"yes","mild","no","normal","absent","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","normal","no","no","no","very_good","yes","a","no","no","no","p163","cochlear_age"+"yes","mild","no","normal","elevated","unmeasured","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","unmeasured","yes","a","no","no","no","p164","cochlear_age"+"yes","mild","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","unmeasured","yes","a","no","no","no","p165","cochlear_age"+"no","mild","yes","absent","absent","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","as","no","no","no","p166","mixed_cochlear_unk_fixation"+"no","moderate","yes","absent","absent","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","as","no","no","no","p167","mixed_cochlear_unk_fixation"+"no","normal","no","normal","normal","unmeasured","no","?","no","yes","no","no","no","yes","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p168","cochlear_unknown"+"no","normal","no","normal","normal","unmeasured","no","?","no","yes","no","no","no","yes","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p169","cochlear_unknown"+"yes","mild","no","normal","normal","mild","yes","?","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","good","yes","a","no","no","no","p170","cochlear_age"+"yes","mild","no","normal","elevated","mild","yes","?","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","good","yes","a","no","no","no","p171","cochlear_age"+"no","normal","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","yes","no","normal","normal","no","no","no","good","yes","a","no","no","no","p172","cochlear_unknown"+"no","mild","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","normal","normal","no","no","no","poor","yes","a","no","no","no","p173","cochlear_unknown"+"no","normal","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p174","cochlear_unknown"+"no","normal","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p175","cochlear_unknown"+"no","normal","no","normal","elevated","unmeasured","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","normal","elevated","no","no","no","very_good","yes","a","no","no","no","p176","cochlear_poss_noise"+"no","normal","no","absent","elevated","normal","no","?","no","yes","no","no","no","no","yes","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","ad","no","no","no","p177","mixed_cochlear_unk_discontinuity"+"yes","mild","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_good","yes","a","no","no","no","p178","cochlear_age"+"yes","normal","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p179","cochlear_age"+"no","normal","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","yes","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p180","cochlear_unknown"+"no","normal","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p181","cochlear_unknown"+"no","mild","no","elevated","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","normal","no","no","no","normal","yes","a","no","no","no","p182","cochlear_unknown"+"no","mild","no","elevated","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","normal","no","no","no","good","yes","a","no","no","no","p183","cochlear_unknown"+"yes","mild","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","poor","yes","a","no","no","no","p184","cochlear_age"+"yes","mild","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","poor","yes","a","no","no","no","p185","cochlear_age"+"no","mild","no","absent","elevated","mild","no","?","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","a","no","no","no","p186","possible_menieres"+"no","mild","no","elevated","normal","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","poor","yes","a","no","no","no","p187","cochlear_unknown"+"no","mild","no","normal","normal","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","normal","no","no","no","poor","yes","a","no","no","no","p188","cochlear_unknown"+"no","severe","yes","absent","absent","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","very_poor","yes","as","no","no","no","p189","conductive_fixation"+"no","mild","yes","absent","absent","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","absent","no","no","no","normal","yes","as","no","no","no","p190","conductive_fixation"+"yes","normal","no","absent","normal","normal","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","elevated","absent","no","no","no","very_good","yes","a","no","no","no","p191","normal_ear"+"yes","mild","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","normal","normal","no","no","no","unmeasured","yes","a","no","no","no","p192","cochlear_age_and_noise"+"yes","normal","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","normal","normal","no","no","no","good","yes","a","no","no","no","p193","cochlear_age_and_noise"+"yes","mild","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","elevated","no","no","no","good","yes","a","no","no","no","p194","cochlear_age"+"yes","mild","no","normal","elevated","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_good","yes","a","no","no","no","p195","cochlear_age"+"yes","mild","no","absent","normal","mild","yes","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","normal","absent","no","no","no","very_good","yes","a","no","no","no","p196","cochlear_age"+"yes","mild","no","normal","absent","mild","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","absent","normal","no","no","no","very_good","yes","c","no","no","no","p197","mixed_cochlear_age_otitis_media"+"no","normal","no","normal","normal","unmeasured","no","degraded","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","no","a","no","no","no","p198","possible_brainstem_disorder"+"yes","mild","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","very_good","yes","a","no","no","no","p199","cochlear_age"+"yes","normal","no","normal","normal","unmeasured","no","?","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","yes","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","no","normal","normal","no","no","no","normal","yes","a","no","no","no","p200","cochlear_age"
− doc/user guide/Emping-1.png

binary file changed (11498 → absent bytes)

− doc/user guide/Emping-2.png

binary file changed (14322 → absent bytes)

− doc/user guide/Mushrooms.png

binary file changed (94906 → absent bytes)

− doc/user guide/Mushrooms_Class.png

binary file changed (68997 → absent bytes)

− doc/user guide/Mushrooms_Class_All.png

binary file changed (66651 → absent bytes)

− doc/user guide/Mushrooms_Class_Top.png

binary file changed (56660 → absent bytes)

− doc/user guide/empug-0.4-local.html
@@ -1,227 +0,0 @@-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">--<html>-<head>-  <meta name="generator" content="Bluefish 1.0.7">-  <title>Emping User Guide, Version 0.4</title>-</head>--<body bgcolor="white" text="black">-  <p align="center"></p>--  <center>-    <h1>Emping User Guide, Version 0.4</h1><font size=-    "4"><i>Author: Hans van Thiel, March 2008</i><br>-    email: hthiel.char@zonnet.nl</font>-  </center>-  -  <h1>New in Version 0.4</h1>-  <ul>-   <li>Emping 0.4 supports blank fields, which allows for merging of tables, -   and thus a larger class of reduction problems.<br>-    This feature has, at the time of writing, only been summarily tested.</li> -   <li>Emping 0.4 has a GUI, written in Gtk2Hs, which is the the Haskell port of GTK+</li> -   <li>Source code and compilation have been optimized and GHC 6.8 has been used. Emping 0.4 -   appears to be faster than version 0.3</li>  -  </ul>--  <h1>1. Overview</h1>--  <h2>1.1. What</h2>--  <p>Emping is a utility that derives heuristic rules from nominal-  data. Nominal data are qualitative and unordered, as in:</p>--  <ul>-    <li>Color: red, green, blue, yellow, black</li>--    <li>Proposition 1: True, False</li>--    <li>Class: A,B,C,D</li>-  </ul>--  <p>Class is actually an ordinal attribute, but when the order is-  disregarded, it is nominal.</p>--  <p>Heuristic rules consist of attribute values (predicates) that-  together imply another attribute value. For example:</p>--  <dl>-    <dt>Color:green and Proposition 1:True is Class:B</dt>-  </dl>--  <p>Heuristic rules are purely empirical, with no foundation in a-  theory or model. The input of Emping is just a table of nominal-  facts. The user has to select which attribute is to be the-  consequent. Then Emping derives all shortest rules which, in the-  table, imply the values of the selected consequent. Each reduced-  rule is a generalization of one or more original rules, and-  therefore reduced rules may imply other reduced rules or be-  equivalant to others. If this is the case, these logical-  dependencies are also derived.</p>--  <h2>1.2. How</h2>--  <p>Emping reads a file in a comma seperated format (.csv) as-  produced by the Open Office Calc spreadsheet, and returns the-  results as .csv files that can be read by OO Calc.</p>--  <p>Emping 0.4 has a GUI and you can start it like any other application.</p>-  <p><img align="middle" src="Emping-1.png" alt="Emping-1" /> </p>  --  <p>The general idea is straightforward; see the example for details. First,-  you check or uncheck in the options menu whether you want to check the data for duplicates.-  These have no effect on the result, but will slow the program down, and they are automatically removed -  if the option is selected (but not from the source file itself). If there are duplicates you-  can see which, with their frequencies, by saving them.</p>-  <p>Next you select the consequent attribute from a popup menu. If you have the relevant options menu item-  checked, emping will look for ambiguous rules for the selected consequent. These are-  rules which are the same, except for the consequent value. Emping works seamlessly with -  ambiguous rules (but see the included white paper "Deriving-  Heuristic Rules from Facts" for how they effect the results.)</p>-  <p>Pressing the Reduce button will then start the reduction. Depending on the data set, this -  may take a while, during which time the file save window will remain open. For small data sets-  the effect will not be noticeable, but do not try to close it unless you want to abort the reduction.</p>-  <p>Reduced rules may themselves imply, or be equivalent to, other reduced rules with the same consequent value.-  The default Top button will show only the top level of these rules (saved in a .csv file) but you can get all-  interdependencies through the Abduce All menu item.</p>-  <p>The reduced normal form file, the top level rule file and the-  others (if present), can now be loaded into OO Calc.</p>--  <h2>1.3. More</h2>--  <p>More about the principles on which emping is based can be-  found in the mentioned white paper "Deriving-  Heuristic Rules from Facts". The general idea is also illustrated by:-  <a href="http://j-van-thiel.speedlinq.nl/pdm/exq.html">Fishing</a></p>--  <h1>2. Example</h1>--  <h2>2.1. Step 1</h2>--  <p>Enter the data in Open Office Calc as shown:</p>--  <p><img align="middle" src="Mushrooms.png" border="0" alt=-  "Mushrooms in OO Calc"></p>--  <ul>-    <li>The first row must list the attribute names. It is recommended-    you give each a unique name, but you can use duplicates and blanks.-    The columns below each attribute name list the values for that attribute, possibly blanks. -    <li>Each value name has its column as its scope, so you can use values "Yes" and "No",-    for example, for different attributes.</li>--    <li>A blank value field stands for "none of the others". This feature is new to version 0.4. -    Using blanks you can now use Emping on data sets which have splits on some values. For example,-    an attribute "owns a car" can be 'yes" and 'no", and then "yes" can have fields on "price range", "make",-    and so on, with field "no" blank on those values. This feature has, at the time of writing,-    only be tested on small hypothetical data sets.</li>-    -    <li>You can select an attribute with blank fields as the consequent. Because a blank field-    stands for "none of the others" or "not applicable", rules with a blank consequent value-    will automatically be removed from the rule set before the reduction is applied.</li>--    <li>you can use whole numbers, like 0, 1, 3, 22 etc., but they-    will be treated as nominal values, just like A,B,C etc.</li>-  </ul>--  <h2>2.2. Step 2</h2>--  <p>Save the spreadsheet table in Text CSV format. Choose double quotes as the-  text delimiter (default). Whole numbers will be stored without-  delimiters, and emping will use them after checking if they are-  all digits (no negatives, no fractions). Names within quotes-  should not contain special characters, only letters, possibly-  numbers and white space.</p> --  <h2>2.3. Step 3</h2>--  <p>Just double click on the emping file or type the program name in the command line. Then open the source-  file and apply the toolbar sequence.</p>  --  <h2>2.4. Step 4</h2>-  <p>This is what you see when the reduction is finished with "Class" as the consequent.</p>-  <p> There are 165 dependency trees, and 5 rules which are not implied by others -  (except for possible equivalences, which will be shown in the .csv file).</p>-  <p><img align="middle" src="Emping-2.png" alt="Emping-2" /> </p> -  <p>You can now choose to  save only the top level, all dependencies, or both.</p>-  <h2>2.5. Step 5</h2>--  <p>View the reduced normal form in a .csv file in OO Calc.</p>--  <p><img align="middle" src="Mushrooms_Class.png" border="0" alt="Mushrooms_Class" /></p>--  <p>View the top level reduced rules, including equivalences, in your saved file.-  Equivalences, shown as 'equals', are reduced rules which imply each other, both ways.</p>--  <p><img align="middle" src="Mushrooms_Class_Top.png" border="0" alt="Mushrooms_Class_Tops" /></p>--  <p>If you have chosen to save them, all logical implications are-  shown in that file.--  <p><img align="middle" src="Mushrooms_Class_All.png" border="0"  alt="Mushrooms_Class_All" ></p>--  <p>This file shows the partial order of all the reduced rules. Each inference chain, including any-  equivalences, is shown seperately. In this case the number of lines was too large to fit into the spreadsheet.</p> -  -  -  <h1>Data Files</h1>  -  -  <p>The distribution comes with two example data files, Zoo and Mushrooms, -  both courtesy of the <a href="http://archive.ics.uci.edu/ml/">UCI Machine Learning Repository</a> .-  Thanks to: Asuncion, A. &amp; Newman, D.J. (2007).   UCI Machine Learning Repository -  [http://www.ics.uci.edu/~mlearn/MLRepository.html]. -  Irvine, CA: University of California, School of Information and Computer Science.</p>--  <p>The Zoo data file is by courtesy of Richard Forsyth.-  It lists 101 kinds of animals with 18 nominal attributes-  (including the names). The original data have been altered by replacing the two-  instances of "frog" by "frog1" and "frog2",-  respectively, and "girl" by "giri". All numerical-  boolean instances in the original have been replaced by-  "Yes" and "No".<br>-  The number of reduced rules with "Type" as the consequent attribute is 823.-  These fit into 9 top level equivalence classes. On a 2GHz machine the reduction-  took seconds to finish, but the time depends on the structure in the data, and is different for-  different attributes.</p>-  -  <p>The Mushroom data file is by courtesy of Jeff Schlimmer, who lists its origin as-  drawn from The Audubon Society Field Guide to North American Mushrooms (1981).-  G. H. Lincoff (Pres.), New York: Alfred A. Knopf<br>-  The example consists of 8124 cases and 23 attributes, including "Class", which has values-  "poisonous" and "edible".<br>-  The original file is coded by letters, according to a supplied legend, but this coding has-  been reverted to the original names for readability. The missing value mark "?" has been replaced-  by "missing".<br>-  The number of reduced rules for "Class" is 3635, and there are 165 dependency trees and 5 Unconnected rules.-  The number of all implications and equivalences was more than 65535, too many for OO Calc to load.<br>-  Parsing the source data  and checking for duplicates (none present) took half a minute, checking-  for ambiguities (none present) also took half a minute. The subsequent reduction (consequent "Class")-  took 9 minutes and getting the top level then took a few seconds. Getting all dependencies, -  resulting in a 150 MB large file, took 4 minutes more.-</p>--<h1>Notes</h1>-  <p>The Emping utility is written in Haskell, and has been-  developed and tested on the Fedora Core Linux platform, using-  the Haskell tools and libraries which are available as FC packages.-  Version 0.4 has been developed on FC8 with GHC 6.8.2 and Gtk2Hs 0.9.12.-  Earlier versions of GHC will probably not compile, and Gtk2Hs versions earlier than 0.9.12 -  don't support the implemented menu fields, and will not work.<br>-  <p>But GHC and Gtk2Hs are implemented on many platforms, including Windows and Linux versions, so-  Emping-0.4  should also work on those platforms.</p>--  <p>Any comments, bug reports, feature requests or remarks will be-  most welcome.</p>--  <p><i>Emping</i> stands for <i>empirical reasoning</i> or the-  Indonesian snack with that name.</p>--  -  <h1>Warning</h1>-  <p>For large data files like the Mushroom collection, which take a noticeable time to process, windows will-  remain open and the value selection popup may hang. This will correct itself when-  the processing is finished. Do not abort until you are sure something is wrong.</p>-  -</body>-</html>
+ doc/user guide/empug-local.html view
@@ -0,0 +1,246 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">++<html>+<head>+  <meta name="generator" content="Bluefish 1.0.7">+  <title>Emping User Guide, Version 0.5</title>+</head>++<body bgcolor="white" text="black">+  <p align="center"></p>++  <center>+    <h1>Emping User Guide, Version 0.5</h1><font size=+    "4"><i>Author: Hans van Thiel, April 2008</i><br>+    email: hthiel.char@zonnet.nl</font>+  </center>+  +  <h1>New in Version 0.5</h1>+  <ul>+   <li>The partial order of reduced rules is now displayed as graphs in Graphviz format.</li> +   <li>Reduced rules and equivalence groups are sorted by length.</li> +   <li>The GUI has been improved.</li>  +  </ul>++  <h1>1. Overview</h1>++  <h2>1.1. What</h2>++  <p>Emping is a utility that derives heuristic rules from nominal+  data. Nominal data are qualitative and unordered, as in:</p>++  <ul>+    <li>Color: red, green, blue, yellow, black</li>++    <li>Proposition 1: True, False</li>++    <li>Class: A,B,C,D</li>+  </ul>++  <p>Class is actually an ordinal attribute, but when the order is+  disregarded, it is nominal.</p>++  <p>Heuristic rules consist of attribute values (predicates) that+  together imply another attribute value. For example:</p>++  <dl>+    <dt>Color: green and Proposition 1: True is Class: B</dt>+  </dl>++  <p>Heuristic rules are purely empirical, with no foundation in a+  theory or model. The input of Emping is just a table of nominal+  facts. The user has to select which attribute is to be the+  consequent. Then Emping derives all shortest combinations of factors which, in the+  table, imply the values of the selected consequent.</p>+  <p>Each reduced rule is a generalization of one or more original rules, and+  therefore reduced rules may imply other reduced rules or be+  equivalant to others. So the reductions are partially ordered, and this partial order+  can be shown in a directed graph.</p>++  <h2>1.2. How</h2>++  <p>Emping reads a file in a comma seperated format (.csv) as+  produced by the Open Office Calc spreadsheet, and returns the+  results as .csv files that can be read by OO Calc. The graphs are in Graphviz format, +  and can be displayed by a Graphviz reader like dotty or ZRG Viewer.</p>++  <p>Emping 0.5 has a GUI and you can start it like any other application.</p>+  <p><img align="middle" src="./ugimg/Emping.png" alt="Emping" /> </p>  ++  <p>The general idea is straightforward; see the screenshots for details. First,+  you mark or unmark in the options menu whether you want to check the data for duplicates.+  These have no effect on the result, but will slow the program down, and they are automatically removed +  if the option is selected (but not from the source file itself). If there are duplicates you+  can see which, with their frequencies, by saving them. </p>+  <p>Next you select the consequent attribute from a popup menu. If you have the relevant options menu item+  checked, emping will look for ambiguous rules for the selected consequent.</p>+  <p>Ambiguous rules are rules which are exactly the same, except for the consequent value.   For example,+  an animal name may not be uniquely determined by a given description, only a group of animals.+  So the result is indecisive for all possible subsets of this description, as well as the longer original.+  The solution is to merge these rules with a new value, which denotes the union of the ambiguous rules,+  the group.</p>+  <p>However, it is possible to leave ambiguities in the data, as they will just cancel each other out. +  But if all rules for some consequent value are ambiguous, there will be no rules at all for this value,+  and this will result in a program error which blocks Emping. (See known bugs and issues.) </p>+  <p>Therefore it is recommended to run Emping only with no duplicates and unambiguous rules, +  though you can omit the checks, if you want, at your own risk.</p>+  <p>See the white paper <i>Deriving Heuristic Rules from Facts</i> for more.</p>+  <p>Pressing the Reduce button will start the actual reduction.</p>+  <p>Reduced rules may themselves imply, or be equivalent to, other reduced rules with the same consequent value.+  The Top button will produce only the top level of these rules (saved in a .csv file).</p>+  <p>The reduced normal form file, the top level rule file and the others (if present), +  can now be loaded into OO Calc.</p>+  <p>To see the partial order in Graphviz graphs you must first get the graph legend. This file, in .csv format, +  shows the nodes in the first column and the equivalence groups it denotes in the following rows. The+  legend is useful in itself because, unlike the top level only file, it shows all reduced rules +  grouped as equals.</p>+  <p>Now you can construct the graph for all attributes and also separate graphs for each value of the attribute.+  The reverse option lets you choose between the most general at the top(default), +  or the most specific at the top (reversed).</p>++  <h1>2. Known bugs and issues</h1>+  +  <ul>+  <li>If you run Emping with no ambiguity check, and ALL rules for some consequent attribute value+  are ambiguous, the program will stall. In the mushrooms file, for example, it turns out+  that all 292 kinds of mushroom, which grow in meadows, grow somewhere else too. Therefore there +  are no rules that determine whether a mushroom grows in a meadow or not, and the reduction result+  for <i>meadows</i> (consequent attribute <i>Habitat</i> is empty. In the current version this results in+  a program error, and the main loop will go to sleep. If there are no ambiguous rules, this situation +  cannot occur; there will always be at least one rule for <i>Habitat : meadows</i> .</li>+  <li>The ambiguity check does not distinguish duplicates (equal facts) from true ambiguities +  (equal antecedent, different consequent). So, if you run the ambiguity check, run the duplicate check too.</li>+  <li>If you run the same radio button selection consequently, for example the default and the reversed+  value graph, nothing will happen. This is because the action is triggered by a change in selection.+  A workaround is to select another choice, cancel, and then select the first again.</li>+  <li>If the duplicates and ambiguities checks  finish very quickly, the appearance of the file+  chooser window blocks the status message. This could easily confuse the user, who gets no special message +  that it is the duplicates/ambiguities which will be saved, not the reductions.+  </li>  +  </ul>  ++  <h2>Some Example Screenshots</h2>++  <p>An Open Office Calc data file:</p>++  <p><img align="middle" src="./ugimg/Mushrooms_Data.png" border="0" alt=+  "Mushrooms Data in OO Calc"></p>++  <ul>+    <li>The first row must list the attribute names. It is recommended+    you give each a unique name, but you can use duplicates and blanks.+    The columns below each attribute name list the values for that attribute, possibly blanks. +    <li>Each value name has its column as its scope, so you can use values "Yes" and "No",+    for example, for different attributes.</li>++    <li>A blank value field stands for "none of the others". This feature is new to version 0.4. +    Using blanks you can now use Emping on data sets which have splits on some values. For example,+    an attribute "owns a car" can be 'yes" and 'no", and then "yes" can have fields on price range, make,+    and so on, with field "no" blank on those values. This feature has, at the time of writing,+    only be tested on small hypothetical data sets.</li>+    +    <li>You can select an attribute with blank fields as the consequent. Because a blank field+    stands for "none of the others" or "not applicable", rules with a blank consequent value+    will automatically be removed from the rule set before the reduction is applied.</li>++    <li>you can use integral numbers, like 0, 1, 3, 22 etc., but they+    will be treated as nominal values, just like A,B,C etc.</li>  ++    <li>Save the spreadsheet table in Text CSV format. Choose double quotes as the+    text delimiter (default). Integral numbers will be stored without+    delimiters, and emping will use them after checking if they are+    all digits (no negatives, no fractions). Names within quotes+    should not contain special characters, only letters, possibly+    numbers and white space.</li> + </ul>+ +  <p>The reduction of the <i>Mushrooms</i> data set with <i>Class</i> as the consequent. </p>++  <p><img align="middle" src="./ugimg/Mushrooms_Class_Reds.png" alt="Mushrooms reduced rules in OO Calc" /> </p> +  +  <p>It turns out there are 21 single attribute values that determine whether a mushroom is poisonous, +  and 23 whether it is edible.  But Emping also finds all combinations of two, of three, etc.+  It is easy to verify these rules in the original data by using the Data Filter tool in OO Calc.</p>+  +  <p>The most general rules only (Tops) for a data file of zoo animals with <i>Type</i> as the consequent.</p>++  <p><img align="middle" src="./ugimg/Zoo_Type_Tops.png" border="0" alt="most general rules for zoo Type" /></p>++  <p>It turns out the 824 reduced rules all imply 9 equivalence classes. Type 1 is completely determined by +  the <i>Milk : yes</i> value only. The dependency graph for this value, however, shows some very complicated +  entailments (not shown here).</p>+  +  <p>The graph legend for a medical file of 200 audiology patients, 71 classes of symptoms+   and 24 types of diagnosis. Each patient is anonymously identified by a letter and a number.</p>++  <p><img align="middle" src="./ugimg/Audiology_Class_GLegend.png" border="0" +  alt="Audiology Class graph Legend" /></p>++  <p>Each of the 1200 nodes identifies clusters of symptoms that predict a specific diagnosis. +  The attribute graph is very large and complex, but there are distinct differences for each diagnosis.</p>++  <p>This is the value graph for <i>conductive discontinuity</i>, viewed with the +  dotty viewer and editor which comes with Graphviz. </p>+  <p><img align="middle" src="./ugimg/Conductive_discontinuity-dotty.png" border="0" +   alt="Audiology value graph conductive discontinuity" /></p>+   +   <p>The first number is the node, the second the number  of equivalences in that node. +   All graphs (for the same attribute) use the same legend.</p>+   +   <p>The situation is very different, however, for <i>cochlear age and noise</i> .</p>+   +   <p><img align="middle" src="./ugimg/cochlearageandnoise_large_zrgviewer.png" +   border="0" alt="Audiology Cochlear age and noise ZRG Viewer" /></p>++  <p>This image has been produced by ZRG Viewer, a viewer dat works with Graphviz+   and produces scaleable vector graphic (.svg) images. This is a zoom in on some nodes in the same graph.+   Using dotty or ZRG Viewer you can trace paths and analize the relations in detail.</p> +  +  <p><img align="middle" src="./ugimg/cochlearageandnoise_zoom_zrgviewer.png" +   border="0" alt="Audiology Cochlear age and noise zoom inZRG Viewer" /></p>+   +   <p>As before, the first number refers to the node in the legend, the second to the +   number of equivalent classes. To recall, each member of an equivalence class is a +   different generalization of the same original rules (rows) from the data table.</p>+   +   <p>Finally, here is the graph for <i>bellspalsy</i> ,this time in dotty again.</p>++   <p><img align="middle" src="./ugimg/bellspalsy_dotty.png" +   border="0" alt="Bellspalsy" /></p>  +   +   <p>It turns out there is only one patient with this diagnosis in the data file. This+   is p77, uniquely identified by the symptom <i>viith_nerve_signs : yes</i> . However, +   there appear to be 561 more clusters of symptoms that define this patient and diagnosis.</p>+   +  <h1>Data Files</h1>  +  +  <p>The examples shown are from the data files Zoo, Mushrooms and Audiology, +  all available at the <a href="http://archive.ics.uci.edu/ml/">UCI Machine Learning Repository</a> .+  Thanks to: Asuncion, A. &amp; Newman, D.J. (2007).   UCI Machine Learning Repository +  [http://www.ics.uci.edu/~mlearn/MLRepository.html]. +  Irvine, CA: University of California, School of Information and Computer Science.</p>++  +<h1>Notes</h1>+  <p>The Emping utility is written in Haskell, and has been developed and tested on the Fedora Core Linux platform,+  using the Haskell tools which are available as FC packages. Version 0.5 has been developed on FC8 with GHC 6.8.2+  and Gtk2Hs 0.9.12. Earlier versions of GHC will probably not compile, and Gtk2Hs versions earlier than 0.9.12 +  don't support the implemented menu fields, and will not work.+  <p>But GHC and Gtk2Hs are implemented on many platforms, including Windows and Linux versions, so+  Emping-0.5  should work on those platforms too. Open Office Calc, Graphviz and ZRGViewer (which depends+  on Graphviz) are open source and widely available.</p>+  <p>The time needed to perform a reduction or to produce a graph is hard to predict, since+  they depend on the complexity as well as the size of the data. In the examples, the shortest+  time was for the zoo animals (a few seconds) and the longest for the mushrooms attribute graph (45 minutes).</p>+  <p>The reduction should be, and appears to be, linearly proportional to the number of rules, but the+  graph building process tests each reduction against each original rule. The complexity of that is quadratic.+  The reduction time is, at least, a multiple of the number of values in the consequent class.</p>+  +  <p>Any comments, bug reports, feature requests or remarks will be+  most welcome.</p>++  <p><i>Emping</i> stands for <i>empirical reasoning</i> or the+  Indonesian snack with that name.</p>  +  +</body>+</html>
+ doc/user guide/empug-local.html~ view
@@ -0,0 +1,247 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">++<html>+<head>+  <meta name="generator" content="Bluefish 1.0.7">+  <title>Emping User Guide, Version 0.5</title>+</head>++<body bgcolor="white" text="black">+  <p align="center"></p>++  <center>+    <h1>Emping User Guide, Version 0.5</h1><font size=+    "4"><i>Author: Hans van Thiel, April 2008</i><br>+    email: hthiel.char@zonnet.nl</font>+  </center>+  +  <h1>New in Version 0.5</h1>+  <ul>+   <li>The partial order of reduced rules is now displayed as graphs in Graphviz format.</li> +   <li>Reduced rules and equivalence groups are sorted by length.</li> +   <li>The GUI has been improved.</li>  +  </ul>++  <h1>1. Overview</h1>++  <h2>1.1. What</h2>++  <p>Emping is a utility that derives heuristic rules from nominal+  data. Nominal data are qualitative and unordered, as in:</p>++  <ul>+    <li>Color: red, green, blue, yellow, black</li>++    <li>Proposition 1: True, False</li>++    <li>Class: A,B,C,D</li>+  </ul>++  <p>Class is actually an ordinal attribute, but when the order is+  disregarded, it is nominal.</p>++  <p>Heuristic rules consist of attribute values (predicates) that+  together imply another attribute value. For example:</p>++  <dl>+    <dt>Color: green and Proposition 1: True is Class: B</dt>+  </dl>++  <p>Heuristic rules are purely empirical, with no foundation in a+  theory or model. The input of Emping is just a table of nominal+  facts. The user has to select which attribute is to be the+  consequent. Then Emping derives all shortest combinations of factors which, in the+  table, imply the values of the selected consequent.</p>+  <p>Each reduced rule is a generalization of one or more original rules, and+  therefore reduced rules may imply other reduced rules or be+  equivalant to others. So the reductions are partially ordered, and this partial order+  can be shown in a directed graph.</p>++  <h2>1.2. How</h2>++  <p>Emping reads a file in a comma seperated format (.csv) as+  produced by the Open Office Calc spreadsheet, and returns the+  results as .csv files that can be read by OO Calc. The graphs are in Graphviz format, +  and can be displayed by a Graphviz reader like dotty or ZRG Viewer.</p>++  <p>Emping 0.5 has a GUI and you can start it like any other application.</p>+  <p><img align="middle" src="./ugimg/Emping.png" alt="Emping" /> </p>  ++  <p>The general idea is straightforward; see the screenshots for details. First,+  you mark or unmark in the options menu whether you want to check the data for duplicates.+  These have no effect on the result, but will slow the program down, and they are automatically removed +  if the option is selected (but not from the source file itself). If there are duplicates you+  can see which, with their frequencies, by saving them. </p>+  <p>Next you select the consequent attribute from a popup menu. If you have the relevant options menu item+  checked, emping will look for ambiguous rules for the selected consequent.</p>+  <p>Ambiguous rules are rules which are exactly the same, except for the consequent value.   For example,+  an animal name may not be uniquely determined by a given description, only a group of animals.+  So the result is indecisive for all possible subsets of this description, as well as the longer original.+  The solution is to merge these rules with a new value, which denotes the union of the ambiguous rules,+  the group.</p>+  <p>However, it is possible to leave ambiguities in the data, as they will just cancel each other out. +  But if all rules for some consequent value are ambiguous, there will be no rules at all for this value,+  and this will result in a program error which blocks Emping. (See known bugs and issues.) </p>+  <p>Therefore it is recommended to run Emping only with no duplicates and unambiguous rules, +  though you can omit the checks, if you want, at your own risk.</p>+  <p>See the white paper <i>Deriving Heuristic Rules from Facts</i> for more.</p>+  <p>Pressing the Reduce button will start the actual reduction.</p>+  <p>Reduced rules may themselves imply, or be equivalent to, other reduced rules with the same consequent value.+  The Top button will produce only the top level of these rules (saved in a .csv file).</p>+  <p>The reduced normal form file, the top level rule file and the others (if present), +  can now be loaded into OO Calc.</p>+  <p>To see the partial order in Graphviz graphs you must first get the graph legend. This file, in .csv format, +  shows the nodes in the first column and the equivalence groups it denotes in the following rows. The+  legend is useful in itself because, unlike the top level only file, it shows all reduced rules +  grouped as equals.</p>+  <p>Now you can construct the graph for all attributes and also separate graphs for each value of the attribute.+  The reverse option lets you choose between the most general at the top(default), +  or the most specific at the top (reversed).</p>++  <h1>2. Known bugs and issues</h1>+  +  <ul>+  <li>If you run Emping with no ambiguity check, and ALL rules for some consequent attribute value+  are ambiguous, the program will stall. In the mushrooms file, for example, it turns out+  that all 292 kinds of mushroom, which grow in meadows, grow somewhere else too. Therefore there +  are no rules that determine whether a mushroom grows in a meadow or not, and the reduction result+  for <i>meadows</i> (consequent attribute <i>Habitat</i> is empty. In the current version this results in+  a program error, and the main loop will go to sleep. If there are no ambiguous rules, this situation +  cannot occur; there will always be at least one rule for <i>Habitat : meadows</i> .</li>+  <li>The ambiguity check does not distinguish duplicates (equal facts) from true ambiguities +  (equal antecedent, different consequent). So, if you run the ambiguity check, run the duplicate check too.</li>+  <li>If you run the same radio button selection consequently, for example the default and the reversed+  value graph, nothing will happen. This is because the action is triggered by a change in selection.+  A workaround is to select another choice, cancel, and then select the first again.</li>+  <li>If the duplicates and ambiguities checks  finish very quickly, the appearance of the file+  chooser window blocks the status message. This could easily confuse the user, who gets no special message +  that it is the duplicates/ambiguities which will be saved, not the reductions.+  </li>  +  </ul>  ++  <h2>Some Example Screenshots</h2>++  <p>An Open Office Calc data file:</p>++  <p><img align="middle" src="./ugimg/Mushrooms_Data.png" border="0" alt=+  "Mushrooms Data in OO Calc"></p>++  <ul>+    <li>The first row must list the attribute names. It is recommended+    you give each a unique name, but you can use duplicates and blanks.+    The columns below each attribute name list the values for that attribute, possibly blanks. +    <li>Each value name has its column as its scope, so you can use values "Yes" and "No",+    for example, for different attributes.</li>++    <li>A blank value field stands for "none of the others". This feature is new to version 0.4. +    Using blanks you can now use Emping on data sets which have splits on some values. For example,+    an attribute "owns a car" can be 'yes" and 'no", and then "yes" can have fields on price range, make,+    and so on, with field "no" blank on those values. This feature has, at the time of writing,+    only be tested on small hypothetical data sets.</li>+    +    <li>You can select an attribute with blank fields as the consequent. Because a blank field+    stands for "none of the others" or "not applicable", rules with a blank consequent value+    will automatically be removed from the rule set before the reduction is applied.</li>++    <li>you can use integral numbers, like 0, 1, 3, 22 etc., but they+    will be treated as nominal values, just like A,B,C etc.</li>  ++    <li>Save the spreadsheet table in Text CSV format. Choose double quotes as the+    text delimiter (default). Integral numbers will be stored without+    delimiters, and emping will use them after checking if they are+    all digits (no negatives, no fractions). Names within quotes+    should not contain special characters, only letters, possibly+    numbers and white space.</li> + </ul>+ +  <p>The reduction of the <i>Mushrooms</i> data set with <i>Class</i> as the consequent. </p>++  <p><img align="middle" src="./ugimg/Mushrooms_Class_Reds.png" alt="Mushrooms reduced rules in OO Calc" /> </p> +  +  <p>It turns out there are 21 single attribute values that determine whether a mushroom is poisonous, +  and 23 whether it is edible.  But Emping also finds all combinations of two, of three, etc.+  It is easy to verify these rules in the original data by using the Data Filter tool in OO Calc.</p>+  +  <p>The most general rules only (Tops) for a data file of zoo animals with <i>Type</i> as the consequent.</p>++  <p><img align="middle" src="./ugimg/Zoo_Type_Tops.png" border="0" alt="most general rules for zoo Type" /></p>++  <p>It turns out the 824 reduced rules all imply 9 equivalence classes. Type 1 is completely determined by +  the <i>Milk : yes</i> value only. The dependency graph for this value, however, shows some very complicated +  entailments (not shown here).</p>+  +  <p>The graph legend for a medical file of 200 audiology patients, 71 classes of symptoms+   and 24 types of diagnosis. Each patient is anonymously identified by a letter and a number.</p>++  <p><img align="middle" src="./ugimg/Audiology_Class_GLegend.png" border="0" +  alt="Audiology Class graph Legend" /></p>++  <p>Each of the 1200 nodes identifies clusters of symptoms that predict a specific diagnosis. +  The attribute graph is very large and complex, but there are distinct differences for each diagnosis.</p>++  <p>This is the value graph for <i>conductive discontinuity</i>, viewed with the +  dotty viewer and editor which comes with Graphviz. </p>+  <p><img align="middle" src="./ugimg/Conductive_discontinuity-dotty.png" border="0" +   alt="Audiology value graph conductive discontinuity" /></p>+   +   <p>The first number is the node, the second the number  of equivalences in that node. +   All graphs (for the same attribute) use the same legend.</p>+   +   <p>The situation is very different, however, for <i>cochlear age and noise</i> .</p>+   +   <p><img align="middle" src="./ugimg/cochlearageandnoise_large_zrgviewer.png" +   border="0" alt="Audiology Cochlear age and noise ZRG Viewer" /></p>++  <p>This image has been produced by ZRG Viewer, a viewer dat works with Graphviz+   and produces scaleable vector graphic (.svg) images. This is a zoom in on some nodes in the same graph.+   Using dotty or ZRG Viewer you can trace paths and analize the relations in detail.</p> +  +  <p><img align="middle" src="./ugimg/cochlearageandnoise_zoom_zrgviewer.png" +   border="0" alt="Audiology Cochlear age and noise zoom inZRG Viewer" /></p>+   +   <p>As before, the first number refers to the node in the legend, the second to the +   number of equivalent classes. To recall, each member of an equivalence class is a +   different generalization of the same original rules (rows) from the data table.</p>+   +   <p>Finally, here is the graph for <i>bellspalsy</i> ,this time in dotty again.</p>++   <p><img align="middle" src="./ugimg/bellspalsy_dotty.png" +   border="0" alt="Bellspalsy" /></p>  +   +   <p>It turns out there is only one patient with this diagnosis in the data file. This+   is p77, uniquely identified by the symptom <i>viith_nerve_signs : yes</i> . However, +   there appear to be 561 more clusters of symptoms that define this patient and diagnosis.</p>+   +  <h1>Data Files</h1>  +  +  <p>The examples shown are from the data files Zoo, Mushrooms and Audiology, +  all available at the <a href="http://archive.ics.uci.edu/ml/">UCI Machine Learning Repository</a> .+  Thanks to: Asuncion, A. &amp; Newman, D.J. (2007).   UCI Machine Learning Repository +  [http://www.ics.uci.edu/~mlearn/MLRepository.html]. +  Irvine, CA: University of California, School of Information and Computer Science.</p>++  +<h1>Notes</h1>+  <p>The Emping utility is written in Haskell, and has been developed and tested on the Fedora Core Linux platform,+  using the Haskell tools which are available as FC packages. Version 0.5 has been developed on FC8 with GHC 6.8.2+  and Gtk2Hs 0.9.12. Earlier versions of GHC will probably not compile, and Gtk2Hs versions earlier than 0.9.12 +  don't support the implemented menu fields, and will not work.+  <p>But GHC and Gtk2Hs are implemented on many platforms, including Windows and Linux versions, so+  Emping-0.5  should work on those platforms too. Open Office Calc, Graphviz and ZRGViewer (which depends+  on Graphviz) are open source and widely available.</p>+  <p>The time needed to perform a reduction or to produce a graph is hard to predict, since+  they depend on the complexity as well as the size of the data. In the examples, the shortest+  time was for the zoo animals (a few seconds) and the longest for the mushrooms attribute graph (45 minutes).</p>+  <p>The reduction should be, and appears to be, linearly proportional to the number of rules, but the+  graph building process tests each reduction against each original rule. The complexity of that is quadratic.+  The reduction time is, at least, a multiple of the number of values in the consequent class.</p>+  +  <p>Any comments, bug reports, feature requests or remarks will be+  most welcome.</p>++  <p><i>Emping</i> stands for <i>empirical reasoning</i> or the+  Indonesian snack with that name.</p>  + +  +</body>+</html>
+ doc/user guide/ugimg/Audiology_Class_GLegend.png view

binary file changed (absent → 65774 bytes)

+ doc/user guide/ugimg/Conductive_discontinuity-dotty.png view

binary file changed (absent → 8674 bytes)

+ doc/user guide/ugimg/Emping.png view

binary file changed (absent → 11853 bytes)

+ doc/user guide/ugimg/Mushrooms_Class_Reds.png view

binary file changed (absent → 70187 bytes)

+ doc/user guide/ugimg/Mushrooms_Data.png view

binary file changed (absent → 94906 bytes)

+ doc/user guide/ugimg/Zoo_Type_Tops.png view

binary file changed (absent → 80015 bytes)

+ doc/user guide/ugimg/bellspalsy_dotty.png view

binary file changed (absent → 3740 bytes)

+ doc/user guide/ugimg/cochlearageandnoise_large_zrgviewer.png view

binary file changed (absent → 23792 bytes)

+ doc/user guide/ugimg/cochlearageandnoise_zoom_zrgviewer.png view

binary file changed (absent → 24985 bytes)

src/Abduce.hs view
@@ -1,167 +1,196 @@-{-# LANGUAGE TypeSynonymInstances #-}-{- | Emping 0.4 (provisional)--Module Abduce gets implications, including equals, between reduced antecedents with the same consequent (if present).+{- | Emping 0.5 (provisional) -Warning: because of the use of tuple type synonym RuRe as a Poset instance, the  compiler needs the  -XTypeSynonymInstances flag.+Module Abduce produces a graph of implications (equivalences in one node), between reduced antecedents with the same consequent. +Fri 04 Apr 2008 07:19:00 PM CEST  -}-module Abduce (abduceAll, cntEDAbduction)  where+module Abduce (abduceTopAll, hasDependencies, orgReg2Ndg, nodeLegend, implicGraphOne, implicGraphAll, RuRe ) where+import Aux+import Data.List ( findIndices, nubBy, nub, (\\) )+import Data.Graph.Inductive+import Control.Monad.State -import Aux ( isSub, Rule )-import Data.List ( findIndices, nubBy, partition )-import Data.Tree ( Tree(..), Forest )+--------------------------------------------------------------------------------+-- Match indices of reduced rules with indices of the original(s) which include a reduced rule --------------------------------------------- General purpose functions -----------------------------+-- | indices of original rule(s) denoted by the same reduced rule. The antecedents of the original are supersets of the reduced antecedent.+redOrgs :: [Rule] -> Rule -> [Int]+redOrgs rules red = findIndices (\x -> (fst red) `isSub` (fst x)) rules --- |tree map (fmap not accessible from Data.Tree (???)-treeMap :: (a -> b) -> Tree a -> Tree b-treeMap f (Node x ts) = Node (f x) (map (treeMap f) ts)+-- | tuples of the indices of originals and of the reduced rules for orgs and reds with same av consequent. First the originals, second the reduced rule.+redOPrs :: [Rule] -> [Rule] -> [([Int], Int)]+redOPrs rules reds = zip orixls [0..] where+           orixls = map (redOrgs rules) reds ------------------------------------------------------- | define a general partially ordere set (Poset) WITHOUT EQUALS-data Porder = HI | LW | NT deriving (Eq)+-- | define a type synonym for rule indices and reduced rule indices. First the rule indices, then the reduced indices.+type RuRe = ([Int], [Int])+-- ^ Second is a node in the graph (of equals), first determines the order. --- | define the Poset class-class (Eq a) => Poset a where-    pcompare :: a -> a -> Porder --- | put a poset in a tree, each branch is an ordered chain. Unordered elements are in the same subforest.-ins2Tree :: Poset a => a -> Tree a -> Tree a-ins2Tree x t = - case pcompare x (rootLabel t) of-    LW -> Node (rootLabel t) (ins2Forest x (subForest t))-    HI -> Node x (t:[])-    NT -> t--- | the second half of the definition-ins2Forest :: Poset a => a -> Forest a -> Forest a-ins2Forest x [] = (Node x []):[]-ins2Forest x for -  | new == for = (Node x []):for-  | otherwise = new-    where new = map (ins2Tree x) for   +-- | get all reduced rules denoting the same original (ONE). First is originals, second is reduced equals.+getEquals :: [([Int],Int)] -> ([Int],Int) -> RuRe+getEquals  y  (ols,_)=+      (ols, [snd x | x <- y, fst x == ols ]) +-- | group original-red pairs into original-equals pairs, remove doubles of original indices (maybe same but in different order)+toEquals :: [([Int],Int)] -> [RuRe]+toEquals orpl = nubBy eqOrg ls where+     ls = map (getEquals orpl) orpl+     eqOrg (x1,_) (x2,_) = isSub x1 x2 && isSub x2 x1 -isRoot :: Poset a => [a] -> a -> Bool-isRoot ls x = and $ map ((LW /=) . (x `pcompare`)) ls +-- | first original indices, second reduced rule indices, matched from original rules to reductions with the same consequent av+redOrgs2Eqs :: [Rule] -> [Rule] -> [RuRe]+redOrgs2Eqs rules reds = toEquals (redOPrs rules reds) -initRoots :: Poset a => [a] -> Forest a-initRoots ls = map mkLeaf ls where-            mkLeaf x = Node x []+-------------------------------------------------------------------------------+-- Get the implications (partially ordered through the originals they denote) -lsinFor :: Poset a => [a] -> Forest a -> Forest a-lsinFor [] for = for-lsinFor (x:xs) for = ins2Forest x (lsinFor xs for)+-- | define a partial order (WITHOUT EQUALS)+data Porder = HI | LW | NT deriving (Eq) --- | put a list of partially ordered elements in a forest-list2Forest :: Poset a => [a] -> Forest a-list2Forest ls = lsinFor res for where-                     (x,res) = partition (isRoot ls) ls -                     for = initRoots x  ------------------------------------------------------------------------------------------------------------+-- | define a comparison function for the partial order of an original rules - equal reductions (indices) pair+pcompare :: RuRe -> RuRe -> Porder+pcompare (x1, _) (x2, _)+         | isSub x2 x1 = HI+         | isSub x1 x2 = LW+         | otherwise = NT --- A: match indices of reduced rules with indices of the original(s) which include a reduced rule+---------------- Top Level Equals (no graph involved)---------------------- --- | indices of original rule(s) denoted by the same reduced rule. The antecedents are supersets of the reduced antecedent.-redOrgs :: [Rule] -> Rule -> [Int]-redOrgs rules red = findIndices (\x -> (fst red) `isSub` (fst x)) rules+-- | get the top of a RuRe pair in a list+getTp :: [RuRe] -> RuRe -> RuRe+getTp ls x = foldr cmpmax x ls where +                     cmpmax u v | pcompare u v == HI = u+                                | otherwise = v --- | tuples of the indices of originals and of the reduced rules for orgs and reds with same av consequent-redOPrs :: [Rule] -> [Rule] -> [([Int], Int)]-redOPrs rules reds = zip orixls [0..] where-           orixls = map (redOrgs rules) reds+-- | get all tops from a RuRe list+getTops :: [RuRe] -> [RuRe]+getTops ls = nub $ map (getTp ls) ls --- | get all reduced rules denoting the same original (ONE). First is originals, second is reduced equals.-getEquals :: [([Int],Int)] -> ([Int],Int) -> ([Int],[Int])-getEquals  y  (ols,_)=-      (ols, [snd x | x <- y, fst x == ols ])+-- | get the indices of the tops+eqixTops :: [Rule] -> [Rule] -> [[Int]]+eqixTops rules  reds =  map snd (getTops $ redOrgs2Eqs rules reds) +-- | replace indices of equals list with actual rule list (of reduced rules) and sort by length+srteqix2reds :: [Rule] -> [Int] -> [Rule]+srteqix2reds reds exls = sortByValNum $ map (reds !!) exls --- | group original-red pairs into original-equals pairs, remove doubles of origs, maybe same, different order-toEquals :: [([Int],Int)] -> [([Int],[Int])]-toEquals orpl = nubBy eqOrg ls where-     ls = map (getEquals orpl) orpl-     eqOrg (x1,_) (x2,_) = isSub x1 x2 && isSub x2 x1--------------------------------------------------------+-- | get the top level for the reductions of a consequent av+abduceTopOne :: [Rule] -> [Rule] -> [[Rule]]+abduceTopOne rules reds = map (srteqix2reds reds) (eqixTops rules reds) --- first orig indices, second red indices matched from rules to reds with same consequent av+srtabduceTopOne :: [Rule] -> [Rule] -> [[Rule]]+srtabduceTopOne rules = sortListEqs . (abduceTopOne rules) -redOrgs2Eqs :: [Rule] -> [Rule] -> [([Int],[Int])]-redOrgs2Eqs rules reds = toEquals (redOPrs rules reds)-------------------------------------------------------+-- | check if the top level differs in length from the reduced list. No dependencies if not.+hasEDOne :: [[Rule]] -> [Rule] -> Bool+hasEDOne tops reds | (length tops) == (length reds) = False+                   | otherwise = True --- B: show partial order, according to sublists of origs. The reds are in implication chain of orig sublists+-- | get the top levels for the reductions of all values of the consequent attribute+abduceTopAll :: [[Rule]] -> [[Rule]] -> [[[Rule]]]+abduceTopAll rulegrp redsgrp = zipWith srtabduceTopOne rulegrp redsgrp --- | define a type synonym for rule indices and reduced rule indices. First the rule indices, then the reduced indices-type RuRe = ([Int], [Int])+-- | check the top levels for all consequent values for equals and dependencies+hasDependencies :: [[[Rule]]] -> [[Rule]] -> Bool+hasDependencies topsgrp redsgrp = or $ zipWith hasEDOne topsgrp redsgrp  --- | first in orig is high, low or not ordered. GHCi needs -XTypeSynonymInstances because of this.-instance Poset RuRe where-     pcompare (x1, _) (x2, _)-              | isSub x2 x1 = HI-              | isSub x1 x2 = LW-              | otherwise = NT----------------------------------------------------+-------------------------------------------------------------------------+-------------------------------------------------------------------------+-- Build a directed graph of the implications (top down, each edge an entailment). --- | convert rules and reds for same consequent into a poset forest-redOrgs2Forest :: [Rule] -> [Rule] -> Forest RuRe-redOrgs2Forest rules reds = -          list2Forest (redOrgs2Eqs rules reds)+-- | get nodes from a list of original rules-reductions pairs (start = 1) for an av+myGetNodes :: [RuRe] -> [LNode RuRe]+myGetNodes rurls = zip [1..] rurls --- order is determined, original indices no longer needed+-- | update nodes to get a linear sequence (of nodes)+myUpdateNodes :: [LNode RuRe] -> State Node [LNode RuRe]+myUpdateNodes ndrurls = +      State (\n -> ( map (plusprior n) ndrurls , n + length ndrurls )) where+                                  plusprior x (nd, rur) = (nd + x, rur) -remOrgs :: Forest RuRe -> Forest [Int]-remOrgs for =  map (treeMap snd) for+-- | update all the nodes for an attribute, so they range from 1 to the total number.+contNodes :: [[LNode RuRe]] -> [[LNode RuRe]]+contNodes ndgrls = evalState (mapM myUpdateNodes ndgrls) 0 --- produces the partial order of reduceds, with--- indices of equals in one list (rules WITH cons)+-- | get labeled nodes from original rules and reductions+rr2Nds :: [Rule] -> [Rule] -> [LNode RuRe]+rr2Nds rules reds = myGetNodes $ redOrgs2Eqs rules reds  -reds2EqsFor :: [Rule] -> [Rule] -> Forest [Int]-reds2EqsFor rules reds = -              remOrgs (redOrgs2Forest rules reds)+-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-- | get labeled nodes from rulegroup and reduction group. THIS is the BASE for all graphs.+orgReg2Ndg :: [[Rule]] -> [[Rule]] -> [[LNode RuRe]]+orgReg2Ndg  rulegrp redgrp = contNodes (zipWith rr2Nds rulegrp redgrp)+-----------------------------------------------------------------------------------+----------------------------------------------------------------------------------- --- replace indices list with rule list (of equals)+-- | nodes with reduced reduction equivalences (reds are the reductions for an av)+nodesWRls :: [Rule] -> [LNode RuRe] -> [LNode [Rule]]+nodesWRls reds rurls = map getrule rurls where +                          getrule (nod, (_,re)) = (nod, srteqix2reds reds re) -eqix2reds :: [Rule] -> [Int] -> [Rule]-eqix2reds reds exls = map (reds !!) exls+-- | get nodes with the indices of the reduction equivalences+nodeLegend :: [[Rule]] -> [[LNode RuRe]] -> [LNode [Rule]]+nodeLegend redsgrp nodegrp = concat $ zipWith nodesWRls redsgrp nodegrp --- | from a list of original rules and their reductions, get the partial order of the reductions (with the consequent)-abd1Val :: [Rule] -> [Rule] -> Forest [Rule]-abd1Val rules reds = map trmf for where-               trmf = treeMap (eqix2reds reds)-               for = reds2EqsFor rules reds-------------------------------------------------------+------------------- get the edges from a list of LNode RuRe -------------- --- | abduce all reductions for a selected attribute-abduceAll :: [[Rule]] -> [[Rule]] -> [ Forest [Rule] ]-abduceAll rulegrp redsgrp = zipWith abd1Val rulegrp redsgrp+-- | just like getTp, but with nodes (functor here?)+getNdTp :: [LNode RuRe] -> LNode RuRe -> LNode RuRe+getNdTp nodls nod =  +      foldr ndcmpmax nod nodls where +                   ndcmpmax (nd1,x) (nd2,y) | pcompare x y == HI = (nd1,x)+                                            | otherwise = (nd2,y) --------------------------------------------------------+-- | get the top level from a node list (just like getTops)+getNodeTops :: [LNode RuRe] -> [LNode RuRe]+getNodeTops ndls = nub $ map (getNdTp ndls) ndls ---------------------------------------- Functions on a Tree of Rules --------------------------------+-- | split a RuRe list into levels, each level the top of the next lower.+getNodeLevels :: [LNode RuRe] -> [[LNode RuRe]]+getNodeLevels [] = []+getNodeLevels nodls = (getNodeTops nodls):(getNodeLevels $ (nodls \\ (getNodeTops nodls))) --- | check whether a tree contains equals or dependencies-treehasED :: Tree [Rule] -> Bool-treehasED t | length (rootLabel t) == 1 -              && subForest t == [] = False-            | otherwise = True+-- | get the edges from a top node to the next lower level+myGtUEdge :: [LNode RuRe] ->  LNode RuRe-> [UEdge]+myGtUEdge lvs tn = zip3 src trgt etyp where+                    src = replicate (length lvs) (fst tn)+                    trgt = map fst rurls+                    etyp = replicate (length lvs) ()+                    rurls = filter (nodecompare tn)  lvs+                    nodecompare (_,x) (_,y) = (pcompare x y) == HI --- | count equals and dependencies  forest. The first is the number of chains (including equals), the second the  number of singles.-cntEDVal :: Forest [Rule] -> (Int,Int)-cntEDVal for = (dep, single) where -       dep = sum $ fst (unzip temp) -       single = sum $ snd (unzip temp) -       temp = map (mark . treehasED) for  -       mark x | x == True = (1,0)-              | otherwise = (0,1) +-- | get the edges from a top level to a lower level (the next)+topUEdges :: [LNode RuRe] -> [LNode RuRe] -> [UEdge]+topUEdges lv1 lv2 = concatMap (myGtUEdge lv2) lv1 --- | count equals or dependencies in attribute abduction. The first is the ED count, the second is the number of single (unconnected) rules.-cntEDAbduction ::  [Forest [Rule] ] -> (Int,Int)-cntEDAbduction forls = (dep, uncon) where-             dep = sum $ fst (unzip temp)-             uncon = sum $ snd (unzip temp) -             temp = map cntEDVal forls------------------------------------------------------------------------------------------------------+-- | get all edges from a level list. Case of only one level returns []+allLevelUEdges :: [[LNode RuRe]] -> [UEdge]+allLevelUEdges [] = error "Abduce allLevelUEdges: list is empty"+allLevelUEdges (_:[]) = []+allLevelUEdges (x:y:ys) = (topUEdges x y) ++ (allLevelUEdges (y:ys))++-- | from a list of nodes, get the corresponding edges+myGetUEdges :: [LNode RuRe] -> [UEdge]+myGetUEdges = allLevelUEdges . getNodeLevels++-- | replace the RuRe with the length of the equivalence list+disrure :: [LNode RuRe] -> [LNode (Int,Int)]+disrure  nodls = map rur2ln nodls where+                          rur2ln (nd, (_ , redidls)) = (nd, (nd, (length redidls))) ++-- | make a graph of a node list+implicGraphOne :: [LNode RuRe] -> Gr (Int,Int) ()+implicGraphOne nodelist =  mkGraph nds edgs where+                                         nds = disrure nodelist+                                         edgs = myGetUEdges nodelist+                                      +-- | make a graph of the group of node lists+implicGraphAll :: [[LNode RuRe]] -> Gr (Int,Int) ()+implicGraphAll nodegroup = mkGraph nds edgs where+                                       nds = disrure $ concat nodegroup+                                       edgs = concatMap myGetUEdges nodegroup+ 
src/Aux.hs view
@@ -1,10 +1,12 @@-{- | Emping 0.4 (provisional)+{- | Emping 0.5 (provisional)  Module Aux provides some general purpose functions, which are used by other modules.++Fri 04 Apr 2008 07:20:22 PM CEST  -} module Aux where -import Data.List ( partition )+import Data.List ( partition, sortBy )  -- | AVp is the type of an attribute-value tuple. type AVp = (Int, Int)@@ -39,4 +41,22 @@ partitionBy _ [] = [] partitionBy eq ls = x:(partitionBy eq y)  where                    (x,y) = partition ((head ls) `eq`) ls ++-- | sort a list of (reduced) rules according to antecedent length, shortest antecedents first+sortByValNum :: [Rule] -> [Rule]+sortByValNum (x:[]) = [x]  -- only one rule in list (usually equivalence list)+sortByValNum rls = sortBy lengthcmp rls where +                     lengthcmp (x,_) (y,_)  | (length x) > (length y) = GT+                                            | (length x) == (length y) = EQ+                                            | otherwise = LT++-- | sort a list of SORTED equivalence classes. Then head is always shortest. +sortListEqs :: [[Rule]] -> [[Rule]]+sortListEqs equivls = sortBy eqvcmp equivls where+                     eqvcmp  x y | (myln x) > (myln y) = GT+                                 | (myln x) == (myln y) = EQ+                                 | otherwise = LT+                     myln = length . fst . head++ 
src/CSVParse.hs view
@@ -1,10 +1,12 @@-{- | Emping 0.4  (provisional)+{- | Emping 0.4, 0.5 (provisional)  Module CSVParse converts a table in Open Office Calc .csv format into a list of lists of Haskell Strings.The first row in the table must consist of the attribute names. It is recommended that all attributes have unique names, but blanks and doubles are allowed. Each attribute will be identified by its column number.  The rows after the first must be attribute values. Values in different columns may have the same names or be blank. Values in the same column with the same names are considered to be equal. Emping will generate a list of values for each column.  Warning: if you use blank fields in the table, be sure they are correctly seperated by comma's and that each row is correctly terminated by a newline.++Fri 04 Apr 2008 07:17:12 PM CEST  -} module CSVParse ( getTable , blankId  ) where 
src/CSVTable.hs view
@@ -1,15 +1,17 @@-{- | Emping 0.4 (provisional)+{- | Emping 0.5 (provisional) -Module CSVTable converts results to a CSV format that can be read by Open Office Calc+Module CSVTable converts results to a CSV format that can be read by Open Office Calc +and a rule graph to .dot format that can be read by a Graphviz viewer.++Fri 04 Apr 2008 07:19:30 PM CEST  -}-module CSVTable ( allDup2CSVTb , allAmb2CSVTb, rnf2CSVTb, allAbd2CSVTb, topAbd2CSVTb ) where+module CSVTable ( allDup2CSVTb , allAmb2CSVTb, rnf2CSVTb, allTops2CSVTb, allNodes2CSVTb, graph2DOT ) where  import Data.Char (isDigit ) import Data.Array-import Data.Tree ( Tree(..), Forest )+import Data.Graph.Inductive import Aux (AVp, Ant, Rule) import CSVParse (blankId)---import Data.Tree ( Tree(..), Forest )  -- | check whether a string is a number or text allDigit :: String -> Bool@@ -161,15 +163,7 @@          ambstr = ambgrp2CSV attvarr ambgrp ---------------------------------------------------------- --- ------------------------------------ The  .csv output of abductions ------------------------- | A general function to get the branches of a tree. Only used here, but could as well be in Aux.--brTree :: Tree a -> [[a]]-brTree (Node x []) = [[x]]-brTree (Node x for) = map (x:) brls where-                          brls = concatMap brTree for----------------------------------------------------------------------------------------+-- ------------------------------------ The  .csv output of top level abductions ---------------------  -- | show the antecedent as a .csv string. Analogous to red2CSV, but without extras for the consequent ant2CSV :: Array Int (String,[String]) -> [Int] -> Rule -> String@@ -186,64 +180,70 @@             foldr1 (inSep ",\"equals\"\n") strls where                strls = map (ant2CSV attvarr attls) eqls  --- | show a chain of equals in .csv format.+-- | append the consequent value, 2 newlines for readability.+eqsWCons2CSV :: Array Int (String, [String]) -> [Int] -> [Rule] -> String+eqsWCons2CSV attvarr attls eqls = (eqs2CSV attvarr attls eqls)+                                   ++ ",\" is \","+                                   ++ (showValue attvarr ( snd (head eqls)))+                                   ++ "\n\n" -chain2CSV :: Array Int (String,[String]) -> [Int] -> [[Rule]] -> String-chain2CSV attvarr attls chain- | length chain == 1 = eqs2CSV attvarr attls (head chain)- | otherwise = foldr1 (inSep ",\"implies\"\n") strls where-                 strls = map (eqs2CSV attvarr attls ) chain+-- convert all rule equivalences in a top level for a consequent+tops2CSV :: Array Int (String, [String]) -> [Int] -> [[Rule]] -> String+tops2CSV attvarr attls abdtops = concatMap (eqsWCons2CSV attvarr attls) abdtops --- | show a chain of implications, including equals, in .csv format. -ruleChain2CSV :: Array Int (String,[String]) -> [Int] -> [[Rule]] ->  String-ruleChain2CSV attvarr attls chain  = (chain2CSV attvarr attls chain) -                                      ++ ",\" is \","-                                      ++ (showValue attvarr ( snd (head (head chain))))-                                      ++ "\n\n"+-- convert all rule equivalences to .csv for all the top level abductions+allTops2CSV :: Array Int (String, [String]) -> [Int] -> [[[Rule]]] -> String+allTops2CSV attvarr attls topsgrp = concatMap (tops2CSV attvarr attls) topsgrp --- | show a tree in .csv format. Warning: reverse is needed to get the most general rule at the end.-tree2CSV :: Array Int (String,[String]) -> [Int] -> Tree [Rule] -> String-tree2CSV attvarr attls t = -     concatMap (ruleChain2CSV attvarr attls) chains where  chains = map reverse (brTree t)+-------------------------------------------------------------+-- | transform the abduction result to .csv table with header+allTops2CSVTb :: Array Int (String,[String]) -> [[Rule]] -> [[[Rule]]] -> String+allTops2CSVTb attvarr origs topsgrp = +       (hdr2CSV attvarr guide) ++ allTops2CSV attvarr (fst guide) topsgrp where  guide = displayGuide (head (head origs)) --- | a forest of abduction trees to .csv format-forest2CSV :: Array Int (String,[String]) -> [Int] -> Forest [Rule] -> String-forest2CSV attvarr attls for = -    concatMap (tree2CSV attvarr attls) for--------------------------------------------------------- | abduction result to .csv format-allAbds2CSV :: Array Int (String,[String]) -> [Int] -> [Forest [Rule]]-> String-allAbds2CSV attvarr attls abdgrp =-    concatMap (forest2CSV attvarr attls) abdgrp+---------------------------- Graph Legend to .csv ------------------------ -------------------------------------------------------- | transform the abduction result to .csv table with header +-- | display a list of equals in .csv, but allow for the first column to be empty, for any antecedent AFTER the first+nods2CSV :: Array Int (String,[String]) -> [Int] -> [Rule] -> String+nods2CSV  attvarr attls eqls +        | length eqls == 1 = fstline            +        | otherwise = foldr1 (inSep ",\"equals\"\n") strls+        where fstline = ant2CSV attvarr attls (head eqls)+              strls = fstline:(map foline (tail eqls))+              foline x = ',': (ant2CSV attvarr attls x) -allAbd2CSVTb :: Array Int (String,[String]) -> [[Rule]] -> [Forest [Rule]] -> String-allAbd2CSVTb attvarr origs abdgrp = (hdr2CSV attvarr guide) -                                  ++ allAbds2CSV attvarr (fst guide) abdgrp where guide = displayGuide (head (head origs))+-- | exactly like eqsWCons2CSV+nodsWCons2CSV :: Array Int (String, [String]) -> [Int] -> [Rule] -> String+nodsWCons2CSV attvarr attls eqls = (nods2CSV attvarr attls eqls)+                                   ++ ",\" is \","+                                   ++ (showValue attvarr ( snd (head eqls)))+                                   ++ "\n\n" ------------------------------------------- Top level abductions only ----------------------------------+-- | put the node in front of the equals with cons+lnode2CSV :: Array Int (String,[String]) -> [Int] -> LNode [Rule] -> String+lnode2CSV attvarr attls (nd,eqls) = +    ((toCalc .show) nd) ++ "," ++ (nodsWCons2CSV attvarr attls eqls) --- | get a .csv string of (possibly equals) from the top only of a tree, including the consequent-topTree2CSV :: Array Int (String,[String]) -> [Int] -> Tree [Rule] -> String-topTree2CSV attvarr guide t =   let eqls = rootLabel t-                                in  (eqs2CSV attvarr guide eqls)-                                    ++ ",\" is \","-                                    ++ (showValue attvarr (snd (head eqls)))-                                    ++ "\n\n"   +-- | get all nodes from a graph legend+allNodes2CSV :: Array Int (String,[String]) -> [Int] -> [LNode [Rule]] -> String+allNodes2CSV attvarr attls legend = concatMap (lnode2CSV attvarr attls) legend --- | do it for the forest-topForest2CSV :: Array Int (String,[String]) -> [Int] -> Forest [Rule] -> String-topForest2CSV attvarr guide for = concatMap (topTree2CSV attvarr guide) for+-- | prepend the header with Node in the first column+allNodes2CSVTb :: Array Int (String,[String]) -> [[Rule]] -> [LNode [Rule]] -> String+allNodes2CSVTb attvarr origs legend =  +            (toCalc "Node") +             ++ ","+             ++ (hdr2CSV attvarr guide)+             ++ (allNodes2CSV attvarr (fst guide) legend )  where guide = displayGuide (head (head origs)) --- | do it for all abductions-topAbds2CSV :: Array Int (String,[String]) -> [Int] -> [Forest [Rule]]-> String-topAbds2CSV attvarr guide abdgrp = concatMap (topForest2CSV attvarr guide) abdgrp+------------------------ transform a graph to .dot format ---------------------------------- --- | add the header to the .csv table as with allAbd2CSVTb.  -topAbd2CSVTb :: Array Int (String,[String]) -> [[Rule]] -> [Forest [Rule]] -> String-topAbd2CSVTb attvarr origs abdgrp = (hdr2CSV attvarr guide) -                                     ++ topAbds2CSV attvarr (fst guide) abdgrp where guide = displayGuide (head (head origs))---------------------------------------------------------------------------------------------------------------------------+-- | use the graphviz function with defaults. Page matrix is sqrt of number of nodes. +--   Page is smallest of A4 and US Letter. Specific graph type used, not class.+graph2DOT :: Gr (Int,Int) () -> String -> String+graph2DOT graph name = +    graphviz graph name (8.3,11.0) (pgn,pgn) Portrait where+                       pgn = 1 + (round . sqrt . (/ nodpp) . fromIntegral) (noNodes graph)+                       nodpp = 50+ 
src/Codec.hs view
@@ -1,8 +1,10 @@-{- | Emping 0.4 (provisional)+{- | Emping 0.4, 0.5 (provisional)   Module Codec transforms a list of lists of String attributes and values into a list of lists of Int tuples. The first list of Strings must be the attribute names (may contain blankId), the following lists must contain attribute values or blankId.   The module also provides an Array to display the names of coded attributes and values, and functions to deal with table rows that are equal (duplicates). ++Fri 04 Apr 2008 07:17:45 PM CEST  -} module Codec (tableCode, tableToArray, partDups, checkNoDups, factsDups, factsUniques ) where 
src/Main.hs view
@@ -1,25 +1,29 @@ {- | Module Main -Emping 0.4 (provisional)+Emping 0.5 (provisional)  Module Main performs the GUI and I\/O tasks for the reduction of heuristic rules. The input consists of facts -in a comma separated file (.csv) format as produced by the Open Office Calc spreadsheet. The output is in the same-format and can be read by OO Calc.+in a comma separated file (.csv) format as produced by the Open Office Calc spreadsheet. The rule output is in the same+format and can be read by OO Calc. Dependencies between reduced rules may be shown as a graph in .dot format, which can+be viewed with a GraphViz viewer like dotty or gzviewer.  The user can open a .csv file, select an attribute which is to be the consequent, and Emping will find all shortest rules-which predict the values of the selected attribute. Some rules, which imply a consequent value, may be interdependent, and-the user can save all such implications and equivalences, or just the top level.+which predict the values of the selected attribute.   The user can set whether the facts will be checked for duplicates, and for ambiguous rules (those with the same -antecedent but a different consequent).+antecedent but a different consequent). Graph may be displayed as entailments (top down) or implications (the reversed graph).  See the white paper \"Deriving Heuristic Rules from Facts\" (January 2007) for more on the foundation and algorithm.--} -module Main where+Wed 16 Apr 2008 01:14:12 PM CEST   +-}++module Main (main) where import Graphics.UI.Gtk+import Control.Concurrent import Data.IORef import Data.Array+import Data.Graph.Inductive import Aux import CSVParse import Codec@@ -30,6 +34,7 @@ main :: IO () main = do   initGUI+  timeoutAddFull (yield >> return True) priorityDefaultIdle 50   window <- windowNew   set window [windowTitle := "Emping",  windowDefaultWidth := 400,               windowDefaultHeight := 100]@@ -40,32 +45,24 @@   options <- actionNew "OptionMenu" "Options" (Just "Check for duplicates and ambiguities") (Just stockProperties)   selcons <- actionNew "SelCons" "Consequent" (Just "Select the attribute which will be the rule consequent") (Just stockNew)   reduact <- actionNew "ReduAct" "Reduce" (Just "Get the reduced normal form of the rules") (Just stockConvert)-  abducem <- actionNew "AbduceMenu" "Abduce" (Just "Get implications of reduced rules") (Just stockSortAscending)   abdutop <- actionNew "AbduTop" "Top" (Just "Get only the top level of all implications")  (Just stockGotoTop)-  abduall <- actionNew "AbduAll" "All" (Just "Get all implications from the abduction")  (Just stockGotoBottom)   filemen <- actionNew "FileMenu" "File" (Just "Open and exit") (Just stockFile)   quitact <- actionNew "QuitAct" "Quit" Nothing (Just stockQuit)+  grphmen <- actionNew "GrphMen" "Rule Graphs" (Just "Display rule graphs or legend") (Just stockGotoBottom)+  attgrph <- actionNew "AttGrph" "Attribute" (Just "Get the graph of implications for the attribute") (Just stockZoom100)+  valgrph <- actionNew "ValGrph" "Per Value" (Just "Get the graph of implications for an attribute value") (Just stockZoomIn)+  glegend <- actionNew "GleGend" "Legend" (Just "Legend of all nodes in the implication graph") (Just stockUnderline) -  dupcheck <- newIORef True   -- workaround for bug in ToggleActionEntry: user changing checkbox has no effect on toggleActionIsActive field-  ambcheck <- newIORef True+  duptogg <- toggleActionNew "DupCheck" "Check Data" (Just "Check facts for duplicates") Nothing+  ambtogg <- toggleActionNew "AmbCheck" "Check Rules" (Just "Check rules for ambiguity") Nothing+  revtogg <- toggleActionNew "RevGraph" "Reverse" (Just "Get the graphs in reverse direction") Nothing -  let duptogg = ToggleActionEntry "DupCheck" "Check Data" (Just stockConvert) Nothing -                                   (Just "Check facts for duplicates") (myTog dupcheck) True-      ambtogg = ToggleActionEntry "AmbCheck" "Check Rules" (Just stockInfo) Nothing -                                   (Just "Check rules for ambiguity") (myTog ambcheck) True +  toggleActionSetActive duptogg True                                   +  toggleActionSetActive ambtogg True    actgrp <- actionGroupNew "ActGrp"-  actionGroupAddAction actgrp opensrc-  actionGroupAddAction actgrp options-  actionGroupAddToggleActions actgrp [duptogg, ambtogg]-  actionGroupAddAction actgrp selcons-  actionGroupAddAction actgrp reduact-  actionGroupAddAction actgrp abducem-  actionGroupAddAction actgrp abdutop  -  actionGroupAddAction actgrp abduall-  actionGroupAddAction actgrp filemen-  actionGroupAddAction actgrp quitact-+  mapM_ (actionGroupAddAction actgrp) [opensrc,options,selcons,reduact,abdutop,filemen,quitact,grphmen,attgrph,valgrph,glegend]+  mapM_ (actionGroupAddAction actgrp) [duptogg,ambtogg,revtogg]    manager <- uiManagerNew   uiManagerAddUiFromString manager uiDecl@@ -89,125 +86,244 @@   filesrc <- fileChooserDialogNew   (Just "Source File in CSV") (Just window)                                      FileChooserActionOpen                                      [("Cancel", ResponseCancel), ("Open", ResponseAccept)]-  filesave <- fileChooserDialogNew  (Just "Save .csv File") (Just window)+  filesave <- fileChooserDialogNew  (Just "Save File") (Just window)                                      FileChooserActionSave-                                     [("Cancel", ResponseCancel), ("Save (.csv)", ResponseAccept)]+                                     [("Cancel", ResponseCancel), ("Save", ResponseAccept)]   fileChooserSetDoOverwriteConfirmation filesave True --   csvfilt <- fileFilterNew   fileFilterAddPattern csvfilt "*.csv"   fileFilterSetName csvfilt "CSV Source"      fileChooserAddFilter filesrc csvfilt -  onActionActivate opensrc $ -        do  mbf1 <- mygetFileName filesrc-            case mbf1 of-                 { Just fpath1 -> do { -- user has selected a source file--- start selection of  consequent-  strl <- getTable fpath1-  ; let facts = tableCode strl-        namearray = tableToArray strl-  ; singlefacts <- getNoDuplicates dupcheck filesave status gencontext namearray facts+  attpopman <- uiManagerNew  +  attpopgrp <- actionGroupNew "Popup Att Select" -  ;let choice = map (\ind -> (RadioActionEntry (show ind) (fst (namearray ! ind)) Nothing Nothing Nothing ind)) (indices namearray)+  valpopman <- uiManagerNew+  valpopgr <- actionGroupNew "Popup Value Select"++  mapM_ ((flip actionSetSensitive) False) [selcons, reduact,abdutop,attgrph,valgrph,glegend]++  mvrNameArray <- newEmptyMVar+  mvrSingleFacts <- newEmptyMVar+  mvrSelCons <- newEmptyMVar+  mvrRules <- newEmptyMVar+  mvrReductions <- newEmptyMVar+  mvrNodeGroup <- newEmptyMVar+  mvrValPopup <- newEmptyMVar++  hasValPopup <- newIORef False ++  onActionActivate opensrc $ do  +       mbf1 <- mygetFileName filesrc+       case mbf1 of+            Nothing -> return () +            Just fpath1 ->  do { statusbarPush status gencontext "Reading and parsing source..."+                                 ;forkIO $ do {                        +                       ;strl <- getTable fpath1 +                       ;let stfacts = tableCode strl+                            stnamearray = tableToArray strl  +                       ;stsinglefacts <- getNoDuplicates duptogg filesave status gencontext stnamearray stfacts ++                       ;putMVar mvrNameArray stnamearray+                       ;putMVar mvrSingleFacts stsinglefacts +                       ;actionSetSensitive selcons True +                                               } +                                 ;actionSetSensitive opensrc False++                               }                               +                     +  onActionActivate selcons $ do {+     slnamearray <- readMVar mvrNameArray+     ;singlefacts <- readMVar mvrSingleFacts++     ;let choice = map (\ind -> (RadioActionEntry (show ind) (fst (slnamearray ! ind)) Nothing Nothing Nothing ind)) (indices slnamearray) -- dummy because of radioActionGetCurrentValue and RadioActionEntry. Selection of already selected does nothing.-       dummy = [RadioActionEntry (show lst) "None" Nothing Nothing Nothing lst] where lst = length (indices namearray)-       dumchoice = concat [choice,dummy]-       popmstr = "<ui><popup>" ++ (concatMap itstr dumchoice) ++ "</popup></ui>"-       itstr  x = "<menuitem action=\"" ++ (radioActionName x) ++ "\" />"+          dummy = [RadioActionEntry (show lst) "None" Nothing Nothing Nothing lst] where lst = length (indices slnamearray)+          dumchoice = concat [choice,dummy]+          popmstr = "<ui><popup>" ++ (concatMap itstr dumchoice) ++ "</popup></ui>"+          itstr  x = "<menuitem action=\"" ++ (radioActionName x) ++ "\" />"   +          myChange ra = do {  cons <- radioActionGetCurrentValue ra+                              ;let consname = (fst (slnamearray ! cons))+                              ;statusbarPush status gencontext ("The consequent attribute is: " ++ consname)+                              ;let rules = facts2Rules cons singlefacts+                              ;noamb <- noAmbiguities ambtogg filesave status gencontext slnamearray cons rules+                              ;if noamb then do { putMVar mvrSelCons cons+                                                  ;putMVar mvrRules rules -       myChange ra = do  { -- start reduction with selected consequent-           cons <- radioActionGetCurrentValue ra-           ;let consname = (fst (namearray ! cons))-           ;statusbarPush status gencontext ("The consequent attribute is: " ++ consname)           -           ;let rules = facts2Rules cons singlefacts-           ;saveAmbiguities ambcheck filesave status gencontext namearray cons rules-           ;let reductions = reduceAll rules-           ;onActionActivate reduact $ do { -- start activate reduction-            ;mbf2 <- mygetFileName filesave-            ;case mbf2 of -                  Just fpath2 -> do { -- start save reduction-                                     statusbarPush status gencontext "Starting reduction, this may take a while..."-                                    ;writeFile fpath2 (rnf2CSVTb namearray rules reductions)-                                    ;statusbarPush status gencontext ("Finished reduction for " ++ consname)-                                    ;return () -                                    } -- end save reduction-                  Nothing -> return ()-            ;let abductions = abduceAll rules reductions -                 (deptreenum, singlenum) = cntEDAbduction abductions-            ;if deptreenum == 0 then do  { statusbarPush status gencontext ("There are no dependencies in reductions for " ++ consname)-                                           ;return ()-                                         }-                                else do {   -- start:there are dependencies-                ;onActionActivate abdutop $ do { -- start activat abdutop-                             mbf3 <- mygetFileName filesave-                            ;case mbf3 of -                                  Just fpath3 ->  writeFile fpath3 (topAbd2CSVTb namearray rules abductions)-                                  Nothing -> return ()-                                              }  -- end activate abdutop-                ;onActionActivate abduall $ do { -- start activat abduall-                              mbf4 <- mygetFileName filesave-                             ;case mbf4 of-                                   Just fpath4 ->  writeFile fpath4 (allAbd2CSVTb namearray rules abductions)-                                   Nothing -> return ()-                                               }  -- end activate abduall-                ;return ()-                                       } -- end: there are dependencies-                 ;statusbarPush status gencontext ( consname ++ ":"-                                                    ++ " Dependency Trees: " -                                                    ++ (show deptreenum)-                                                    ++ ", Unconnected Rules: "-                                                    ++ (show singlenum))-                 ;return ()+                                                  ;actionSetSensitive selcons False+                                                  ;actionSetSensitive reduact True+                                                 }+                                        else return ()+                             }    +    ;uiManagerInsertActionGroup attpopman attpopgrp 0     +    ;actionGroupAddRadioActions attpopgrp dumchoice ((length dumchoice) -1)  myChange   +    ;uiManagerAddUiFromString attpopman popmstr -                                        } -- end activate reduction-           ; return ()-                         } -- end myChange+    ;mbpopup <- uiManagerGetWidget attpopman "/ui/popup"+    ;let attpopup = case mbpopup of+                             Nothing -> error "Main: no popup menu for consequent attribute selection"+                             Just x -> x  +    ;menuPopup (castToMenu attpopup) Nothing   -   ;popgrp <- actionGroupNew "Popup Att Select"--- bug in RadioActionEntry: regardless of the Int, the last is always displayed as initially selected-   ;actionGroupAddRadioActions popgrp dumchoice ((length dumchoice) -1)  myChange+    ;return ()+                                }               -   ;popman <- uiManagerNew-   ;uiManagerAddUiFromString popman popmstr-   ;uiManagerInsertActionGroup popman popgrp 0+  onActionActivate reduact $ do                 +       mbf2 <- mygetFileName filesave+       case mbf2 of+            Nothing -> return () +            Just fpath2 ->  do { statusbarPush status gencontext "Reducing rules, this may take a while..."+                                 ;forkIO $ do {  -   ;mbpopup <- uiManagerGetWidget popman "/ui/popup"-   ;let popup = case mbpopup of-                    Nothing -> error "Main: no popup menu for consequent attribute selection"-                    Just x -> x+                       rdnamearray <- readMVar mvrNameArray+                       ;rdrules <- readMVar mvrRules +                       ;rdcons <- readMVar mvrSelCons +  +                       ;let rdconsname = (fst (rdnamearray ! rdcons))+                            reductions = reduceAll rdrules+                       +                       ;writeFile fpath2 (rnf2CSVTb rdnamearray rdrules reductions)+                       ;statusbarPush status gencontext ("Finished reduction for " ++ rdconsname) -  ;onActionActivate selcons $ do {-    menuPopup (castToMenu popup) Nothing-   ; return ()-                                } -- part when user selected a consequent ends here-  ; return ()-                                                            } -- part when user selected a source file ends here-                 ;Nothing -> return ()  -                           } -- end of case for source file opening (user does not accept)+                       ;putMVar mvrReductions reductions +                       ;actionSetSensitive abdutop True+                       ;actionSetSensitive glegend True+                                              } +                                ;actionSetSensitive reduact False  +                               } ++  onActionActivate abdutop $ do +       mbf3 <- mygetFileName filesave+       case mbf3 of +            Nothing -> return ()+            Just  fpath3 ->  do { statusbarPush status gencontext "Checking for rule dependencies.."+                                  ;forkIO $ do {+                       abnamearray <- readMVar mvrNameArray+                       ;abrules <- readMVar mvrRules +                       ;abcons <- readMVar mvrSelCons+                       ;abreductions <- readMVar mvrReductions + +                       ;let abconsname = (fst (abnamearray ! abcons))                     +                            topsgroup = abduceTopAll abrules abreductions +                       ;if not (hasDependencies topsgroup abreductions)  then do +                                  { statusbarPush status gencontext ("There are no dependencies in reductions for " ++ abconsname)+                                    ;actionSetSensitive abdutop False+                                  } +                                                                         else do {   +                       writeFile fpath3 (allTops2CSVTb abnamearray abrules topsgroup)+                       ;statusbarPush status gencontext ("Saved most general reductions for " ++ abconsname)                   +                       ;return ()                                                          +                                                                                 }+                                              }+                                  ;actionSetSensitive abdutop False+                                } + +  onActionActivate glegend $ do                         +       mbf4 <- mygetFileName filesave+       ;case mbf4 of +             Nothing -> return ()+             Just fpath4 -> do { forkIO $ do {+                       glnamearray <- readMVar mvrNameArray+                       ;glcons <- readMVar mvrSelCons+                       ;glrules <- readMVar mvrRules +                       ;glreductions <- readMVar mvrReductions ++                       ;let glconsname = (fst (glnamearray ! glcons)) +                            nodegroup = orgReg2Ndg glrules glreductions  +                       ;statusbarPush status gencontext "Getting graph legend, this may take a while..."+                       ;let graphlegend = nodeLegend glreductions nodegroup+                       ;writeFile fpath4 (allNodes2CSVTb glnamearray glrules graphlegend)+                       ;statusbarPush status gencontext ("Saved graph legend for " ++ glconsname)++                       ;putMVar mvrNodeGroup nodegroup+                                              }+                                  ;actionSetSensitive attgrph True +                                  ;actionSetSensitive valgrph True+                                  ;actionSetSensitive glegend False                               +                                }  ++  onActionActivate attgrph $ do  +       mbf5 <- mygetFileName filesave+       case mbf5 of+            Nothing -> return ()  +            Just fpath5 -> do { statusbarPush status gencontext "Building rule dependency graph..."+                                ;forkIO $ do  {+                       agnamearray <- readMVar mvrNameArray+                       ;agcons <- readMVar mvrSelCons+                       ;agnodegroup <- readMVar mvrNodeGroup++                       ;let agconsname = (fst (agnamearray ! agcons)) +                       ;revset <- get revtogg toggleActionActive+                       ;let fullgraph = implicGraphAll agnodegroup                                                     +                            displaygraph | revset =  grev fullgraph+                                         | otherwise = fullgraph+                       ;writeFile fpath5 (graph2DOT displaygraph agconsname)+                       ;statusbarPush status gencontext ("Saved rule dependency graph for " ++ agconsname)+                       ;return ()+                                             }+                                  ;return ()                                         +                                } ++  onActionActivate valgrph $ do { ppres <- readIORef hasValPopup+                                  ;if ppres then return ()+                                            else do {+    vgnamearray <- readMVar mvrNameArray+    ;vgcons <- readMVar mvrSelCons+    ;vgnodegroup <- readMVar mvrNodeGroup++    ;let grphvalues = snd (vgnamearray ! vgcons) -- define the value menu for valgrph here+         valindices = [0..((length grphvalues)-1)]+         valchoice = map (\ind -> (RadioActionEntry (show ind) (grphvalues !! ind) Nothing Nothing Nothing ind)) valindices+-- dummy value, as with selcons+         valdummy = [RadioActionEntry (show lst) "None" Nothing Nothing Nothing lst] where lst = length valindices+         valdumchoice = concat [valchoice,valdummy]+         valpopmstr = "<ui><popup>" ++ (concatMap vitstr valdumchoice) ++ "</popup></ui>"     -- itstr defined above+         vitstr  x = "<menuitem action=\"" ++ (radioActionName x) ++ "\" />" +    ;actionGroupAddRadioActions valpopgr valdumchoice ((length valdumchoice) -1) +                                       (myValChange vgnodegroup filesave status gencontext vgnamearray vgcons revtogg)+    ;uiManagerAddUiFromString valpopman valpopmstr+    ;uiManagerInsertActionGroup valpopman valpopgr 0++    ;mbvalpopup <- uiManagerGetWidget valpopman "/ui/popup"+    ;let valpopup = case mbvalpopup of+                         Nothing -> error "Main: no popup menu for value selection of graph"+                         Just x -> x++    ;putMVar mvrValPopup valpopup+    ;writeIORef hasValPopup True+                                                       } -- end else+                                  ;vgvalpopup <- readMVar mvrValPopup+                                  ;menuPopup (castToMenu vgvalpopup) Nothing   +                                  ;return ()+                                }  ++  widgetShowAll window+   onActionActivate quitact (widgetDestroy window)    onDestroy window mainQuit-  widgetShowAll window   mainGUI ++ uiDecl :: String uiDecl = "<ui>\ \            <menubar>\ \             <menu action=\"FileMenu\">\-\                <menuitem action=\"QuitAct\" />\ \                <menuitem action=\"OpenSrc\" />\+\                <menuitem action=\"QuitAct\" />\ \              </menu>\ \             <menu action=\"OptionMenu\">\ \               <menuitem action=\"DupCheck\" />\ \               <menuitem action=\"AmbCheck\" />\ \            </menu>\-\            <menu action=\"AbduceMenu\">\-\               <menuitem action=\"AbduTop\" />\-\               <menuitem action=\"AbduAll\" />\+\            <menu action=\"GrphMen\">\+\                <menuitem action=\"RevGraph\" />\+\                <menuitem action=\"AttGrph\" />\+\                <menuitem action=\"ValGrph\" />\+\                <menuitem action=\"GleGend\" />\ \            </menu>\ \            </menubar>\ \            <toolbar>\@@ -218,59 +334,83 @@ \            </toolbar>\ \         </ui>" --- | workaround for bug in ToggleActionEntry -myTog :: IORef Bool -> IO ()-myTog chk = do old <- readIORef chk-               writeIORef chk (not old)- -- | test for duplicates if the user wants, let the user save a .csv file of duplicates with frequencies, finally remove duplicates from facts-getNoDuplicates :: IORef Bool -> FileChooserDialog -> Statusbar -> ContextId -> Array Int (String,[String])-> [[AVp]]  -> IO [[AVp]]-getNoDuplicates check fs status context attvarr rawfcts = do-         { duptrue <- readIORef check+getNoDuplicates :: ToggleAction -> FileChooserDialog -> Statusbar -> ContextId -> Array Int (String,[String])-> [[AVp]]  -> IO [[AVp]]+getNoDuplicates check fs status dupcontext attvarr rawfcts = do+         { duptrue <- get check toggleActionActive           ; if duptrue then do {-                        let prt = partDups rawfcts+                       ;statusbarPush status dupcontext "Checking for duplicates..."+                       ; let prt = partDups rawfcts                        ;if checkNoDups prt then  do {                  -                                        statusbarPush status context "No duplicates found in the facts"+                                        statusbarPush status dupcontext "No duplicates found in the facts"                                        ;return ()   }                           -                                           else -                                                 do { mbf <- mygetFileName fs                      +                                           else  do { mbf <- mygetFileName fs                                                                             ;case mbf of                                                                                                                                 Just fpath -> writeFile fpath (((allDup2CSVTb attvarr) . factsDups) prt)                                                             Nothing -> return ()                                       -                                                      ;statusbarPush status context "Duplicates have been removed from the fact list" +                                                      ;statusbarPush status dupcontext "Duplicates have been removed from the fact list"                                                        ;return ()     -                                                     }   -                                                                 +                                                     }                                                                                              ;return (factsUniques prt)-                              }-                    -             else -                        return rawfcts+                              }                    +                       else do { statusbarPush status dupcontext "Source file read and parsed"+                                 ;return rawfcts+                               }             } -saveAmbiguities :: IORef Bool -> FileChooserDialog -> Statusbar -> ContextId -> Array Int (String,[String]) -> Int -> [[Rule]]  -> IO ()-saveAmbiguities check fs status context attvarr consatt rules = do {-   ambtest <- readIORef check-    ; if ambtest then do {+-- returns True if there are NO ambiguous rules for the selected consequent attribute (and if the test was skipped)+noAmbiguities :: ToggleAction -> FileChooserDialog -> Statusbar -> ContextId -> Array Int (String,[String]) -> Int -> [[Rule]]  -> IO Bool+noAmbiguities check fs status ambcontext attvarr consatt rules = do {+      let cnsnm = (fst (attvarr ! consatt)) +      ;ambtest <- get check toggleActionActive+      ; if ambtest then do {          let ambs = getAmbiguous rules-         ; if ambs == [] then do { statusbarPush status context ("No ambiguous rules for " ++ (fst (attvarr ! consatt)))-                                  ;return ()+         ; if ambs == [] then do { statusbarPush status ambcontext ("No ambiguous rules for " ++ (fst (attvarr ! consatt)))+                                  ;return True                                  }-                         else do { mbf <- mygetFileName fs-                                  ;case mbf of                                        -                                        Just fpath -> writeFile fpath (allAmb2CSVTb attvarr ambs) -                                        Nothing -> return ()                                       -                                  ;statusbarPush status context ( "Ambiguities: " ++ (show (length ambs)) ++ " for " ++ (fst (attvarr ! consatt)))-                                  ;return ()     +                         else do { statusbarPush status ambcontext ( "Ambiguities: " ++ (show (length ambs)) ++ " for " ++ (fst (attvarr ! consatt)))+                                  ;mbf <- mygetFileName fs+                                  ;case mbf of     +                                        Nothing -> return ()                                    +                                        Just fpath -> writeFile fpath (allAmb2CSVTb attvarr ambs)                                          +                                  ;return False                                      }                                               }    -       else return ()+                   else do { statusbarPush status ambcontext ("No ambiguities check. The consequent attribute is: " ++ cnsnm)+                             ;return True+                           }    }  mygetFileName :: FileChooserDialog ->  IO (Maybe FilePath)-mygetFileName fs = do resp <- dialogRun fs-                      widgetHide fs+mygetFileName fs = do resp <- dialogRun fs +                      widgetHide fs                                            case resp of -                           ResponseAccept -> fileChooserGetFilename fs+                           ResponseAccept -> fileChooserGetFilename fs                              (_) -> return Nothing++myValChange :: [[LNode RuRe]] -> FileChooserDialog -> Statusbar -> ContextId -> Array Int (String,[String])-> Int -> ToggleAction -> RadioAction -> IO ()+myValChange ndgrp fs status valcontext attvarr cns check ra  = do { +                                     statusbarPush status valcontext "Building value rule graph.."+                                     ;valind <- radioActionGetCurrentValue ra+                                     ;revset <- get check toggleActionActive+                                     ;let valuegraph = implicGraphOne (ndgrp !! valind)+                                          displaygraph | revset = grev valuegraph+                                                       | otherwise = valuegraph+                                     ;mbf <- mygetFileName fs+                                     ;case mbf of   +                                           Nothing ->  do { statusbarPush status valcontext "Cancelled"+                                                            ;return () +                                                          }+                                           Just fpath -> do { forkIO $ do { +                                                 let consname = (fst (attvarr ! cns))+                                                     valname = (snd (attvarr ! cns)) !! valind+                                                 ;writeFile fpath (graph2DOT displaygraph "ValueGraph")+                                                 ;statusbarPush status valcontext (consname ++ " : " ++ valname ++ "  rule graph saved")+                                                 ;return ()+                                                                         }+                                                              ;return ()+                                                            }+                                                        }+ + 
src/Reduce.hs view
@@ -1,13 +1,15 @@-{- | Emping 0.4 (provisional)+{- | Emping 0.5 (provisional)  Module Reduce transforms a list of facts into a partition of rules for each value of a selected attribute, and returns all shortest rules (reduced normal form). -The reduction takes a coded fact list, which may have been checked for doubles (see module Codec). The original rules can be checked first for ambiguities. Ambiguous rules have the same antecedent, but a different consequent. +The reduction takes a coded fact list, which may have been checked for doubles (see module Codec). The original rules can be checked first for ambiguities. Ambiguous rules have the same antecedent, but a different consequent.++Fri 04 Apr 2008 07:18:23 PM CEST   -}-module Reduce  ( getAmbiguous, facts2Rules, reduceAll )where +module Reduce  ( getAmbiguous, facts2Rules, reduceAll )where import Data.List ( nub, (\\), partition, nubBy, delete )-import Aux ( partitionBy, isEq, minLs, isSub, AVp, Ant, Rule )+import Aux  --            A,B and C: the reduction algorithm in its three steps @@ -22,8 +24,8 @@ --    B1. match with all the antecedents of other than the consequent  -- | the reduction as a conjunction of disjunctions-match :: [AVp] -> [[AVp]] -> [[AVp]]-match h  = map (h \\) +fsfmatch :: [AVp] -> [[AVp]] -> [[AVp]]+fsfmatch h  = map (h \\)   --   B2. transform conjunction of disjunctions into disjunction of conjunctions @@ -167,7 +169,7 @@  -- | the implementation of the rule reduction (for one consequent attribute-value redPos :: [Ant] -> [Ant] -> [Ant]-redPos p n = verify (trAndOr (match (hypot p) n)) p+redPos p n = verify (trAndOr (fsfmatch (hypot p) n)) p -------------------------------------------------------  --                    Functions on the list of facts @@ -200,9 +202,13 @@            addcons x = (x,cons)            cons= (snd . head) rls +-- | add a sort by length to reduction of one consequent value+sortedRedOne :: [[Rule]] -> [Rule] -> [Rule]+sortedRedOne grp rls = sortByValNum $ redOne grp rls+ -- | reduce a rule model for all consequent attribute-value pairs  reduceAll :: [[Rule]] -> [[Rule]]-reduceAll rlgrp = map (redOne rlgrp) rlgrp+reduceAll rlgrp = map (sortedRedOne rlgrp) rlgrp  ----------------------------------------------------------------------------- {- | find ambiguities in a rule group. A rule group partitions rules according to the consequent values.@@ -216,4 +222,5 @@    anteqs = partitionBy (\x y -> (fst x) == (fst y)) ols    ols = concat grp +----------------------------------------------------------------------------------------------------