<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Decision tree approach for IRIS database classification</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Marcelina Lachowicz Institute of Mathematics Silesian University of Technology Kaszubska 23</institution>
          ,
          <addr-line>44-100 Gliwice</addr-line>
          ,
          <country country="PL">Poland</country>
        </aff>
      </contrib-group>
      <fpage>10</fpage>
      <lpage>14</lpage>
      <abstract>
        <p>-Data classification is one of important topics in information technology. There are many methods used in this process. This article presents classification of iris flowers by the use of decision tree. In the system was implemented a procedure to used an open data set for classification of applied types of flowers by numerical features describing them. Results show that proposed model is very simple but also efficient in numerical classification.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>In information processing very important role is for data
analysis and decision processes. From information hidden in
data we can get knowledge about various things. In general
we can use various methods to process the data. Artificial
intelligence gives us many interesting approaches to data
science.</p>
      <p>
        In general input data is organized in smaller groups called
classes in which final classification is done. By the use of
this kind of decision making processes we can estimate many
things. In [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] was implemented a method to estimate energetic
efficiency. In [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] was done a prediction on wind farming,
while in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] cancer classification from medical images was
done. Among methods of data science very often decision
trees are used. Some of first approaches to use decision
trees as classifiers were presented in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], where toxic hazards
estimation was done using decision trees. In [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] decision trees
were used to help on remote sensing to classify land images.
Recently there are many optimized decision tree structures
developed for specific examples of input data.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] was presented how to join decision tree with bee
algorithm on the way for faster data classification. In [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]
decision trees were joined with Bayesian methods to efficiently
classify smoking cessation. There are many approaches where
decision trees give very good results. An interesting survey
over various decision tree approaches and their
implementations was presented in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>In this article i show how to implement a simple python
procedure based on decision tree classifier.</p>
      <p>Implemented idea was used to recognize iris flowers from
open data set. Results show that proposed implementation
works well returning very good results.</p>
      <p>©2019 for this paper by its authors. Use permitted under Creative Commons
License Attribution 4.0 International (CC BY 4.0).</p>
    </sec>
    <sec id="sec-2">
      <title>II. RONALD AYLMER FISHER</title>
      <p>Ronald Aylmer Fisher was born on February 17, 1890 in
London, and died on July 29, 1962 in Adelaide. He was
a British geneticist and statistician. The Briton graduated
from Gonville and Caius College at the University of
Cambridge and worked as a professor of eugenics at the
London School of Economics in 1933-1943 and professor
of genetics at the University of Cambridge (1943-1957).
Anders Hald described him as ”a genius who almost created
the foundations of contemporary statistics”, and Richard
Dawkins as ”the greatest heir of Darwin” and a member of
the Royal Society in London (Royal Society). The geneticist
created, among others, maximum likelihood, analysis of
variance (ANOVA) and linear discriminant analysis. He also
dealt with methods of hypothesis verification using statistical
methods (in anthropology, genetics, ecology) and was one
of the creators of modern mathematical statistics. He is also
known for the development of experimental results at the
Rothamsted Institute of Agricultural Research (1919 - 1933)
and as the author of the Statistical Methods for Research
Workers (1925), Statistical Methods and Scientific Inference
(1956).</p>
    </sec>
    <sec id="sec-3">
      <title>III. PROPOSED CLASSIFIER</title>
      <p>The principle of proposed decision model is based on
decision tree.</p>
      <p>1) Decision Tree: A decision tree is a (graphical) method of
supporting the decision-making process. It is used in decision
theory and in machine learning. In the second application, it
helps in acquiring knowledge based on examples.
Algorithm - it works recursively for each node. We have to
decide whether the node will be:</p>
    </sec>
    <sec id="sec-4">
      <title>1) leaf - we end this recursive call,</title>
      <p>2) a branch node according to the values that the given
attribute takes and for each child node we create a
recursive call to the algorithm with the list of attributes
reduced by the attribute just selected.</p>
      <p>Building a tree - The tree consists of nodes: decisions and
states of nature and branches. Rectangles are decisions, and
states of nature are circles. We start with the root. At the
very beginning we have the first given sepal length (figure
1), then we analyze the second variable - sepal width (figure
2). In this way, we continue the construction of the whole tree.
A. Coding
from sklearn import tree
import numpy as np
iris = open("iris.txt","r")
list = []
for line in iris:
data = line.split(",")
list.append(data)
list2 = [[float(column) for column in row]
for row in list]
print(list2)
iris_res = open("iris-result.txt","r")
res = []
for line in iris_res:
data = line.split(",")
res.append(data)
res2 = [[int(column) for column in row]
for row in res]</p>
      <p>The code was written in Python. As you can see, we have
