<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Songül Erdem Güler on Medium]]></title>
        <description><![CDATA[Stories by Songül Erdem Güler on Medium]]></description>
        <link>https://medium.com/@songulerdemguler?source=rss-e3efc0bf6a06------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7L41Cd3WSoxxEszHtiKJog.jpeg</url>
            <title>Stories by Songül Erdem Güler on Medium</title>
            <link>https://medium.com/@songulerdemguler?source=rss-e3efc0bf6a06------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 23:42:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@songulerdemguler/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Running Scheduled Code on GitHub]]></title>
            <link>https://medium.com/@songulerdemguler/running-scheduled-code-on-github-8e6a03a8d88b?source=rss-e3efc0bf6a06------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e6a03a8d88b</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[scheduled-tasks]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Songül Erdem Güler]]></dc:creator>
            <pubDate>Fri, 14 Jan 2022 15:03:19 GMT</pubDate>
            <atom:updated>2022-01-14T15:03:19.567Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello. In this article, I will talk about running a python script automatically at the times we want.</p><p>I pull data from a site every day to use in my project. I run the script I wrote to pull this data, twice a day. So, can we run this code by timing, whether the computer is on or not? The answer is yes. We can do this for free for up to 2000 minutes per month on GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OLA6UrJFPAmDP0_N" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=medium&amp;utm_medium=referral">Roman Synkevych</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I will explain step by step what needs to be done for this. First of all, I prepared the .py file where I wrote the script and the requirements.txt file containing the necessary libraries for the script. I’m going to log in to Github and create a new repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-JsXDDfA2avAXEDwb-2apg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*orWh9RdU7i_rHvmWKeTicQ.jpeg" /></figure><p>I will upload the .py script and requirements.txt file that I created before to the new repo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xMc7n6HXgK3J3BBujyFZAQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*eo1sBCeaJ86DVKawlllWyQ.jpeg" /></figure><p>Now we can move on to the scheduled code execution part. For this, we click on the Actions section where the code is located.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kBj2o__848YnZsIuG6z-RA.jpeg" /></figure><p>Here we need to create a workflow. We can choose it from ready-made templates or write it ourselves according to our needs. For detailed information about this part, you can use GitHub’s document. <a href="https://docs.github.com/en/actions/learn-github-actions">https://docs.github.com/en/actions/learn-github-actions</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q61p-FsYGrJCXIZVcxMQ1A.jpeg" /></figure><p>When we click on this part, a file named main.yml opens and we need to write this file according to our processes. This file was created on the <strong>/.github/workflows/</strong> path, in the same repo as the script we wrote.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FwlNmYqqxRkbYV08GgLGPQ.jpeg" /></figure><p>Now we will write the main.yml file. First, we need to set the timing part. We enter an expression according to the hours we want it to work with Cron. Here I set it to short-range so that I can show the results presently. I normally run it twice a day, at 8:00 am and 8:00 pm. You can get help from the images below to write a cron expression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*9xMnRggEVnHKAAwbOvUV8Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dy-ArgJ3I8uYXQA_FDgTzA.jpeg" /></figure><p>The above structure may be confusing for those who haven’t used cron before. You can use any of the following sites to easily generate the cron expression.</p><ul><li><a href="https://crontab.guru/">https://crontab.guru/</a></li><li><a href="https://crontab-generator.org/">https://crontab-generator.org/</a></li><li><a href="https://www.freeformatter.com/cron-expression-generator-quartz.html">https://www.freeformatter.com/cron-expression-generator-quartz.html</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*QkW9nbzbg2iHhrkvzxhcFg.jpeg" /></figure><p>Then we will write the steps needed to run the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dNVNsx5zEcCQ7pP7YU3UzA.jpeg" /></figure><ol><li>In this section, we wrote the environment where we want the code to run. Github’s document states that it can be run on Windows and macOS. Since I will use cron, I want to run it in an Ubuntu environment.</li><li>Cron works with UTC. I wrote our time zone so that I can properly set the time the code runs.</li><li>I checked the contents of the repository to see if there are any issues.</li><li>Here I wrote which Python version the code will work with. It will install the python version we choose in the Ubuntu environment and run the code with that version.</li></ol><p>The processes written to the YAML file occur sequentially. Therefore, the order of priority of the process is important. I should write the processes in the same order in the YAML file in whichever order I do them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*2jurm7C2EFjo-m1b6RXrmg.jpeg" /></figure><p>5. In this section, the libraries in the requirements.txt that we created earlier are installed.</p><p>6. Now we can run the script. In this step, you must enter the name of the python file you created yourself.</p><p>So far, we have added everything needed to run the code to the YAML file. My script collects data and writes them into a file. Since I did not commit, I cannot see the incoming file in the output of the code. Therefore, we need to add the commit step to the YAML file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*9CagjAyEHn8hsoepdXZ1Jw.jpeg" /></figure><p><strong>*:</strong> Here, you should write your GitHub username.</p><p><strong>**: </strong>Here, you should write your email address registered on GitHub.</p><p>Now the main.yml file is ready. We can commit this file and move on to the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7qrWKVq0QQ_-MQ5MdqmYdA.jpeg" /></figure><p>After this part, the repository will appear as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qP05hv56a_Rivcjwpn3F2Q.jpeg" /></figure><p>From the repository, we click on the Actions section again. We will click on the steps in the image below, in order. When we click on button number 4, the operations we wrote in the YAML file will start to take place in order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1p7nXWaaYZm3b1cxVIghw.jpeg" /></figure><p>When the script runs, it will appear as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I7GWkFrzCcdEqkpZ3HVmWQ.jpeg" /></figure><p>We can click on the script to see each step in more detail. Below we see all the steps we wrote in the YAML file. You can expand them by clicking them and see their details. When we get an error at any step, we can see in which of these steps the error occurred and on which line it is written in the YAML file, from the details here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7O4ttshd8kqqsSnO9Np0Cg.jpeg" /></figure><p>After Workflow runs for the first time, it will continue to run as scheduled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*layrJPpadwRyA59ofMYEWQ.jpeg" /></figure><p>We see above that the code runs at certain intervals. If you don’t intend to run the code for a while, you can stop the workflow from running instead of deleting it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GKguU9kYrmvztrO_BdMdsQ.jpeg" /></figure><p>When you want to run it again, it will be enough to activate the workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nrgQHprB108eQyIS5Bd8BQ.jpeg" /></figure><p>In summary, we can make data pulling easier by scheduling the code. In addition, when we need to train a machine learning model at regular intervals, we can automate the process by planning it from start to finish.</p><p>References:</p><p>[1] <a href="https://en.wikipedia.org/wiki/Cron">https://en.wikipedia.org/wiki/Cron</a></p><p>[2] <a href="https://docs.github.com/en/actions">https://docs.github.com/en/actions</a></p><p>You can contact me from Linkedin.</p><p><a href="https://www.linkedin.com/in/songulerdemguler/">Songül Erdem Güler - Data Science &amp; Machine Learning Bootcamp Participant - Veri Bilimi Okulu | LinkedIn</a></p><p>You can also visit my Kaggle and Github profiles.</p><p><a href="https://www.kaggle.com/songulerdem">https://www.kaggle.com/songulerdem</a></p><p><a href="https://github.com/songulerdemguler">https://github.com/songulerdemguler</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e6a03a8d88b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analysis of Titanic Dataset with PYCARET]]></title>
            <link>https://medium.com/@songulerdemguler/analysis-of-titanic-dataset-with-pycaret-6a129ddcd0da?source=rss-e3efc0bf6a06------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a129ddcd0da</guid>
            <category><![CDATA[automl]]></category>
            <category><![CDATA[titanic-dataset]]></category>
            <category><![CDATA[pycaret]]></category>
            <dc:creator><![CDATA[Songül Erdem Güler]]></dc:creator>
            <pubDate>Tue, 21 Dec 2021 10:59:17 GMT</pubDate>
            <atom:updated>2021-12-21T11:17:53.899Z</atom:updated>
            <content:encoded><![CDATA[<p>Today in my article, I am going to talk about PYCARET which is an AutoML tool. When applying machine learning models, we usually do data preprocessing, feature extraction, and feature selection. After these steps, we choose the best algorithm and optimize our parameters to achieve the best results. There are many automatic machine learning tools that we call AutoML to reduce this load. Today, I will review PyCaret, one of these tools, and make a classification example with PyCaret.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*IlNzxG65lpxyie4jQYk8tA.jpeg" /></figure><p>PyCaret is a Python library that aims to reduce trial and error processes and be more productive of data scientists. It’s basically a Python library that surrounds scikit-learn, XGBoost, LightGBM, and many more machine learning libraries and frameworks.</p><p>PyCaret includes modules for some Machine Learning tasks given below.</p><ul><li>Classification</li><li>Regression</li><li>Clustering</li><li>Anomaly Detection</li><li>Naturel Language Processing</li><li>Association Rule Mining</li></ul><p>If you want to see more detail about PyCaret, you can reach it from the link. <a href="https://pycaret.org/">https://pycaret.org/</a></p><p>Now, before moving on to our application, I will briefly talk about the installation.</p><pre><br>pip install pycaret<br></pre><p>You can easily download pycaret with the above command. If you are working with Jupyter Notebook or JupyterLab, you can install with</p><pre><br>!pip install pycaret<br></pre><p>command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t-DEKilyY0qdhx2Yvv-qCw.jpeg" /></figure><p>I will use the Titanic dataset for the application. You can access this dataset on Kaggle. First, I will include the required libraries in the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*qBF_JFoRyxhOwWCSSWzptw.jpeg" /></figure><p>Then I have the data set I downloaded from Kaggle read into the code. This dataset folder consists of train.csv, test.csv, and gender_submission.csv files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*KY1X7COS09ZIpFbXa2Vcfg.jpeg" /></figure><p>Now let’s see what the dataset looks like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-y6QaPbaRb3o-mUKP5J5FA.jpeg" /></figure><p>Here we will try to predict the Survived column. In this column, 1 indicates survivors and 0 death ones in Titanic. Let’s examine the ratio of these two situations with a graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*_qgAGwNXqHD1L8kPCOiy5g.jpeg" /></figure><p>Now let’s observe which machine learning algorithm will work better with the help of PyCaret. We will examine this problem as part of the classification problem. Therefore, I import PyCaret’s classification modules and specify our target column and categorical variables with the setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*5aBjKxqIUonxt9ENxTH_cw.jpeg" /></figure><p>There are many settings in the <strong>setup</strong> function. We can use these properties according to the problem. After this process, we can see which model will bring the best results with <strong>compare_model()</strong>. From the results below it clearly appears that the best results come with <strong>catboost</strong>. These results may vary slightly as the code is applied. These differences are normal since we randomly divide the data into pieces and apply algorithms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*iiz22dcz7runMbIqcXJXaw.jpeg" /></figure><p>After examining the table, I decided to implement CatBoost Classifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*DqlPvj8Bm8IJ2UZIAIg6KA.jpeg" /></figure><p>Now I want this model to find the best parameters and return a result according to those parameters. I will use the following code snippet for this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*IjXWSl4eT0eXEH6Jv_rahA.jpeg" /></figure><p>The accuracy value increases when the best parameters are set. Now let’s observe the values with data visualization tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*eFAElewMn3qcF4eq5bpctQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*KdR6zQKgwA1LCqVZR4Hb0A.jpeg" /></figure><p>The results in the second graph show that the model’s success is satisfying. Let’s observe it with the confusion matrix as we understand it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*uFKsd7yy8z-lLZZruHuCMg.jpeg" /></figure><p>Let’s see how effective the features that affect this model are on the model. The top-ranked features have more impact on the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RCG8hbUn_lwc2lXi9rHCCg.jpeg" /></figure><p>Let’s verify this with a different data visualization tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*nPFiW-6HSAFNQvWQS-wZBA.jpeg" /></figure><p>In this part, I conclude that it might be better if we look at the <strong>Feature </strong>graphics above and delete some features. I will remove the SibSp, Parch columns from the model and observe the results again. Additionally, I also change the <strong>remove_outliers </strong>property to True. If there is an outlier, I want it to take action on it as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*iAffBHviujwZziMolABRRg.jpeg" /></figure><p>Let’s run the models again and see which model might be better. Considering the changes we have made, we see that this time the <strong>Gradient Boosting Classifier</strong> brings the best results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*VI8nYSu477fwWRydiYz8YA.jpeg" /></figure><p>I will repeat the same process as above. Therefore, I will skip the implementation part and just add the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*yjdUTSaaeaoF7-y7wKmSTQ.jpeg" /></figure><p>Looking at the results, it seems that removing the less active features and dealing with outliers did not have a huge impact on our model. We can deduce from these results that we have obtained a usable model in its initial state too.</p><p>In addition to all this, PyCaret allows us to apply multiple models to the dataset. I will show this with a short example. We can implement multiple models using the <strong>blend_models()</strong> function. In this case, the first two or three algorithms that give the best results on the first try are usually chosen. As a result, we see an increase of 1%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*-SlheGU-e8OkOzpoBn_VmA.jpeg" /></figure><p>In summary, PyCaret is an easy-to-use library. It helps developers from the beginning of data preparation to model analysis. It has lots of open source algorithms, visualization tools, and preprocessing techniques. In cases where we are undecided about which machine learning algorithm to apply to any data set, we can use the PyCaret library when we want to find the best parameters of the machine learning model we have chosen.</p><p>I hope this post about PyCaret was helpful. Goodbye :)</p><p>You can contact me from Linkedin.</p><p><a href="https://www.linkedin.com/in/songulerdemguler/">Songül Erdem Güler - Data Science &amp; Machine Learning Bootcamp Participant - Veri Bilimi Okulu | LinkedIn</a></p><p>You can the link below to access all the code :)</p><p><a href="https://www.kaggle.com/songulerdem">https://www.kaggle.com/songulerdem</a></p><p><a href="https://github.com/songulerdemguler">https://github.com/songulerdemguler</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a129ddcd0da" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>