deepsense.aideepsense.ai logo
  • Careers
    • Job offers
    • Summer internship
  • Clients’ stories
  • Services
    • AI software
    • Team augmentation
    • AI advisory
    • Train your team
  • Industries
    • Retail
    • Manufacturing
    • Financial & Insurance
    • IT operations
    • TMT & Other
    • Medical & Beauty
  • Knowledge base
    • Blog
    • R&D hub
  • About us
    • Our story
    • Management
    • Advisory board
    • Press center
  • Contact
  • Menu Menu
Data mining of the votes of Members of Parliament

Data mining of the votes of Members of Parliament

October 22, 2015/in Data science /by Przemyslaw Biecek

7th term of the Sejm has already come to its end. It would be nice to see how have the Members of Polish Parliament voted for these last 4 years! In total they took part in over 6000 votings. Did the representatives of the same clubs voted more similarly to each other? Did the Members of Polish Parliament who changed the clubs they belonged to voted in a different way than the Members of Parliament from their former clubs? Let’s see!

In order to display the similarity between the votes of the Members of Parliament we will use a technique known to geneticists –namely, a phylogenetic tree. Such diagrams are employed to present similarities between sequences of DNA/proteins of various organisms/genes. In our analyses the Members of Parliament will stand for organisms and their votes will serve as their DNA. We will build the phylogenetic tree for the Members of Parliament.
Phylogenetic trees are based on similarities between objects presented on these trees. In this case we will compare levels of similarity between votes cast by the Members of Parliament. Firstly, we will learn about the manner in which that similarity is calculated. As an example let us take six Members of Parliament and a dozen or so votings (here we will discuss 14 votings concerning the Act on Infertility Treatment). Each Member of Parliament might choose between the following options: to vote For, Against, and Abstain from voting (what is a ‘delicate’ against), or simply be absent during the voting. Let us encode these options with numbers: +2, -2, -1 and 0 respectively, or with colours: blue, red, yellow and light blue. The following graphic presents the votes of each of the six Members of Parliament during each of the votings under analysis. The left part of the diagram shows the similarity between the votes. During these votings J. Palikot and L. Miller voted in the same manner; E. Kopacz voted similarly; J. Piechocinski voted in less similar but still fairly alike way. Other two Members of Parliament, B. Szydlo and J. Gowin voted in a similar way but quite differently from the remaining four. The distance between the tree branches corresponds to the voting profiles.
e_profil
Now we increase the number of votings from 14 to 6000. The vector with votes is longer but the similarity is calculated in the same way -the Euclidean distance.
One diagram cannot present all 6000 votings clearly. We do not draw them; the only thing presented at the diagrams are names of the Members of Parliament. To make the diagram more legible, next to the names I put the name of all the clubs that given Members of Parliament belonged to during the 7th term of the Sejm. Colours represent clubs in which politicians spent most of the period of the 7th term. Below you may see a fragment of the tree. It shows that J. Zalka and J. Gowin voted in a rather similar way but very different than rest of their club. The tree also allows us to notice that both of them cast most of the votes while they belonged to PO, but both of them also belonged to ZP and KPSP. Members of Parliament from PSL and PO usually voted quite alike and for that reason they belong to the same subtree.
e_detail
We may also present the whole tree, although it has many leaves. When we include the MPs who left the Sejm and were elected for the Sejm, we have over 500 names. As we may see, the Members of Parliament from PO in most cases voted similarly. They create a separate subtree with PSL. PiS with a part of the right wing also creates its own subtree. The remaining two subtrees represent SLD and Twoj Ruch/Ruch Palikota.
e_drzewo
The same tree may be presented in various manners; above, for example, we may see a more packed version of it.
e_unrooted
However, a little fan like the one above is far more comprehensible. There is more space for names of the Members of Parliament.
If we take into consideration all the votings, we will notice that the greatest differences exist between the government and the opposition. It turns out that there are two Members of Parliament on the side of the government (Jaroslaw Gowin and Jacek Zalek) who usually voted as MPs from PO (the colour on the diagram corresponds to the club that a given Member of Parliament belonged to during most votings), yet their profiles differ considerably from the profiles of the remaining MPs. Besides, that pair migrated from one party to another, what may explain their incompatibility with the stance of PO. As far as PiS is concerned, the least compliant voters were Gorski Artur and Tomaszewski Jan (who finally transferred to PO at the end of the year).
There are many more such interesting stories where a typical voting profile is incompatible with the ‘main’ club; they can be found in every club. Just look for them for a while.
e_kolko2
When we look at votings on specific acts, the pictures tend to change. Below you may see an example diagram concerning voting on Personal Income Tax Act.
g1
Here you may look at the results of the votings on the Act on Higher Education. PO and PSL voted so similarly that the Members of Parliament belonging to both clubs are mixed. SLD and TR create their own trees. There are also groups of MPs, both within PO and PiS, who in all 53 votings (that is the number of votings on that act) voted identically (their tree branches are very short).
g2
You may see an enlarged version of every diagram by clicking on it.
Computer specialist sometimes joke that, unlike the normal trees, their trees grow upside down.
As it turns out the trees created by data analysts may grow in every direction. Or in every direction at the same time!
R packets- cluster, ggdendro and ape– were used during analysis of the clusters.
The source codes can be found at github: https://github.com/mi2-warsaw/JakOniGlosowali/tree/master/glosy.
Data on votings may be found in the package called sejmRP: https://github.com/mi2-warsaw/sejmRP.