introduced the data of IRIS databases to the program. Then
we entered the function to learn our network through a library
that Python has:
sklearn.tree. DecisionTreeClassifier</p>
    </sec>
    <sec id="sec-5">
      <title>IV. THE IRIS DATABASE</title>
      <p>The IRIS database contains a set of iris flower measurement
and was first made available by Ronald Fisher in 1936. This
is one of the most well-known collections, in addition, as
we’ll see in a moment is also very simple. The set of irises
consists of 4 measurements of flower petals and a leaf: width
and length. There are three types of flowers:</p>
      <p>Versicolor - This flower is found in North America and
develops up to a height of 80 centimeters. The leaves of
this plant have a width of more than one centimeter, and
the roots form large and thick clumps. A well-developed
plant has 6 blue petals and blooms from May to July,
while large seeds can be observed appearing in autumn.</p>
      <p>Setosa - the flower is found in Canada, Russia, north- east
Asia, China, Korea, southern Japan and Alaska. The plant
has half-green leaves, high branched stems and
purpleblue flowers similar to lavender (there are also pink and
white flowers). The roots are shallow, large and rapidly
spreading.</p>
      <p>Virginica - this flower is native to North America. The
leaves are 1 to 3 centimeters long and sometimes longer
than the flower stalk. The plant has 2 to 4 erect or
arching, bright green. The roots are spread underground.
The seeds are light brown and differently shaped, and
are born in three-part fruit capsules. The petals vary in
color from dark purple to pinkish- white. These plants
bloom from April to May and have from 2 to 6 flowers.</p>
    </sec>
    <sec id="sec-6">
      <title>V. OUR EXAMPLE</title>
      <p>Our database has 150 data (50 for each type of flower),
of which 120 we used to learn the artificial neural network,
and 30 (10 for each species) to test the artificial neural
network. The question then arises: Do the data groups we
have received correspond to the three species of iris? To see
this, let’s look at the error matrix.</p>
      <p>A. Confusion Matrix</p>
      <p>Confusion Matrix is the basic tool used to assess the quality
of the classification. In our table, we consider three classes of
abstraction as a result of which we get a 3 x 3 matrix. The</p>
    </sec>
    <sec id="sec-7">
      <title>1) For Versicolor</title>
      <p>sensitivity, recall, hit rate or true positive rate
(TPR)
T P R = T P = T P +F N = 10+0 = 1100 = 1</p>
      <p>T P 10</p>
      <p>P
T P R = 1 F N R
specificity, selectivity or true negative rate (TNR)
T N R = T N = T N+F P = 20+0 = 2200 = 1</p>
      <p>T N 20</p>
      <p>N
T N R = 1 F P R
precision or positive predictive value (PPV)
P P V = T P +F P = 10+0 = 1100 = 1</p>
      <p>T P 10
P P V = 1 F DR
negative predictive value (NPV)
N P V = T N+F N = 20+0 = 2200 = 1</p>
      <p>T N 20
N P V = 1 F OR
textitmiss rate or false negative rate (FNR)
F N R = FPN = F N+T P = 0+10 = 100 = 0</p>
      <p>F N 0
F N R = 1 T P R
fall-out or false positive rate (FPR)
F P R = F P = F P +T N = 0+20 = 200 = 0</p>
      <p>F P 0</p>
      <p>N
F P R = 1 T N R
false discovery rate (FDR)
F DR = F P +T P = 0+10 = 100 = 0</p>
      <p>F P 0
F DR = 1 P P V
false omission rate (FOR)
F OR = F N+T N = 0+20 = 200 = 0</p>
      <p>F N 0
F OR = 1 N P V
accuracy (ACC)
AC10C+20 = T PP ++TNN = T P +TTNP ++TF NP+F N =
10+20+0+0 = 3300 = 1
F1 score - harmonic mean of precision and
sensitivity
F1 = 2 PPPPVV+TTPPRR = 2T P +2FTPP+F N = 20+200+0 =
2200 = 1
Matthews correlation coefficient (MCC)
M CC = p(T P +F P ) (TTPP+TFNN)F(TPNF+NF P ) (T N+F N) =
10 10 20 20 = 320000 = 32</p>
      <p>300
informedness or Bookmaker Informedness (BM)
BM = T P R + T N R 1 = 1 + 1 1 = 1
Markedness (MK)</p>
      <p>M K = P P V + N P V 1 = 1 + 1 1 = 1
2) For Setosa
sensitivity, recall, hit rate or true positive rate
(TPR)
T P R = T P = T P +F N = 10+0 = 1100 = 1</p>
      <p>T P 10</p>
      <p>P
T P R = 1 F N R
specificity, selectivity or true negative rate (TNR)
T N R = T N = T N+F P = 20+0 = 2200 = 1</p>
      <p>T N 20</p>
      <p>N
