<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Menelaos Kotoglou</title>
    <description>The latest articles on DEV Community by Menelaos Kotoglou (@koti).</description>
    <link>https://dev.to/koti</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F415163%2F17ad0a91-1bcf-4460-99fd-3da7d8e0985b.jpeg</url>
      <title>DEV Community: Menelaos Kotoglou</title>
      <link>https://dev.to/koti</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/koti"/>
    <language>en</language>
    <item>
      <title>Maintaining a Python package</title>
      <dc:creator>Menelaos Kotoglou</dc:creator>
      <pubDate>Mon, 01 Feb 2021 11:25:40 +0000</pubDate>
      <link>https://dev.to/koti/maintaining-a-python-package-1f0f</link>
      <guid>https://dev.to/koti/maintaining-a-python-package-1f0f</guid>
      <description>&lt;p&gt;As previously posted here: &lt;a href="https://dev.to/koti/updating-an-important-but-stale-python-library-3o6i"&gt;https://dev.to/koti/updating-an-important-but-stale-python-library-3o6i&lt;/a&gt;, me and Dimitry cooperated on updating a Python library important for the smooth operations of his company.&lt;/p&gt;

&lt;p&gt;Unfortunately, it seems that its original author never accepted our previous Pull Request to revive the profanity-check package. As a result, Github issues were kept being opened by other developers asking about the library and issues they had while using it. What surprised us the most, was this one: &lt;a href="https://github.com/vzhou842/profanity-check/issues/28"&gt;https://github.com/vzhou842/profanity-check/issues/28&lt;/a&gt;, where someone actually recommended our fork of the project as a "&lt;em&gt;new version available here, that solves the issue very well&lt;/em&gt;".&lt;/p&gt;

&lt;p&gt;Considering this and seeing that package seemed to have many users, either in production or for personal use, we decided that re-publishing the same library would be a great idea to bring the package back to life and make it accessible for more developers to experiment with. The main problem was following up with scikit-learn package's updates which rendered the initial models problematic as the next versions were released.&lt;/p&gt;

&lt;p&gt;After taking this quick and handy tutorial from Real Python: &lt;a href="https://realpython.com/courses/how-to-publish-your-own-python-package-pypi/"&gt;https://realpython.com/courses/how-to-publish-your-own-python-package-pypi/&lt;/a&gt;, we made some minor modifications to the project's repository and uploaded our updated version to PyPi. &lt;/p&gt;

&lt;p&gt;Outcome turned out to be really beneficial during the process and made us better both as people and developers. For example, we found out that when uploading a PyPI package, you don't really sync your repository to the PyPI project page. You only upload a tar'ed "/dist" directory's content produced after running the &lt;code&gt;python setup.py bdist_wheel&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;We also realised that many developers can sometimes be demanding things out of nowhere. They may request features and bug fixes, unable to understand that open-source software main purpose is the community's contribution in every possible way. They should consider putting some work on the projects themselves or contributing in other ways or at least saying "thanks".&lt;/p&gt;

&lt;p&gt;At any case, taking on the "responsibility" of maintaining a Python package, widely used by the community seems to be an exciting journey on the open-source software adventure. It makes you feel proud and responsible for ensuring that other people's projects continue to operate smoothly.&lt;/p&gt;

&lt;p&gt;You can find the package and instructions for its installation here: &lt;a href="https://pypi.org/project/alt-profanity-check/"&gt;https://pypi.org/project/alt-profanity-check/&lt;/a&gt;. Also, the source code can be found here: &lt;a href="https://gitlab.com/dimitrios/alt-profanity-check"&gt;https://gitlab.com/dimitrios/alt-profanity-check&lt;/a&gt;. Contributions and new feature ideas are more than welcome.&lt;/p&gt;

