Commit b508f8d3 authored by Bruno López Trigo's avatar Bruno López Trigo

Corrección de bug na xeralización para diferentes sistemas de clasificación e...

Corrección de bug na xeralización para diferentes sistemas de clasificación e actualizado diagrama de clases
parent 20326ecb
#Tue, 20 Mar 2018 11:20:11 +0100
#Tue, 20 Mar 2018 14:33:58 +0100
C\:\\Users\\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\\diabetes.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\\logDiabetes.xml" "C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\diabetesInput.xml" "C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\diabetes.txt" "C:\\Users\\brilemau\\Documents\\repos\\ExpliClas-TFG\\codigo\\WekaParser-v2\\resources\\explanationDiabetes.html"
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"
compile.on.save=true
do.depend=false
do.jar=true
......
......@@ -2,6 +2,7 @@
<problem>
<attributes>
<attribute name="Color">
<valuetxt>Color</valuetxt>
<maxValue>45</maxValue>
<minValue>0</minValue>
<properties>
......@@ -44,6 +45,7 @@
</attribute>
<attribute name="Bitterness">
<valuetxt>Bitterness</valuetxt>
<maxValue>250</maxValue>
<minValue>7</minValue>
<properties>
......@@ -79,6 +81,7 @@
</attribute>
<attribute name="Strength">
<valuetxt>Strength</valuetxt>
<maxValue>0.136</maxValue>
<minValue>0.035</minValue>
<properties>
......
......@@ -2,6 +2,7 @@
<problem>
<attributes>
<attribute name="preg">
<valuetxt>Number of times pregnant</valuetxt>
<maxValue>17</maxValue>
<minValue>0</minValue>
<properties>
......@@ -19,10 +20,11 @@
<rightValue>17</rightValue>
</interval>
</property>
</properties>
</properties>
</attribute>
<attribute name="plas">
<valuetxt>Plasma glucose concentration</valuetxt>
<maxValue>199</maxValue>
<minValue>0</minValue>
<properties>
......@@ -51,6 +53,7 @@
</attribute>
<attribute name="pres">
<valuetxt>Diastolic blood pressure</valuetxt>
<maxValue>122</maxValue>
<minValue>0</minValue>
<properties>
......@@ -78,7 +81,8 @@
</properties>
</attribute>
<attribute name="skin">
<attribute name="skin">
<valuetxt>Triceps skin fold thickness</valuetxt>
<maxValue>99</maxValue>
<minValue>0</minValue>
<properties>
......@@ -106,7 +110,8 @@
</properties>
</attribute>
<attribute name="insu">
<attribute name="insu">
<valuetxt>2-Hour serum insulin</valuetxt>
<maxValue>846</maxValue>
<minValue>0</minValue>
<properties>
......@@ -131,14 +136,14 @@
<rightValue>510</rightValue>
</interval>
</property>
<property>
<property>
<valueTxt>Medium-High</valueTxt>
<interval>
<leftValue>510</leftValue>
<rightValue>680</rightValue>
</interval>
</property>
<property>
<property>
<valueTxt>High</valueTxt>
<interval>
<leftValue>680</leftValue>
......@@ -147,7 +152,8 @@
</property>
</properties>
</attribute>
<attribute name="mass">
<attribute name="mass">
<valuetxt>Body mass index</valuetxt>
<maxValue>67.1</maxValue>
<minValue>0</minValue>
<properties>
......@@ -165,7 +171,7 @@
<rightValue>35</rightValue>
</interval>
</property>
<property>
<property>
<valueTxt>High</valueTxt>
<interval>
<leftValue>35</leftValue>
......@@ -174,7 +180,8 @@
</property>
</properties>
</attribute>
<attribute name="pedi">
<attribute name="pedi">
<valuetxt>Diabetes pedigree function</valuetxt>
<maxValue>2.42</maxValue>
<minValue>0</minValue>
<properties>
......@@ -201,7 +208,8 @@
</property>
</properties>
</attribute>
<attribute name="age">
<attribute name="age">
<valuetxt>Age</valuetxt>
<maxValue>81</maxValue>
<minValue>21</minValue>
<properties>
......@@ -232,12 +240,12 @@
<consequents>
<consequent>
<code>1</code>
<name>tested_negative</name>
<name>tested_negative</name>
<text>Negative</text>
</consequent>
<consequent>
<code>2</code>
<name>tested_positive</name>
<name>tested_positive</name>
<text>Positive</text>
</consequent>
</consequents>
......
......@@ -3,7 +3,7 @@
<type>diabetes</type>
<attributes>
<attribute name="preg">
<value>8</value>
<value>2</value>
</attribute>
<attribute name="plas">
<value>120</value>
......@@ -18,10 +18,10 @@
<value>0</value>
</attribute>
<attribute name="mass">
<value>30</value>
<value>40</value>
</attribute>
<attribute name="pedi">
<value>0.183</value>
<value>1.183</value>
</attribute>
<attribute name="age">
<value>38</value>
......
@echo off
set properties_xsd="properties.xsd"
set properties_xml="glass.xml"
set entry_xsd="entry.xsd"
set config_xsd="config.xsd"
set config="config.xml"
set log="logGlass.xml"
set input="glassinput.xml"
set weka="glass.txt"
set html="explanationGlass.html"
set type=glass
set index=1
echo ^<?xml version="1.0" encoding="UTF-8"?^> > %input%
echo ^<problem^> >> %input%
echo ^<type^>%type%^</type^> >> %input%
echo ^<attributes^> >> %input%
setlocal EnableDelayedExpansion
for %%a in (%*) do (
if !index!==1 (
echo ^<attribute name="%%a"^> >> %input%
set /a index=0
) else (
echo ^<value^>%%a^</value^> >> %input%
echo ^</attribute^> >> %input%
set /a index=1
)
)
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%
pause
\ No newline at end of file
<h1>Explanation</h1><p>Beer is type Porter because system detected that its strength is session or standard and that its color is brown.</p><ul></ul><p>This beer could be confused with following types.</p><ul><li>it is unlikely (2.0 %) to be type Stout</li></ul>
\ No newline at end of file
<h1>Explanation</h1><p>Beer is type IPA because system detected that its strength and bitterness are high.</p><ul></ul><p>This beer could be confused with following types.</p><ul><li>it is unlikely (2.0 %) to be type Lager</li><li>it is unlikely (2.0 %) to be type Pilsner</li><li>it is unlikely (10.0 %) to be type Barleywine</li></ul>
\ No newline at end of file
<h1>Explanation</h1><p>Diabetes is type Negative because system detected that its plas is medium, that its mass is high, that its age is medium or high and that its pedi is low.</p><ul></ul><p>This diabetes could be confused with following types.</p><ul><li>it is likely (21.199999 %) to be type Positive</li></ul>
\ No newline at end of file
<h1>Explanation</h1><p>Diabetes is type Negative because system detected that its age and diabetes pedigree function are medium or high, that its plasma glucose concentration is medium, that its body mass index is high and that its number of times pregnant is low.</p><ul></ul><p>This diabetes could be confused with following types.</p><ul><li>it is likely (21.199999 %) to be type Positive</li></ul>
\ No newline at end of file
<h1>Explanation</h1><p>Glass is type vehic wind float because system detected that its potassium, barium and magnesium are low, medium or high, that its silicon and aluminum are medium or high, that its refractive index is low and that its sodium is medium.</p><p>It is eventually (41.17647 %) type vehic wind float however it can be of the following types.</p><ul><li>it is likely (21.008406 %) to be type build wind float considering its refractive index slightly lower</li></ul><p>This glass could be confused with following types.</p><ul><li>it is likely (23.529411 %) to be type build wind non-float</li><li>it is unlikely (5.882353 %) to be type tableware</li></ul>
\ No newline at end of file
=== Run information ===
Scheme: weka.classifiers.trees.J48 -U -M 2
Relation: Glass
Instances: 214
Attributes: 10
RI
Na
Mg
Al
Si
K
Ca
Ba
Fe
Type
Test mode: 10-fold cross-validation
=== Classifier model (full training set) ===
J48 unpruned tree
------------------
Ba <= 0.27
| Mg <= 2.41
| | K <= 0.03
| | | Na <= 13.75: build wind non-float (3.0)
| | | Na > 13.75: tableware (9.0)
| | K > 0.03
| | | Na <= 13.49
| | | | RI <= 1.5241: containers (13.0/1.0)
| | | | RI > 1.5241: build wind non-float (3.0)
| | | Na > 13.49: build wind non-float (7.0/1.0)
| Mg > 2.41
| | Al <= 1.41
| | | RI <= 1.51707
| | | | RI <= 1.51596: build wind float (3.0)
| | | | RI > 1.51596
| | | | | Fe <= 0.12
| | | | | | Mg <= 3.54: vehic wind float (5.0)
| | | | | | Mg > 3.54
| | | | | | | RI <= 1.51667: build wind non-float (2.0)
| | | | | | | RI > 1.51667: vehic wind float (2.0)
| | | | | Fe > 0.12: build wind non-float (2.0)
| | | RI > 1.51707
| | | | K <= 0.23
| | | | | Mg <= 3.34: build wind non-float (2.0)
| | | | | Mg > 3.34
| | | | | | Si <= 72.64
| | | | | | | Na <= 14.01: build wind float (14.0)
| | | | | | | Na > 14.01
| | | | | | | | RI <= 1.52211
| | | | | | | | | Na <= 14.32: vehic wind float (3.0)
| | | | | | | | | Na > 14.32: build wind float (2.0)
| | | | | | | | RI > 1.52211: build wind float (3.0)
| | | | | | Si > 72.64: vehic wind float (3.0)
| | | | K > 0.23
| | | | | Mg <= 3.75
| | | | | | Fe <= 0.14
| | | | | | | RI <= 1.52043: build wind float (36.0)
| | | | | | | RI > 1.52043: build wind non-float (2.0/1.0)
| | | | | | Fe > 0.14
| | | | | | | Al <= 1.17: build wind non-float (5.0)
| | | | | | | Al > 1.17: build wind float (6.0/1.0)
| | | | | Mg > 3.75: build wind non-float (10.0)
| | Al > 1.41
| | | Si <= 72.49
| | | | Ca <= 8.28: build wind non-float (6.0)
| | | | Ca > 8.28: vehic wind float (5.0/1.0)
| | | Si > 72.49
| | | | RI <= 1.51732
| | | | | Fe <= 0.22: build wind non-float (30.0/1.0)
| | | | | Fe > 0.22
| | | | | | RI <= 1.51629: build wind float (2.0)
| | | | | | RI > 1.51629: build wind non-float (2.0)
| | | | RI > 1.51732
| | | | | RI <= 1.51789: build wind float (3.0)
| | | | | RI > 1.51789: build wind non-float (2.0)
Ba > 0.27
| Si <= 70.16: build wind non-float (2.0/1.0)
| Si > 70.16: headlamps (27.0/1.0)
Number of Leaves : 30
Size of the tree : 59
Time taken to build model: 0.03 seconds
=== Stratified cross-validation ===
=== Summary ===
Correctly Classified Instances 144 67.2897 %
Incorrectly Classified Instances 70 32.7103 %
Kappa statistic 0.5571
Mean absolute error 0.1001
Root mean squared error 0.2854
Relative absolute error 47.2665 %
Root relative squared error 87.9232 %
Total Number of Instances 214
=== Detailed Accuracy By Class ===
TP Rate FP Rate Precision Recall F-Measure MCC ROC Area PRC Area Class
0,714 0,174 0,667 0,714 0,690 0,532 0,809 0,674 build wind float
0,618 0,174 0,662 0,618 0,639 0,452 0,774 0,611 build wind non-float
0,412 0,046 0,438 0,412 0,424 0,376 0,775 0,270 vehic wind float
? 0,000 ? ? ? ? ? ? vehic wind non-float
0,769 0,010 0,833 0,769 0,800 0,788 0,872 0,575 containers
0,778 0,029 0,538 0,778 0,636 0,629 0,930 0,527 tableware
0,793 0,022 0,852 0,793 0,821 0,795 0,869 0,738 headlamps
Weighted Avg. 0,673 0,127 0,677 0,673 0,673 0,546 0,811 0,616
=== Confusion Matrix ===
a b c d e f g <-- classified as
50 15 3 0 0 1 1 | a = build wind float
16 47 6 0 2 3 2 | b = build wind non-float
5 4 7 0 0 1 0 | c = vehic wind float
0 0 0 0 0 0 0 | d = vehic wind non-float
0 2 0 0 10 0 1 | e = containers
1 1 0 0 0 7 0 | f = tableware
3 2 0 0 0 1 23 | g = headlamps
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<problem>
<type>glass</type>
<attributes>
<attribute name="RI">
<value>1.52121</value>
</attribute>
<attribute name="Na">
<value>14.03</value>
</attribute>
<attribute name="Mg">
<value>3.76</value>
</attribute>
<attribute name="Al">
<value>0.58</value>
</attribute>
<attribute name="Si">
<value>71.79</value>
</attribute>
<attribute name="K">
<value>0.11</value>
</attribute>
<attribute name="Ca">
<value>9.65</value>
</attribute>
<attribute name="Ba">
<value>0</value>
</attribute>
<attribute name="Fe">
<value>0</value>
</attribute>
</attributes>
</problem>
......@@ -6,10 +6,10 @@
<value>24</value>
</attribute>
<attribute name="Bitterness">
<value>25</value>
<value>60</value>
</attribute>
<attribute name="Strength">
<value>0.055</value>
<value>0.08</value>
</attribute>
</attributes>
</problem>
......@@ -6,7 +6,8 @@
<antecedents>
<antecedent>
<attribute name="Strength">
<value>0.055</value>
<value>0.08</value>
<valuetxt>Strength</valuetxt>
<maxValue>0.136</maxValue>
<minValue>0.035</minValue>
<modified>false</modified>
......@@ -42,93 +43,101 @@
</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>24.0</value>
<maxValue>45.0</maxValue>
<minValue>0.0</minValue>
<attribute name="Bitterness">
<value>60.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>98.0</percentage>
<instances>50.0</instances>
<wrong>1.0</wrong>
<code>4.0</code>
<name>4.0</name>
<text>IPA</text>
<percentage>86.0</percentage>
<instances>48.0</instances>
<wrong>3.0</wrong>
<mistakes>
<mistake>
<code>5.0</code>
<name>5.0</name>
<text>Stout</text>
<code>2.0</code>
<name>2.0</name>
<text>Lager</text>
<percentage>2.0</percentage>
<instances>0.0</instances>
<wrong>0.0</wrong>
<mistakes/>
</mistake>
<mistake>
<code>3.0</code>
<name>3.0</name>
<text>Pilsner</text>
<percentage>2.0</percentage>
<instances>0.0</instances>
<wrong>0.0</wrong>
<mistakes/>
</mistake>
<mistake>
<code>6.0</code>
<name>6.0</name>
<text>Barleywine</text>
<percentage>10.0</percentage>
<instances>0.0</instances>
<wrong>0.0</wrong>
<mistakes/>
</mistake>
</mistakes>
</consequent>
</rule>
......
......@@ -7,6 +7,7 @@
<antecedent>
<attribute name="plas">
<value>120.0</value>
<valuetxt>Plasma glucose concentration</valuetxt>
<maxValue>199.0</maxValue>
<minValue>0.0</minValue>
<modified>false</modified>
......@@ -47,7 +48,8 @@
</antecedent>
<antecedent>
<attribute name="mass">
<value>30.0</value>
<value>40.0</value>
<valuetxt>Body mass index</valuetxt>
<maxValue>67.1</maxValue>
<minValue>0.0</minValue>
<modified>false</modified>
......@@ -76,7 +78,7 @@
</properties>
</attribute>
<interval>
<leftValue>26.4</leftValue>
<leftValue>33.1</leftValue>
<rightValue>67.1</rightValue>
</interval>
<posibleintervals>
......@@ -89,6 +91,7 @@
<antecedent>
<attribute name="age">
<value>38.0</value>
<valuetxt>Age</valuetxt>
<maxValue>81.0</maxValue>
<minValue>21.0</minValue>
<modified>false</modified>
......@@ -117,7 +120,7 @@
</properties>
</attribute>
<interval>
<leftValue>28.0</leftValue>
<leftValue>34.0</leftValue>
<rightValue>81.0</rightValue>
</interval>
<posibleintervals>
......@@ -133,7 +136,8 @@
</antecedent>
<antecedent>
<attribute name="pedi">
<value>0.183</value>
<value>1.183</value>
<valuetxt>Diabetes pedigree function</valuetxt>
<maxValue>2.42</maxValue>
<minValue>0.0</minValue>
<modified>false</modified>
......@@ -157,18 +161,57 @@
<interval>
<leftValue>1.4</leftValue>
<rightValue>2.42</rightValue>
</interval>
</property>
</properties>
</attribute>
<interval>
<leftValue>0.561</leftValue>
<rightValue>2.42</rightValue>
</interval>
<posibleintervals>
<posibleinterval>
<leftValue>0.7</leftValue>
<rightValue>1.4</rightValue>
</posibleinterval>
<posibleinterval>
<leftValue>1.4</leftValue>
<rightValue>2.42</rightValue>
</posibleinterval>
</posibleintervals>
</antecedent>
<antecedent>
<attribute name="preg">
<value>2.0</value>
<valuetxt>Number of times pregnant</valuetxt>
<maxValue>17.0</maxValue>
<minValue>0.0</minValue>
<modified>false</modified>
<properties>
<property>
<valueTxt>Low</valueTxt>
<interval>
<leftValue>0.0</leftValue>
<rightValue>9.0</rightValue>
</interval>
</property>
<property>
<valueTxt>High</valueTxt>