T N R = 1 F P R
precision or positive predictive value (PPV)
P P V = T PT+PF P = 101+0 0 = 1100 = 1
P P V = 1 F DR
negative predictive value (NPV)
N P V = T NT+NF N = 202+0 0 = 2200 = 1
N P V = 1 F OR
textitmiss rate or false negative rate (FNR)
F N R = FPN = F NF+NT P = 0+010 = 100 = 0
F N R = 1 T P R
fall-out or false positive rate (FPR)
F P R = FNP = F PF+PT N = 0+020 = 200 = 0
F P R = 1 T N R
false discovery rate (FDR)
F DR = F PF+PT P = 0+010 = 100 = 0
F DR = 1 P P V
false omission rate (FOR)
F OR = F NF+NT N = 0+020 = 200 = 0
F OR = 1 N P V
accuracy (ACC)
AC10C+20 = T PP ++TNN = T P +TTNP ++TF NP+F N =
10+20+0+0 = 3300 = 1
F1 score - harmonic mean of precision and
sensitivity
F1 = 2 PPPPVV+TTPPRR = 2T P +2FTPP+F N = 20+200+0 =
2200 = 1
Matthews correlation coefficient (MCC)</p>
      <p>T P T N F P F N
M CC = p(T P +F P ) (T P +F N ) (T N +F P ) (T N +F N )
10 10 20 20 = 320000 = 23</p>
      <p>300
informedness or Bookmaker Informedness (BM)
BM = T P R + T N R 1 = 1 + 1 1 = 1
Markedness (MK)</p>
      <p>M K = P P V + N P V 1 = 1 + 1 1 = 1
3) For Virginica
sensitivity, recall, hit rate or true positive rate
(TPR)
T P R = TPP = T PT+PF N = 101+0 0 = 1100 = 1
T P R = 1 F N R
specificity, selectivity or true negative rate (TNR)
T N R = TNN = T NT+NF P = 202+0 0 = 2200 = 1
T N R = 1 F P R
precision or positive predictive value (PPV)
P P V = T PT+PF P = 101+0 0 = 1100 = 1
P P V = 1 F DR
negative predictive value (NPV)
N P V = T NT+NF N = 202+0 0 = 2200 = 1
N P V = 1 F OR
textitmiss rate or false negative rate (FNR)
F N R = FPN = F NF+NT P = 0+010 = 100 = 0
F N R = 1 T P R
fall-out or false positive rate (FPR)
F P R = FNP = F PF+PT N = 0+020 = 200 = 0
F P R = 1 T N R
false discovery rate (FDR)
F DR = F PF+PT P = 0+010 = 100 = 0
F DR = 1 P P V
=</p>
      <p>Fig. 3. Confusion matrix for classification results by the use of implemented
decision tree method
false omission rate (FOR)
F OR = F NF+NT N = 0+020 = 200 = 0
F OR = 1 N P V
accuracy (ACC)
AC10C+20 = T PP ++TNN = T P +TTNP ++TF NP+F N =
10+20+0+0 = 3300 = 1
F1 score - harmonic mean of precision and
sensitivity
F1 = 2 PPPPVV+TTPPRR = 2T P +2FTPP+F N = 20+200+0 =
2200 = 1
Matthews correlation coefficient (MCC)</p>
      <p>T P T N F P F N
M CC = p(T P +F P ) (T P +F N ) (T N +F P ) (T N +F N )
10 10 20 20 = 320000 = 32</p>
      <p>300
informedness or Bookmaker Informedness (BM)
BM = T P R + T N R 1 = 1 + 1 1 = 1
Markedness (MK)
M K = P P V + N P V 1 = 1 + 1 1 = 1
=</p>
    </sec>
    <sec id="sec-8">
      <title>Legend:</title>
      <p>P - condition positive - the number of real positive cases
in the data,
N - condition negative - the number of real negative cases
in the data,
TP - true positive,
TN - true negative,
FP - false positive,</p>
      <p>FN - false negative
We present our error matrix in the form of a table in figure 3,
in which the poems correspond to the species of iris, to which
the data point belonged, while the columns tell the genre to
which it was qualified. The elements inside the table specify
the number of data points corresponding to the species of iris
specified in the row header assigned to the data group specified
in the column header.</p>
      <p>Let us note the perfect compatibility between data groups and
species of iris. Each point has been correctly classified.</p>
    </sec>
    <sec id="sec-9">
      <title>VI. CONCLUSIONS</title>
      <p>Proposed reasoning was easy to implement. Results show
decisions were very good and all inputs were classified
correctly. The code of the reasoning in python used a library for
artificial intelligence where the method was coded.</p>
      <p>In future research i want to develop another method for