</description>
      <category>python</category>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>teamworking</category>
    </item>
    <item>
      <title>The Power of Study Groups</title>
      <dc:creator>Menelaos Kotoglou</dc:creator>
      <pubDate>Wed, 11 Nov 2020 10:03:25 +0000</pubDate>
      <link>https://dev.to/koti/the-power-of-study-groups-3n</link>
      <guid>https://dev.to/koti/the-power-of-study-groups-3n</guid>
      <description>&lt;p&gt;Undoubtedly, the Covid-19 crisis has changed students’ habits a lot. Old habits, such as hanging out, drinking beers, watching movies and even studying together have almost torn apart since most countries are experiencing the second Coronavirus wave.&lt;/p&gt;

&lt;p&gt;As a student, I decided to take advantage of the time gained from the situation to work on myself, my skills and my academic performance. Especially when the University’s workload increases, keeping yourself disciplined and focused on your goals becomes even harder.&lt;/p&gt;

&lt;p&gt;During these times, working in a study group is really helpful. Working as a team with your fellow students helps you maintain your focus and motivation. Even the days you don’t feel like studying, although you need to, your team encourages you to keep on completing your tasks.&lt;br&gt;
Also, the whole team gets the advantage of each individual’s strengths. Usually, students tend to like some courses more than others. Using this, team members help each other and save valuable time and effort from browsing through course’s notes in Elearning platform.&lt;/p&gt;

&lt;p&gt;Choosing the right platform that best suits your needs is crucial. My group prefers Google Meet. We consider it as the most stable and user-friendly free video calling software right now. Occasionally, we also use Skype, Zoom, Messenger or Discord.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JeftAfJx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/enlzh67lywsav792c7bu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JeftAfJx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/enlzh67lywsav792c7bu.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I need additionally to mention the socialising part of group studying. Social distancing will last for some more months at least, socialising even virtually, is crucial for student’s mental health. As shown in the pie chart, communicating with your teammates for extracurricular activities is a main part of this, helping students to keep their social life balanced. Also, after completing your coursework you can work on your hobbies, such as side projects or gaming.&lt;/p&gt;

&lt;p&gt;To conclude, although this chart seems to be very descriptive: the small percentage of “actually studying” time is so efficient that it is worth giving a try to make a study group.&lt;/p&gt;

&lt;p&gt;The article is also published on Medium &lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="https://menelaoskotoglou.medium.com/the-power-of-study-groups-e1312b6b193d" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--puCPemeW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/56/56/2%2A8qtqI9yeUT8PH5usU-32lA.jpeg" alt="Menelaos Κotoglou"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://menelaoskotoglou.medium.com/the-power-of-study-groups-e1312b6b193d" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;The Power of Study Groups. A short article to express my opinion… | by Menelaos Κotoglou | Medium&lt;/h2&gt;
      &lt;h3&gt;Menelaos Κotoglou ・ &lt;time&gt;Nov 11, 2020&lt;/time&gt; ・ 2 min read
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KBvj_QRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        menelaoskotoglou.Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>productivity</category>
    </item>
    <item>
      <title>Updating an important but stale Python library</title>
      <dc:creator>Menelaos Kotoglou</dc:creator>
      <pubDate>Wed, 01 Jul 2020 16:10:47 +0000</pubDate>
      <link>https://dev.to/koti/updating-an-important-but-stale-python-library-3o6i</link>
      <guid>https://dev.to/koti/updating-an-important-but-stale-python-library-3o6i</guid>
      <description>&lt;p&gt;The project is based on a “profanity-check” library created by Victor Zhou. You can read more about it here and find it online here: &lt;a href="https://github.com/vzhou842/profanity-check"&gt;https://github.com/vzhou842/profanity-check&lt;/a&gt;. Firstly, we installed the library in a virtual environment and experimented with different samples.&lt;/p&gt;

&lt;p&gt;We tested the model with an internal dataset consisting of 850 tweets retrieved through Twitter’s sampling API then labeled manually. This produced the following results:&lt;/p&gt;

