Commit 0e5f5ae2 authored by Bruno López Trigo's avatar Bruno López Trigo

Engadida versión coa nova xeración de explicacións, explicación do caso e...

Engadida versión coa nova xeración de explicacións, explicación do caso e explicación do clasificador
parent 874ee8f1
#Tue, 20 Mar 2018 17:42:04 +0100
#Fri, 23 Mar 2018 14:36:11 +0100
C\:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2=
/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2=
application.args="C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\properties.xsd" "C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\glass.xml" "C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\entry.xsd" "C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\config.xsd" "C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\config.xml" "C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\logGlass.xml" "C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\glassinput.xml" "C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\glass.txt" "C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\explanationGlass.html"
application.args="/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/properties.xsd" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/beer.xml" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/entry.xsd" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/config.xsd" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/config.xml" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/log.xml" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/inputexample.xml" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/ALL-infer.txt" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/explanation.html"
compile.on.save=true
do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
user.properties.file=C:\\Users\\brilemau\\AppData\\Roaming\\NetBeans\\8.2\\build.properties
user.properties.file=/home/brilemau/.netbeans/8.2/build.properties
......@@ -3,15 +3,12 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/Users/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/rulesystem/RuleBuilder.java</file>
<file>file:/C:/Users/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/languagerealiser/LanguageRealiser.java</file>
<file>file:/C:/Users/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/rulesystem/Consequent.java</file>
<file>file:/C:/Users/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/iosystem/Problem.java</file>
<file>file:/C:/Users/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/iosystem/ReaderWeka.java</file>
<file>file:/C:/Users/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/wekaparser/v2/Controller.java</file>
<file>file:/C:/Users/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/properties.xsd</file>
<file>file:/C:/Users/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/iosystem/LeafNode.java</file>
<file>file:/C:/Users/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/beer.xml</file>
<file>file:/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/iosystem/Problem.java</file>
<file>file:/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/iosystem/LeafNode.java</file>
<file>file:/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/languagerealiser/LanguageRealiser.java</file>
<file>file:/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/rulesystem/Consequent.java</file>
<file>file:/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/rulesystem/RuleBuilder.java</file>
<file>file:/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/src/iosystem/ReaderWeka.java</file>
</group>
</open-files>
</project-private>
......@@ -2,62 +2,87 @@
<config>
<propertiesAlt>
<property>
<valueTxt>Very likely</valueTxt>
<valueTxt>unlikely</valueTxt>
<interval>
<leftValue>90</leftValue>
<rightValue>100</rightValue>
<leftValue>0</leftValue>
<rightValue>25</rightValue>
</interval>
</property>
<property>
<valueTxt>Quite likely</valueTxt>
<valueTxt>quite likely</valueTxt>
<interval>
<leftValue>50</leftValue>
<rightValue>90</rightValue>
<leftValue>25</leftValue>
<rightValue>75</rightValue>
</interval>
</property>
<property>
<valueTxt>Likely</valueTxt>
<valueTxt>just as likely</valueTxt>
<interval>
<leftValue>10</leftValue>
<rightValue>50</rightValue>
<leftValue>75</leftValue>
<rightValue>100</rightValue>
</interval>
</property>
</propertiesAlt>
<propertiesTree>
<property>
<valueTxt>Unlikely</valueTxt>
<valueTxt>an exception</valueTxt>
<interval>
<leftValue>0</leftValue>
<rightValue>10</rightValue>
</interval>
</property>
</propertiesAlt>
<propertiesOri>
<property>
<valueTxt>Almost always</valueTxt>
<valueTxt>likely</valueTxt>
<interval>
<leftValue>80</leftValue>
<leftValue>10</leftValue>
<rightValue>30</rightValue>
</interval>
</property>
<property>
<valueTxt>very likely</valueTxt>
<interval>
<leftValue>30</leftValue>
<rightValue>100</rightValue>
</interval>
</property>
</propertiesTree>
<propertiesGlob>
<property>
<valueTxt>very confusing</valueTxt>
<interval>
<leftValue>0</leftValue>
<rightValue>30</rightValue>
</interval>
</property>
<property>
<valueTxt>quite confusing</valueTxt>
<interval>
<leftValue>30</leftValue>
<rightValue>89</rightValue>
</interval>
</property>
<property>
<valueTxt>Many times</valueTxt>
<valueTxt>very reliable</valueTxt>
<interval>
<leftValue>50</leftValue>
<rightValue>80</rightValue>
<leftValue>89</leftValue>
<rightValue>100</rightValue>
</interval>
</property>
</propertiesGlob>
<propertiesGlobConf>
<property>
<valueTxt>Eventually</valueTxt>
<valueTxt>eventually</valueTxt>
<interval>
<leftValue>10</leftValue>
<rightValue>50</rightValue>
<rightValue>30</rightValue>
</interval>
</property>
<property>
<valueTxt>Rarely</valueTxt>
<valueTxt>very</valueTxt>
<interval>
<leftValue>0</leftValue>
<rightValue>10</rightValue>
<leftValue>30</leftValue>
<rightValue>100</rightValue>
</interval>
</property>
</propertiesOri>
</propertiesGlobConf>
</config>
......@@ -25,7 +25,49 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="propertiesOri">
<xs:element name="propertiesTree">
<xs:complexType>
<xs:sequence>
<xs:element name="property" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="valueTxt"/>
<xs:element name="interval">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:float" name="leftValue"/>
<xs:element type="xs:float" name="rightValue"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="propertiesGlob">
<xs:complexType>
<xs:sequence>
<xs:element name="property" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="valueTxt"/>
<xs:element name="interval">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:float" name="leftValue"/>
<xs:element type="xs:float" name="rightValue"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="propertiesGlobConf">
<xs:complexType>
<xs:sequence>
<xs:element name="property" maxOccurs="unbounded" minOccurs="1">
......
"/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/properties.xsd" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/beer.xml" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/entry.xsd" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/config.xsd" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/config.xml" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/log.xml" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/inputexample.xml" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/ALL-infer.txt" "/home/brilemau/Documents/repos/ExpliClas-TFG/codigo/WekaParser-v2/resources/explanation.html"
#!/bin/bash
properties_xsd="properties.xsd"
properties_xml="beer.xml"
entry_xsd="entry.xsd"
config_xsd="config.xsd"
config="config.xml"
log="log.xml"
input="inputexample.xml"
weka="ALL-infer.txt"
html="explanation.html"
type=beer
index=1
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $input
echo "<problem>" >> $input
echo " <type>$type</type>" >> $input
echo " <attributes>" >> $input
for var in $@
do
if [ $index -eq 1 ]
then
echo " <attribute name=\"$var\">" >> $input
index=0
else
echo " <value>$var</value>" >> $input
echo " </attribute>" >> $input
index=1
fi
done
echo " </attributes>" >> $input
echo "</problem>" >> $input
java -jar ../dist/WekaParser-v2.jar $properties_xsd $properties_xml $entry_xsd $config_xsd $config $log $input $weka $html
firefox $html
<h1>Explanation</h1><p>Beer is type Stout because system detected that its strength is session or standard and that its color is black.</p><p>It is almost always (98.0 %) type Stout however it can be of the following types.</p><ul><li>it is just as likely to be type Stout as type Porter considering its color slightly lower</li></ul><p>This beer could be confused with following types.</p><ul><li>it is unlikely (2.0 %) to be type Belgian Strong Ale</li></ul>
\ No newline at end of file
<h1>AutoExplainable Classifier</h1><h2>Global information</h2><p>There are 8 types of beer: Blanche, Lager, Pilsner, IPA, Stout, Barleywine, Porter and Belgian Strong Ale. Types Blanche, Lager, Pilsner, Stout, Porter and Belgian Strong Ale are very reliable. Types IPA and Barleywine are quite confusing.</p><p>Type Barleywine is eventually confused with type IPA.</p><h2>Explanation</h2><p>Beer is type Barleywine because system detected that its strength is very high, that its bitterness is high and that its color is amber.</p><p>This class can be confused with type IPA if its strength is sligthly lower.</p><p>It is just as likely to be type IPA.</p><p>Considering global information IPA would be likely</p>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<problem>
<type>beer</type>
<attributes>
<attribute name="Color">
<value>30</value>
</attribute>
<attribute name="Bitterness">
<value>29</value>
</attribute>
<attribute name="Strength">
<value>0.046</value>
</attribute>
</attributes>
</problem>
<?xml version="1.0" encoding="UTF-8"?>
<problem>
<type>beer</type>
<attributes>
<attribute name="Color">
<value>11</value>
</attribute>
<attribute name="Bitterness">
<value>93</value>
</attribute>
<attribute name="Strength">
<value>0.095</value>
</attribute>
</attributes>
</problem>
......@@ -6,7 +6,7 @@
<antecedents>
<antecedent>
<attribute name="Strength">
<value>0.046</value>
<value>0.095</value>
<valuetxt>Strength</valuetxt>
<maxValue>0.136</maxValue>
<minValue>0.035</minValue>
......@@ -43,23 +43,68 @@
</properties>
</attribute>
<interval>
<leftValue>0.035</leftValue>
<rightValue>0.07</rightValue>
<leftValue>0.091</leftValue>
<rightValue>0.136</rightValue>
</interval>
<posibleintervals>
<posibleinterval>
<leftValue>0.035</leftValue>
<rightValue>0.0525</rightValue>
<leftValue>0.09</leftValue>
<rightValue>0.136</rightValue>
</posibleinterval>
</posibleintervals>
</antecedent>
<antecedent>
<attribute name="Bitterness">
<value>93.0</value>
<valuetxt>Bitterness</valuetxt>
<maxValue>250.0</maxValue>
<minValue>7.0</minValue>
<modified>false</modified>
<properties>
<property>
<valueTxt>Low</valueTxt>
<interval>
<leftValue>7.0</leftValue>
<rightValue>21.0</rightValue>
</interval>
</property>
<property>
<valueTxt>Low-Medium</valueTxt>
<interval>
<leftValue>21.0</leftValue>
<rightValue>32.5</rightValue>
</interval>
</property>
<property>
<valueTxt>Medium-High</valueTxt>
<interval>
<leftValue>32.5</leftValue>
<rightValue>47.5</rightValue>
</interval>
</property>
<property>
<valueTxt>High</valueTxt>
<interval>
<leftValue>47.5</leftValue>
<rightValue>250.0</rightValue>
</interval>
</property>
</properties>
</attribute>
<interval>
<leftValue>48.0</leftValue>
<rightValue>250.0</rightValue>
</interval>
<posibleintervals>
<posibleinterval>
<leftValue>0.0525</leftValue>
<rightValue>0.0675</rightValue>
<leftValue>47.5</leftValue>
<rightValue>250.0</rightValue>
</posibleinterval>
</posibleintervals>
</antecedent>
<antecedent>
<attribute name="Color">
<value>30.0</value>
<value>11.0</value>
<valuetxt>Color</valuetxt>
<maxValue>45.0</maxValue>
<minValue>0.0</minValue>
......@@ -103,32 +148,38 @@
</properties>
</attribute>
<interval>
<leftValue>29.0</leftValue>
<rightValue>45.0</rightValue>
<leftValue>8.0</leftValue>
<rightValue>11.0</rightValue>
</interval>
<posibleintervals>
<posibleinterval>
<leftValue>29.0</leftValue>
<rightValue>45.0</rightValue>
<leftValue>7.5</leftValue>
<rightValue>19.0</rightValue>
</posibleinterval>
</posibleintervals>
</antecedent>
</antecedents>
<consequent>
<code>5.0</code>
<name>5.0</name>
<text>Stout</text>
<percentage>98.0</percentage>
<instances>51.0</instances>
<wrong>1.0</wrong>
<code>6.0</code>
<name>6.0</name>
<text>Barleywine</text>
<percentage_global>0.0</percentage_global>
<percentage_tree>80.0</percentage_tree>
<mistakes>
<mistake>
<code>4.0</code>
<name>4.0</name>
<text>IPA</text>
<percentage_global>14.0</percentage_global>
<percentage_tree>0.0</percentage_tree>
<mistakes/>
</mistake>
<mistake>
<code>8.0</code>
<name>8.0</name>
<text>Belgian Strong Ale</text>
<percentage>2.0</percentage>
<instances>0.0</instances>
<wrong>0.0</wrong>
<percentage_global>2.0</percentage_global>
<percentage_tree>0.0</percentage_tree>
<mistakes/>
</mistake>
</mistakes>
......@@ -138,11 +189,11 @@
<antecedents>
<antecedent>
<attribute name="Strength">
<value>0.046</value>
<value>0.09025</value>
<valuetxt>Strength</valuetxt>
<maxValue>0.136</maxValue>
<minValue>0.035</minValue>
<modified>false</modified>
<modified>true</modified>
<properties>
<property>
<valueTxt>Session</valueTxt>
......@@ -175,92 +226,95 @@
</properties>
</attribute>
<interval>
<leftValue>0.035</leftValue>
<rightValue>0.07</rightValue>
<leftValue>0.07</leftValue>
<rightValue>0.091</rightValue>
</interval>
<posibleintervals>
<posibleinterval>
<leftValue>0.035</leftValue>
<rightValue>0.0525</rightValue>
</posibleinterval>
<posibleinterval>
<leftValue>0.0525</leftValue>
<rightValue>0.0675</rightValue>
<leftValue>0.0675</leftValue>
<rightValue>0.09</rightValue>
</posibleinterval>
</posibleintervals>
</antecedent>
<antecedent>
<attribute name="Color">
<value>28.5</value>
<valuetxt>Color</valuetxt>
<maxValue>45.0</maxValue>
<minValue>0.0</minValue>
<modified>true</modified>
<attribute name="Bitterness">
<value>93.0</value>
<valuetxt>Bitterness</valuetxt>
<maxValue>250.0</maxValue>
<minValue>7.0</minValue>
<modified>false</modified>
<properties>
<property>
<valueTxt>Pale</valueTxt>
<valueTxt>Low</valueTxt>
<interval>
<leftValue>0.0</leftValue>
<rightValue>3.0</rightValue>
<leftValue>7.0</leftValue>
<rightValue>21.0</rightValue>
</interval>
</property>
<property>
<valueTxt>Straw</valueTxt>
<valueTxt>Low-Medium</valueTxt>
<interval>
<leftValue>3.0</leftValue>
<rightValue>7.5</rightValue>
<leftValue>21.0</leftValue>
<rightValue>32.5</rightValue>
</interval>
</property>
<property>
<valueTxt>Amber</valueTxt>
<valueTxt>Medium-High</valueTxt>
<interval>
<leftValue>7.5</leftValue>
<rightValue>19.0</rightValue>
<leftValue>32.5</leftValue>
<rightValue>47.5</rightValue>
</interval>
</property>
<property>
<valueTxt>Brown</valueTxt>
<interval>
<leftValue>19.0</leftValue>
<rightValue>29.0</rightValue>
</interval>
</property>
<property>
<valueTxt>Black</valueTxt>
<valueTxt>High</valueTxt>
<interval>
<leftValue>29.0</leftValue>
<rightValue>45.0</rightValue>
<leftValue>47.5</leftValue>
<rightValue>250.0</rightValue>
</interval>
</property>
</properties>
</attribute>
<interval>
<leftValue>17.0</leftValue>
<rightValue>29.0</rightValue>
<leftValue>48.0</leftValue>
<rightValue>250.0</rightValue>
</interval>
<posibleintervals>
<posibleinterval>
<leftValue>19.0</leftValue>
<rightValue>29.0</rightValue>
<leftValue>47.5</leftValue>
<rightValue>250.0</rightValue>
</posibleinterval>
</posibleintervals>
</antecedent>
</antecedents>
<consequent>
<code>7.0</code>
<name>7.0</name>
<text>Porter</text>
<percentage>0.0</percentage>
<instances>50.0</instances>
<wrong>1.0</wrong>
<code>4.0</code>
<name>4.0</name>
<text>IPA</text>
<percentage_global>0.0</percentage_global>
<percentage_tree>93.75</percentage_tree>
<mistakes>
<mistake>
<code>5.0</code>
<name>5.0</name>
<text>Stout</text>
<percentage>2.0</percentage>
<instances>0.0</instances>
<wrong>0.0</wrong>
<code>2.0</code>
<name>2.0</name>
<text>Lager</text>
<percentage_global>2.0</percentage_global>
<percentage_tree>0.0</percentage_tree>
<mistakes/>
</mistake>
<mistake>
<code>3.0</code>
<name>3.0</name>
<text>Pilsner</text>
<percentage_global>2.0</percentage_global>
<percentage_tree>0.0</percentage_tree>
<mistakes/>
</mistake>
<mistake>
<code>6.0</code>
<name>6.0</name>
<text>Barleywine</text>
<percentage_global>10.0</percentage_global>
<percentage_tree>0.0</percentage_tree>
<mistakes/>
</mistake>
</mistakes>
......