Share this entry
  • Share on Facebook
  • Share on Twitter
  • Share on WhatsApp
  • Share on LinkedIn
  • Share on Reddit
  • Share by Mail
https://deepsense.ai/wp-content/uploads/2019/02/data-mining-of-the-votes-of-members-of-parliament.jpg 337 1140 Przemyslaw Biecek https://deepsense.ai/wp-content/uploads/2019/04/DS_logo_color.svg Przemyslaw Biecek2015-10-22 09:41:422021-01-05 16:52:39Data mining of the votes of Members of Parliament

Start your search here

NEWSLETTER SUBSCRIPTION

    You can modify your privacy settings and unsubscribe from our lists at any time (see our privacy policy).

    This site is protected by reCAPTCHA and the Google privacy policy and terms of service apply.

    THE NEWEST AI MONTHLY DIGEST

    • AI Monthly Digest 20 - TL;DRAI Monthly Digest 20 – TL;DRMay 12, 2020

    CATEGORIES

    • Elasticsearch
    • Computer vision
    • Artificial Intelligence
    • AIOps
    • Big data & Spark
    • Data science
    • Deep learning
    • Machine learning
    • Neptune
    • Reinforcement learning
    • Seahorse
    • Job offer
    • Popular posts
    • AI Monthly Digest
    • Press release

    POPULAR POSTS

    • AI trends for 2021AI trends for 2021January 7, 2021
    • A comprehensive guide to demand forecastingA comprehensive guide to demand forecastingMay 28, 2019
    • What is reinforcement learning? The complete guideWhat is reinforcement learning? deepsense.ai’s complete guideJuly 5, 2018

    Would you like
    to learn more?

    Contact us!
    • deepsense.ai logo white
    • Services
    • Customized AI software
    • Team augmentation
    • AI advisory
    • Knowledge base
    • Blog
    • R&D hub
    • deepsense.ai
    • Careers
    • Summer internship
    • Our story
    • Management
    • Advisory board
    • Press center
    • Support
    • Terms of service
    • Privacy policy
    • Code of ethics
    • Contact us
    • Join our community
    • facebook logo linkedin logo twitter logo
    • © deepsense.ai 2014-
    Scroll to top

    This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.

    OKLearn more

    Cookie and Privacy Settings



    How we use cookies

    We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

    Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

    Essential Website Cookies

    These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

    Because these cookies are strictly necessary to deliver the website, refuseing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

    We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

    We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

    Other external services

    We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

    Google Webfont Settings:

    Google Map Settings:

    Google reCaptcha Settings:

    Vimeo and Youtube video embeds:

    Privacy Policy

    You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

    Accept settingsHide notification only