&lt;p&gt;Confusion Matrix&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Actual&lt;br&gt; Predicted&lt;/th&gt;
&lt;th&gt;Not Profane (0)&lt;/th&gt;
&lt;th&gt;Profane (1)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Not Profane (0)&lt;/td&gt;
&lt;td&gt;703&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Profane (1)&lt;/td&gt;
&lt;td&gt;93&lt;/td&gt;
&lt;td&gt;39&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Accuracy Score: &lt;strong&gt;87.4%&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The issue that came up is that with newer Python and scikit-learn versions a list of warnings was thrown when including the library. Library’s dependencies were gradually deprecated and we had to update them making them compatible with newer versions of Python and scikit-learn. This is important because at any given point in time new releases of these libraries might not be able to deserialize the joblib’ed (alternative to pickle) file stored with the library.&lt;/p&gt;

&lt;p&gt;As the library’s documentation states &lt;a href="https://scikit-learn.org/stable/modules/model_persistence.html"&gt;https://scikit-learn.org/stable/modules/model_persistence.html&lt;/a&gt; :&lt;/p&gt;

&lt;p&gt;“… pickle (and joblib by extension), has some issues regarding maintainability and security. Because of this,&lt;/p&gt;

&lt;p&gt;Never unpickle untrusted data as it could lead to malicious code being executed upon loading.&lt;br&gt;
While models saved using one version of scikit-learn might load in other versions, this is entirely unsupported and inadvisable. It should also be kept in mind that operations performed on such data could give different and unexpected results.”&lt;/p&gt;

&lt;p&gt;This was not happening in this case as the original author had provided the input dataset and the serialised model files, but not the script to create them from these data. For this, I installed Python3.8 and scikit-learn 0.23.1. After lots of experiments, I substituted CountVectorizer from Victor Zhou’s blog post with TfidfVectorizer, trained the model based on the “clean_data.csv” from which the initial version was trained with and got roughly the same accuracy score as the previous model had. In detail:&lt;/p&gt;

&lt;p&gt;Confusion Matrix&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Actual&lt;br&gt; Predicted&lt;/th&gt;
&lt;th&gt;Not Profane (0)&lt;/th&gt;
&lt;th&gt;Profane (1)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Not Profane (0)&lt;/td&gt;
&lt;td&gt;697&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Profane (1)&lt;/td&gt;
&lt;td&gt;87&lt;/td&gt;
&lt;td&gt;45&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Accuracy Score: &lt;strong&gt;87.4%&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Working on this project helped me to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enhance my Python and scikit-learn knowledge.&lt;/li&gt;
&lt;li&gt;Work with pandas, NumPy, and Joblib libraries.&lt;/li&gt;
&lt;li&gt;Get familiar with open source development workflows.&lt;/li&gt;
&lt;li&gt;Use git working alongside with another collaborator to solve a problem.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The biggest surprise was a versioning issue that came up. Specifically, I had to find a way to update the model in a version compatible with Python3.8 since the current model’s scikit-learn version was not compatible with that version. Fortunately scikit-learn 0.23.1 works with Python3.8 hence chose this version.&lt;/p&gt;

&lt;p&gt;Overall, It’s been a great experience. I was able to use my academic knowledge to solve a real world problem. Also I was lucky to be supervised and mentored by Dimitrios, &lt;a href="https://www.yourself.online"&gt;yourself.online&lt;/a&gt;’s current CTO: was confident to speak and discuss every question that came up, even the dumbest ones. During every project’s step constant and immediate feedback was provided.&lt;/p&gt;

&lt;p&gt;My model is currently used in production as committed in the fork here: &lt;a href="https://github.com/dimitrismistriotis/profanity-check"&gt;https://github.com/dimitrismistriotis/profanity-check&lt;/a&gt;. Changes have also been submitted to the original library: &lt;a href="https://github.com/vzhou842/profanity-check/pull/19"&gt;https://github.com/vzhou842/profanity-check/pull/19&lt;/a&gt;. As stated the model is used as part of the content classification checks that happen within &lt;a href="https://www.yourself.online"&gt;yourself.online&lt;/a&gt;’s service which is available here: &lt;a href="https://www.yourself.online"&gt;https://www.yourself.online&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>machinelearning</category>
      <category>python</category>
      <category>datascience</category>
    </item>
  </channel>
</rss>