data classification based on other probabilistic methods where
decision between classes will be related to statistical measures.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>G.</given-names>
            <surname>Capizzi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. L.</given-names>
            <surname>Sciuto</surname>
          </string-name>
          , G. Cammarata, and
          <string-name>
            <given-names>M.</given-names>
            <surname>Cammarata</surname>
          </string-name>
          , “
          <article-title>Thermal transients simulations of a building by a dynamic model based on thermal-electrical analogy: Evaluation and implementation issue,” Applied energy</article-title>
          , vol.
          <volume>199</volume>
          , pp.
          <fpage>323</fpage>
          -
          <lpage>334</lpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>S.</given-names>
            <surname>Brusca</surname>
          </string-name>
          , G. Capizzi,
          <string-name>
            <given-names>G. Lo</given-names>
            <surname>Sciuto</surname>
          </string-name>
          , and G. Susi, “
          <article-title>A new design methodology to predict wind farm energy production by means of a spiking neural network-based system</article-title>
          ,”
          <source>International Journal of Numerical Modelling: Electronic Networks, Devices and Fields</source>
          , vol.
          <volume>32</volume>
          , no.
          <issue>4</issue>
          , p.
          <fpage>e2267</fpage>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>G.</given-names>
            <surname>Capizzi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. L.</given-names>
            <surname>Sciuto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Napoli</surname>
          </string-name>
          , and E. Tramontana, “
          <article-title>Advanced and adaptive dispatch for smart grids by means of predictive models</article-title>
          ,
          <source>” IEEE Transactions on Smart Grid</source>
          , vol.
          <volume>9</volume>
          , no.
          <issue>6</issue>
          , pp.
          <fpage>6684</fpage>
          -
          <lpage>6691</lpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M.</given-names>
            <surname>Woz</surname>
          </string-name>
          ´niak, D. Połap, G. Capizzi,
          <string-name>
            <given-names>G. L.</given-names>
            <surname>Sciuto</surname>
          </string-name>
          ,
          <string-name>
            <surname>L.</surname>
          </string-name>
          <article-title>Kos´mider, and</article-title>
          K. Frankiewicz, “
          <article-title>Small lung nodules detection based on local variance analysis and probabilistic neural network,” Computer methods and programs in biomedicine</article-title>
          , vol.
          <volume>161</volume>
          , pp.
          <fpage>173</fpage>
          -
          <lpage>180</lpage>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M.</given-names>
            <surname>Wozniak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Polap</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Kosmider</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Napoli</surname>
          </string-name>
          , and E. Tramontana, “
          <article-title>A novel approach toward x-ray images classifier</article-title>
          ,” in
          <source>2015 IEEE Symposium Series on Computational Intelligence. IEEE</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>1635</fpage>
          -
          <lpage>1641</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>G.</given-names>
            <surname>Cramer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Ford</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R.</given-names>
            <surname>Hall</surname>
          </string-name>
          , “
          <article-title>Estimation of toxic hazarda decision tree approach,” Food and cosmetics toxicology</article-title>
          , vol.
          <volume>16</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>255</fpage>
          -
          <lpage>276</lpage>
          ,
          <year>1976</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>M. A.</given-names>
            <surname>Friedl</surname>
          </string-name>
          and
          <string-name>
            <given-names>C. E.</given-names>
            <surname>Brodley</surname>
          </string-name>
          , “
          <article-title>Decision tree classification of land cover from remotely sensed data,” Remote sensing of environment</article-title>
          , vol.
          <volume>61</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>399</fpage>
          -
          <lpage>409</lpage>
          ,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>H.</given-names>
            <surname>Rao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Shi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. K.</given-names>
            <surname>Rodrigue</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Feng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Xia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Elhoseny</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Yuan</surname>
          </string-name>
          , and L. Gu, “
          <article-title>Feature selection based on artificial bee colony and gradient boosting decision tree,” Applied Soft Computing</article-title>
          , vol.
          <volume>74</volume>
          , pp.
          <fpage>634</fpage>
          -
          <lpage>642</lpage>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>A.</given-names>
            <surname>Tahmassebi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. H.</given-names>
            <surname>Gandomi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. H.</given-names>
            <surname>Schulte</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. E.</given-names>
            <surname>Goudriaan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. Y.</given-names>
            <surname>Foo</surname>
          </string-name>
          , and A. Meyer-Baese, “
          <article-title>Optimized naive-bayes and decision tree approaches for fmri smoking cessation classification</article-title>
          ,
          <source>” Complexity</source>
          , vol.
          <year>2018</year>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>S. R.</given-names>
            <surname>Safavian</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Landgrebe</surname>
          </string-name>
          , “
          <article-title>A survey of decision tree classifier methodology</article-title>
          ,
          <source>” IEEE transactions on systems, man, and cybernetics</source>
          , vol.
          <volume>21</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>660</fpage>
          -
          <lpage>674</lpage>
          ,
          <year>1991</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>