<?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 Gökberk Abdullah on Medium]]></title>
        <description><![CDATA[Stories by Gökberk Abdullah on Medium]]></description>
        <link>https://medium.com/@abdullahgokberk?source=rss-40b91bbad9f7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YaRaeWOQAQwzB0lanDoXag.jpeg</url>
            <title>Stories by Gökberk Abdullah on Medium</title>
            <link>https://medium.com/@abdullahgokberk?source=rss-40b91bbad9f7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 01:09:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abdullahgokberk/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[Monte Carlo Simulation for the Champions League League Phase]]></title>
            <link>https://medium.com/@abdullahgokberk/monte-carlo-simulation-for-the-champions-league-league-phase-a9ab02cb445c?source=rss-40b91bbad9f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9ab02cb445c</guid>
            <category><![CDATA[champions-league]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[stacked-bar-chart]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Gökberk Abdullah]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 13:47:13 GMT</pubDate>
            <atom:updated>2026-01-21T13:47:13.492Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*gkj06I3W3Ke2CFX3FaJaQw.jpeg" /></figure><h3>Introduction</h3><p>In the Champions League league phase, predicting where teams will finish based solely on intuition can be misleading. In this study, a <strong>Monte Carlo simulation</strong> is applied to estimate possible final standings using the current point table, with only <strong>two matches remaining</strong> for each team.</p><p>The goal is to answer a simple but powerful question:<br><strong>Given a team’s current points, what is the probability of finishing in a specific ranking interval by the end of the league phase?</strong></p><p>You can find the project code <a href="https://github.com/abdullahgokberk/Champions_League_Monte_Carlo_Simulation/blob/42eb292fa11c82e9897c539fbaf88acaa4ae4998/Champions_League_Simulation.ipynb">here</a>.</p><h3>Data Collection &amp; Structure</h3><p>The dataset used in this analysis includes:</p><ul><li>Current points of each team (till 19.01.2026)</li><li>Goal difference (used as a tie-breaker)</li><li>The remaining two opponents for every team</li></ul><p>During the simulation process, each team’s <strong>initial points are preserved</strong> and used as a reference when aggregating final outcomes. This allows the results to be interpreted directly based on starting point levels rather than individual team names.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b971915fcf67b9e3b6bf49e78bc4eb0/href">https://medium.com/media/6b971915fcf67b9e3b6bf49e78bc4eb0/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*aAeK-jnHWKfCRuqvcdQKMw.jpeg" /><figcaption>df</figcaption></figure><h3>Data Preprocessing</h3><p>Before running the simulations, the data is prepared to support repeated iterations and probability aggregation.</p><p>Several auxiliary columns are created to track how often teams finish within specific ranking intervals:</p><ul><li>Top 1–8</li><li>9–16</li><li>17–24</li><li>25–36</li></ul><p>In addition, a separate aggregation table is constructed to group results by <strong>starting points</strong>, enabling a point-centric interpretation of the outcomes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/34c6e048c04313b6bfd0da6c89933573/href">https://medium.com/media/34c6e048c04313b6bfd0da6c89933573/href</a></iframe><h3><strong>Monte Carlo Simulation</strong></h3><p>The core of the analysis relies on simulating the remaining matches using a Monte Carlo approach.</p><p>For each match, three possible outcomes are defined:</p><p>Win-Draw-Loss</p><p>Each outcome is selected randomly with equal probability. Based on the simulated result, points are assigned accordingly and added to the teams’ current totals.</p><p>To avoid duplicate matches, a control mechanism ensures that the same fixture is not simulated more than once within a single iteration.</p><p>This entire process is repeated 2,000 times, generating a wide range of possible season-ending scenarios.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f7e8c55fcf45200dfe0f444e384e93b/href">https://medium.com/media/3f7e8c55fcf45200dfe0f444e384e93b/href</a></iframe><p>İn addition, all unique point values are stored in a separate table called df3, allowing us to aggregate and track the results of each simulation run within a single structure.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/acf3fb72075a4584f82fa90cc9f84a30/href">https://medium.com/media/acf3fb72075a4584f82fa90cc9f84a30/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/1*yIRO72J9cAslmtYwYwF_gA.jpeg" /><figcaption>df3</figcaption></figure><p>This code block illustrates the core structure of the Monte Carlo simulation applied to the remaining two matchdays of the Champions League league phase. In each simulation run, the current standings are copied (df2), and the remaining fixtures are simulated using probabilistic match outcomes. To prevent the same fixture from being played multiple times within a single simulation, match pairings are tracked using the detective list. After each iteration, teams are ranked based on total points and goal difference, and the number of times each team finishes in the 1–8, 9–16, 17–24, and 25–36 ranges is counted and cumulatively aggregated in the df3 table according to their initial point values.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0da98ee2d4e495aa99d6f52ded61e0d4/href">https://medium.com/media/0da98ee2d4e495aa99d6f52ded61e0d4/href</a></iframe><h3>Probability Aggregation</h3><p>After each simulation run, teams are ranked according to:</p><ol><li>Total points</li><li>Goal difference</li></ol><p>They are then classified into one of the predefined ranking intervals.<br> By counting how often teams with the same starting points finish in each interval and dividing by the total number of simulations, <strong>probability distributions</strong> are obtained.</p><p>This approach shifts the focus from individual teams to <strong>point-based expectations</strong>, answering questions such as:</p><ul><li>How safe is a team with X points for the top 8?</li><li>What point range is most likely to finish between 17–24?</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/61127772dc51b0920b0864f4456e63f1/href">https://medium.com/media/61127772dc51b0920b0864f4456e63f1/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*NFsksLoq8FLHqwk6rZClow.jpeg" /><figcaption>df3</figcaption></figure><h3>Data Visualization</h3><p>The final probabilities are visualized using:</p><ul><li><strong>Stacked bar charts</strong>, showing the distribution of finishing positions for each starting point level</li><li><strong>Heatmaps</strong>, providing a compact overview of how probabilities change as points increase</li></ul><p>These visualizations make it easier to identify thresholds where the likelihood of finishing in higher ranking intervals increases significantly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*pwmB2sIzNLYPl9LgygLMvQ.jpeg" /><figcaption>Stacked Bar Chart</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*icccN_0K9xKBzWgE1TE6Uw.jpeg" /><figcaption>Heatmap</figcaption></figure><h3>Insights &amp; Interpretation</h3><p>As of January 20, the final two matchdays of the Champions League league phase have begun. Based on the current standings, a Monte Carlo simulation repeated 2,000 times estimates the probabilities of teams finishing in different ranking intervals.</p><p>The chart clearly shows that as point totals increase, the probability of finishing in the top 8 rises sharply, while lower point totals shift the likelihood toward the 9–16 and 17–24 ranges. For mid-range teams, uncertainty remains high, whereas teams with fewer points are increasingly likely to finish in the 25–36 interval.</p><p>Focusing on Galatasaray, which currently has 9 points, the simulation indicates a high probability of finishing within the top 24. While the chance of reaching the top 8 appears limited, the probability mass is concentrated in the play-off zone (9–24), making the remaining matches crucial for final positioning.</p><p>Let’s see how accurate our simulation results will be once all matches are completed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9ab02cb445c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ChatGPT API’si ile Arama Ekibi Performans Değerlendirmesi]]></title>
            <link>https://medium.com/@abdullahgokberk/chatgpt-apisi-ile-arama-ekibi-performans-de%C4%9Ferlendirmesi-0c5fbfe52f4f?source=rss-40b91bbad9f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c5fbfe52f4f</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[yapay-zeka]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Gökberk Abdullah]]></dc:creator>
            <pubDate>Sun, 17 Nov 2024 20:52:07 GMT</pubDate>
            <atom:updated>2024-11-17T20:52:07.761Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*eqJyi3JPKzRO5sO1WMnwbA.jpeg" /></figure><h3>Giriş</h3><p>Özel bir şirkette arama ekibinin verilerini analiz ederken, her hafta manuel olarak hazırlamam gereken arama ekibi performans analizi tablosunu, Python yazılım dilini kullanarak ChatGPT API’sinin yardımı ile otomatize ettim ve bunu sizlerle paylaşacağım.</p><p>Projenin kodlarına <a href="https://github.com/abdullahgokberk/Arama_Ekibi_Performans_Degerlendirmesi/blob/main/Haftal%C4%B1k_Puan_Tablosu/Untitled.ipynb">buradan </a>ulaşabilirsiniz.</p><h3>Verinin Hikayesi</h3><p>Verimiz NetGSM’in kendi sitesinden çekilen ham datayı içeriyor.<br><strong>Girdiler :</strong><br>1 —YÖN: Yapılan tüm aramalar eğer karşı taraf telefonu açmışsa ‘Giden Arama’, açmamışsa ‘Giden Cevapsız Arama’ olarak bu kolonda tutulur.</p><p>2 — bas: Aramanın gerçekleştiği tarih ve saat bilgisi.</p><p>3 — arayan: Arama ekibindeki her üyenin kendine ait üç haneli kodu.</p><p>4 —aranan: Aranan kişinin numara bilgisi.</p><p>5 —sure: Ulaşılan kişi ile görüşülen zaman (sn).</p><p>6 —hat: Kişilerin arandığı numara.</p><p>7 — rehber: Aramayı gerçekleştiren arama ekibi üyesinin ismi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*Ah6fImrHP_N6B1gWnAJEcg.jpeg" /><figcaption>Ham Data</figcaption></figure><h3>Problem</h3><p>Bu projede amacımız, tablonun manuel olarak hazırlanıp yorumlanması sırasında yaşanan zaman kaybını önleyerek, bu süreci otomatik hale getirmektir.</p><h3>Proje</h3><ol><li>Kütüphaneler</li></ol><p>Modelimizi geliştirmek için kullanılan kütüphaneler:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dec934649df43969d1c6815711e824dd/href">https://medium.com/media/dec934649df43969d1c6815711e824dd/href</a></iframe><h3>Veri Ön İşleme</h3><p>Ham datamızdaki Null değerleri kontrol ettiğimizde, ‘rehber’ kolonunda Null değerler olduğunu tespit ettik ve bu değerleri kaldırarak veri temizleme sürecine başladık. Ardından, ham verimizi, pivot tabloya benzer bir formatta dönüştürerek analiz edilebilir hale getirdik. İşte sürecin detaylı bir özeti:</p><h3>Veri İşleme Adımları:</h3><ol><li><strong>Gruplama ve Özetleme:</strong> Ham veri setimiz, rehber kolonuna göre gruplandı ve belirli metrikler hesaplandı:</li></ol><ul><li><strong>Toplam Arama Sayısı (</strong><strong>toplam_arama)</strong>: Her rehber için yapılan toplam arama sayısı.</li><li><strong>Ulaşılan Arama Sayısı (</strong><strong>ulasilan)</strong>: Yalnızca &quot;Giden Arama&quot; olan aramalar sayıldı.</li><li><strong>Toplam Süre (</strong><strong>toplam_sure)</strong>: Her rehberin tüm arama sürelerinin toplamı.</li></ul><p><strong>2. Yeni Kolonlar Eklenmesi:</strong></p><ul><li><strong>Ulaşma Oranı (</strong><strong>ulasma_orani)</strong>: Ulaşılan arama sayısının toplam arama sayısına oranı yüzde olarak hesaplandı.</li><li><strong>Ortalama Günlük Dakika (</strong><strong>ortalama_gunluk_dk)</strong>: Toplam süre (saniye), 300&#39;e bölünerek (60 saniye* 5 iş günü) ortalama günlük dakika hesaplandı.</li></ul><p><strong>3. Ek Bilgi Eklenmesi:</strong></p><ul><li>Toplam süre sütunu analizde kullanılmayacağı için tablodan çıkarıldı.</li><li>rehber kolonuna göre manuel olarak tanımlanan alınan ödeme değerleri eklendi ve rehber isimleriyle eşleştirildi.</li></ul><p><strong>4. Ortalama Değerlerin Eklenmesi:</strong></p><ul><li>Tablonun yorumlanmasını kolaylaştırmak amacıyla, sütunların ortalama değerleri hesaplanarak yeni bir satır olarak tablonun sonuna eklendi.</li></ul><p><strong>5. Ek Bilgiler:</strong></p><ul><li>Her satıra ait ekip numarası ekip_no sütunu eklenerek rehberler gruplandı.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6de6c19922435214a131c7c60b82eba4/href">https://medium.com/media/6de6c19922435214a131c7c60b82eba4/href</a></iframe><p>DataFrame’imizin son hali:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*gA0TJ-BsGo8Yw9QzzAJf2w.jpeg" /><figcaption>final_df</figcaption></figure><h3>Puanlama Kriterleri:</h3><p>Veri setindeki her kolon için puanlama şu kurallara göre yapıldı:</p><ul><li><strong>En yüksek performans (max değer)</strong>: 3 puan alır.</li><li><strong>Ortalama değerin üzerinde olan</strong>: 2 puan alır.</li><li><strong>Ortalamanın %95’i ile ortalama arasında olan</strong>: 1 puan alır.</li><li><strong>Ortalamanın %95’inin altında olan</strong>: 0 puan alır.</li></ul><p>Bu kurallar, performansların daha adil ve detaylı bir şekilde karşılaştırılmasını sağladı. Puanlamanın kurallarını puan_verme() fonksiyonunda sağladık. Her kolonun puanları hesaplanıp toplam bir Puan sütunu olarak veri setine eklendi:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5888f406763c96a465d8273387f743ac/href">https://medium.com/media/5888f406763c96a465d8273387f743ac/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*aRcU_G21W3CucSRKOAgu9Q.jpeg" /><figcaption>Puanlama</figcaption></figure><h3>Otomatik Yorumlama Süreci</h3><p>Kod, her çalışan için performans verilerini ortalama değerlerle karşılaştırarak, iyi performans gösterenleri övgüyle, ortalamanın altında kalanları ise yapıcı eleştirilerle değerlendirir.</p><p>Veri setindeki her çalışan için, ortalama değerlerle karşılaştırmalı bir analiz yapıldı:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba842b9c33fda04077988636292ad74a/href">https://medium.com/media/ba842b9c33fda04077988636292ad74a/href</a></iframe><ul><li>Her satırdaki performans değerleri (toplam arama, ulaşılan arama sayısı, ulaşma oranı, alınan ödeme, vb.) ortalama değerlerle kıyaslandı.</li><li>ChatGPT API kullanılarak, bu değerler baz alınarak her çalışanın performansına dair 3–4 cümlelik Türkçe yorumlar üretildi. Bu yorumlar, yüksek performanslı çalışanları öven, düşük performans gösterenler için ise yapıcı eleştiriler içeren kısa değerlendirmelerden oluştu.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*acJd37WQjdGX9igdJTAJBQ.jpeg" /></figure><h3>Sonuç</h3><p>Bu otomatik sistem sayesinde, çağrı merkezi çalışanlarının performansı hızlı ve tutarlı bir şekilde değerlendirildi. İyi performans gösterenler teşvik edilirken, ortalamanın altında kalanlar için yapıcı geri bildirim ve tavsiyeler belirtildi. Bu, yöneticiye zamandan tasarruf sağlarken, çalışanların daha iyi anlaşılmasına ve yönlendirilmesine de katkı sağlayan bir proje oldu. Ayrıca final_df.to_excel() kullanarak raporumuzun excel çıktısını alıp, renklendirerek, raporlamaya uygun hale getirebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*Jh69WoOa8I1kCmxwLFv3Qw.jpeg" /><figcaption>Puan Tablosu</figcaption></figure><p>Yazımı okuduğunuz ve vakit ayırdığınız için teşekkür ederim. <a href="https://www.linkedin.com/in/g%C3%B6kberk-abdullah-ab6558212/">LinkedIn</a> ve <a href="https://github.com/abdullahgokberk">Github</a> hesaplarımı ziyaret edebilirsiniz.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c5fbfe52f4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kırmızı Şarap Kalitesinin Makine Öğrenmesi Teknikleriyle Tahmini]]></title>
            <link>https://medium.com/@abdullahgokberk/k%C4%B1rm%C4%B1z%C4%B1-%C5%9Farap-kalitesinin-makine-%C3%B6%C4%9Frenmesi-teknikleriyle-tahmini-1c6905066ebd?source=rss-40b91bbad9f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c6905066ebd</guid>
            <category><![CDATA[wine]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[csv]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Gökberk Abdullah]]></dc:creator>
            <pubDate>Sun, 02 Jan 2022 15:38:32 GMT</pubDate>
            <atom:updated>2022-01-02T16:02:11.077Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XF2h10s2heCXzUsuMracIA.jpeg" /></figure><h3><strong>Giriş</strong></h3><p>İTÜ-Büyük Veri ve İş Analitiği Uzmanlığı Sertifika Programı kapsamında hazırlanan bu proje kırmızı şarapların kalitesini tahmin etmek için farklı makine öğrenmesi teknikleri kullanılarak hazırlandı.</p><p>Verinin kaynağına <a href="https://www.kaggle.com/danielpanizzo/wine-quality">bu siteden</a> ulaşabilirsiniz.</p><p>Projenin kodlarına <a href="https://github.com/abdullahgokberk/Wine-Predict/blob/main/Untitled.ipynb">buradan</a> ulaşabilirsiniz.</p><h3>Verinin Hikayesi</h3><p>Yukarıdaki referansta, Portekiz “Vinho Verde” kırmızı şarap çeşitleri kullanılarak veri seti oluşturulmuştur. Girdiler nesnel testleri (ör. PH değerleri) içerir ve çıktı duyusal verilere dayanır. (şarap uzmanları tarafından yapılan en az 3 değerlendirmenin medyanı). Her uzman şarap kalitesini 0 (çok kötü) ile 10 (çok mükemmel) arasında derecelendirdi. Gizlilik ve lojistik sorunlar nedeniyle, yalnızca fizikokimyasal (girdiler) ve duyusal (çıkış) değişkenler mevcuttur (örneğin, üzüm türleri, şarap markası, şarap satış fiyatı vb. hakkında veri yoktur).</p><p><strong>Verilerin Listesi ve Açıklaması</strong></p><p>Girdiler (fizikokimyasal testlere dayalı):<br>1 — fixed acidity: şarapla ilgili çoğu asit, sabit ve uçucu olmayan (kolayca buharlaşmaz).</p><p>2 — volatile acidity: şaraptaki asetik asit miktarı, ki bu çok yüksek seviyelerde olduğunda hoş olmayan bir sirke tadına neden olabilir.</p><p>3 — citric acid: küçük miktarlarda bulunan sitrik asit, şaraplara ‘tazelik’ ve lezzet katabilir.</p><p>4 — residual sugar: fermantasyon durduktan sonra kalan şeker miktarı, 1 gram/litreden az şarap bulmak nadirdir ve 45 gram/litreden fazla şaraplar tatlı olarak kabul edilir.</p><p>5 — chlorides: şaraptaki tuz miktarı.</p><p>6 — free sulfur dioxide: SO2&#39;nin serbest formu, moleküler SO2 (çözünmüş bir gaz olarak) ve bisülfit iyonu arasında dengede bulunur; mikrobiyal büyümeyi ve şarabın oksidasyonunu önler.</p><p>7 — total sulfur dioxide: S02&#39;nin düşük konsantrasyonlarda serbest ve bağlı formlarının miktarı; SO2 şarapta çoğunlukla tespit edilemez, ancak 50 ppm’nin üzerindeki serbest SO2 konsantrasyonlarında, SO2 şarabın burnunda ve tadında belirgin hale gelir.</p><p>8 — density: Suyun yoğunluğu, yüzde alkol ve şeker içeriğine bağlı olarak suya yakındır.</p><p>9 — pH: 0 (çok asidik) ile 14 (çok bazik) arasında bir skalada bir şarabın ne kadar asidik veya bazik olduğunu açıklar; çoğu şarap pH ölçeğinde 3–4 arasındadır.</p><p>10 — sulphates: Antimikrobiyal ve antioksidan görevi gören kükürt dioksit gazı (S02) seviyelerine katkıda bulunabilen bir şarap katkı maddesi</p><p>11 — alcohol: şarabın yüzde alkol içeriği</p><p>Çıktı (duyusal verilere göre):<br>12 — quality (0 ile 10 arasında skora sahip)</p><h3>Problem</h3><p>Bu projedeki problemimiz kırmızı şarap değişkenlerinin arasındaki ilişkiyi ve bu değişkenlerin şarabın kalitesinin iyi (quality değeri 6 dan yüksek olanlar) veya kötü (quality değeri 6 ve daha düşük olanlar) olarak sınıflandırması şeklinde tahmin edilmesidir. Proje kapsamında farklı sınıflandırma modelleri:</p><ul><li>Lojistik Regresyon</li><li>Support Vector Classifier</li><li>Yapay Sinir Ağları</li></ul><p>Model performanslarını optimize etmek ve karşılaştırmak için:</p><ul><li>Grid Search CV</li><li>Cross Validation Score kullanılmıştır.</li></ul><h3>Proje</h3><ol><li><strong>Kütüphaneler</strong></li></ol><p>Modelimizi geliştirmek için kullanılan kütüphaneler:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d79d302ec39d32b23724c81740a51bed/href">https://medium.com/media/d79d302ec39d32b23724c81740a51bed/href</a></iframe><p>2. <strong>Veriyi tanıma ve düzenleme</strong></p><p>Datamızı pd.read_csv() komutu ile okuyoruz ve info() ile genel bilgi sahibi oluyoruz. Yapacağımız işlemler verimize kalıcı değişiklik uygulayacağı için copy() ile bir kopyasını oluşturmak daha sağlıklı olacaktır. Kopyalama işleminden sonra Indexlerin de bir sütun halinde geldiğini görüyoruz bu sütunu silmek için sadece istediğim sütunları seçip atama işlemi gerçekleştirdim. Kolon isimlerinin bazıları nokta (.) içeriyordu. Bu durum seçme işlemlerinde (df.fixed.acidity (hata veriyor)) sorun yaratacağından dolayı isimleri yeniden düzenleyip atama yaptım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*lewLal_E9jD3gnKPNlnTMw.jpeg" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/883261be2dce39b9511005454549329e/href">https://medium.com/media/883261be2dce39b9511005454549329e/href</a></iframe><p>Son hali ve eksik değerlerinin olup olmadığı hakkında detaylı bilgi:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*x5ea2CSS-2Z3k8dJuGQZvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*7-_2tQxCCukNUKXaPPz1HQ.png" /></figure><p>3.<strong> Keşifçi Veri Analizi ve Veri Görselleştirme</strong></p><p>Verimizi daha iyi tanımak ve farklı kolonların çıktımızı (quality) nasıl etkilediğini anlamak için çeşitli görselleştirme teknikleri kullanıldı. Öncelikle kolonların birbirleriyle aralarındaki korelasyonunun ısı haritasına bakmak genel bir bilgi sahibi olmamızı sağlayacaktır:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*qR0FecoTh-96g3AgRkD-Xw.png" /></figure><p>Bu kısımda daha detaylı bilgi için plt.subplots kullanarak tek hücre içerisinde sol tarafta olasılık yoğunluk fonksiyonunun grafiğini, sağ tarafta ise kutu grafiğini veriyi yorumlamak adına kullandım. Tahmin etmeyi hedeflediğimiz değer “quality” olduğu için verimizdeki diğer 11 kolonu “quality” ile karşılaştırdım.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a56d8daa842087b4beeefeb7e18a2cf8/href">https://medium.com/media/a56d8daa842087b4beeefeb7e18a2cf8/href</a></iframe><p>Hem korelasyon ısı haritası hem de kutu grafikleri incelendiğinde fixed_acidity’nin quality üzerindeki etkisi yok denecek kadar az.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*gtTEf77ZfAmuYyKlHBgMYg.png" /><figcaption>fixed_aciditiy ile quality</figcaption></figure><p>volatile_acidity’nin miktarı azaldıkça quality’nin arttığını görüyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*n_82D0ADVEg2jg4tat8Uow.png" /><figcaption>volatile_acidity ile quality</figcaption></figure><p>Kutu grafikle sıkışan tablolar bar grafiği ile de ayrıca incelendi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*lg64liF13xUTtO0luZ8NZw.png" /><figcaption>chlorides ile quality</figcaption></figure><p>quality üzerindeki en büyük etkinin alkolün artışıyla yaşandığını görüyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*1i9mWD1Pct7_eq-_ZDRjfg.png" /><figcaption>alcohol ile quality</figcaption></figure><p>Kalan incelemeleri <a href="https://github.com/abdullahgokberk/Wine-Predict/blob/main/Untitled.ipynb">kod kısmından</a> görebilirsiniz.</p><p>4. <strong>Veri Ön İşleme</strong></p><p>Ana problemimiz kalitenin iyi ve kötü şeklinde ikiye ayrılmasına dayandığı için quality’nin 6 dan büyük olduğu değerlere 1 , 6&#39;ya eşit ve küçük olduğu değerlere 0 dedik. Ayrıca quality kolonunu y, diğer kolonları ise X’e atadık ardından modelleri oluşturmadan önce train_test_split() kullanarak datamızın yüzde 20&#39;sini test yüzde 80&#39;ini train (modeli eğiten kısım) olacak şekilde ayırdık. Artık datamız ile model kurmaya hazırız.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59e250b57081a19b0a3a485dc8e60c05/href">https://medium.com/media/59e250b57081a19b0a3a485dc8e60c05/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*PoG_Xc1HdyUZtsgjV1qH3A.png" /><figcaption>quality’nin son durumu</figcaption></figure><p>5. <strong>Model Oluşturma</strong></p><p>a. <strong>Lojistik Regresyon</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f0d9d28bfedd2445ad66134d18d10f49/href">https://medium.com/media/f0d9d28bfedd2445ad66134d18d10f49/href</a></iframe><p>Modelimizi X_train ve y_train ile kurduk, tahminimizi X_test e göre yaptık. Şimdi yaptığımız tahminleri gerçek değerleriyle karşılaştıralım ve test hatamıza bakalım.</p><p>Confusion matriximiz bu şekilde :</p><pre>array([[271,   8],<br>       [ 26,  15]], dtype=int64)</pre><p>Modelimizin nasıl performans gösterdiğini görelim :</p><pre>                precision    recall  f1-score   support<br><br>           0       0.91      0.97      0.94       279<br>           1       0.65      0.37      0.47        41<br><br>    accuracy                           0.89       320<br>   macro avg       0.78      0.67      0.70       320<br>weighted avg       0.88      0.89      0.88       320</pre><p>cross_val_score() kullanarak test hatamıza bakıyoruz. Bu değer bizim modelimizin diğer modellerle karşılaştırılabilmesi için doğruluk skorunu veriyor. Daha doğru değerlendirme için bu değerlerin 10 tanesini alıp ortalamasına bakıyoruz ve sonuç :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*-yK2JW2joix7Cc5TXwBZvA.png" /><figcaption>test hatası</figcaption></figure><p>b. <strong>Support Vector Classifier</strong></p><ul><li>GridSearchCV</li></ul><p>Modelin kodlarını vermeden önce modelimizi GridSearchCV ile nasıl optimize ettiğimize bakalım. Farklı parametreler için verdiğimiz tüm değerleri birbirleriyle deneyen (brute force) GridSearchCV sayesinde default şekilde modelde bulanan bazı değerler yerine bizim datamıza en uygun olan parametreleri bulup modeli ona göre baştan kuruyoruz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/22a3879de6d3ac2bccc91efcacb62ae4/href">https://medium.com/media/22a3879de6d3ac2bccc91efcacb62ae4/href</a></iframe><p>Modelimiz :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/413255a3ce6b5c751f27ecfab7efb0ca/href">https://medium.com/media/413255a3ce6b5c751f27ecfab7efb0ca/href</a></iframe><p>modelimizin performansı :</p><pre>               precision    recall  f1-score   support<br><br>           0       0.90      1.00      0.95       279<br>           1       1.00      0.27      0.42        41<br><br>    accuracy                           0.91       320<br>   macro avg       0.95      0.63      0.69       320<br>weighted avg       0.92      0.91      0.88       320</pre><p>accuracy_score (test hatamız) :</p><pre>0.90625</pre><p>Daha iyi sonuç ve karşılaştırılabilirlik açısından :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*ZkDujBrOr4gQu179KKYLew.png" /><figcaption>10 tane test hatasının ortalaması</figcaption></figure><p>c. <strong>Yapay Sinir Ağları</strong></p><p>Yapay sinir ağları metodunda kullanacağımız X_train ve X_test’in StandardScaler() ile standardlaştırma (ölçeklendirme) işlemine sokmalıyız.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b95db3237020b0bee36785c330d9e3d/href">https://medium.com/media/4b95db3237020b0bee36785c330d9e3d/href</a></iframe><ul><li>GridSearchCV</li></ul><p>Yapay sinir ağları modelimizi optimize etmek için de GridSearchCV kullanıyoruz :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2e12b35d7a2f25ea253ce4fa01569fa/href">https://medium.com/media/e2e12b35d7a2f25ea253ce4fa01569fa/href</a></iframe><p>Modelimiz :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d390e2fbea5c3dde459af7d1be9ced2/href">https://medium.com/media/9d390e2fbea5c3dde459af7d1be9ced2/href</a></iframe><p>modelimizin performansı :</p><pre>               precision    recall  f1-score   support<br><br>           0       0.95      0.95      0.95       279<br>           1       0.64      0.66      0.65        41<br><br>    accuracy                           0.91       320<br>   macro avg       0.80      0.80      0.80       320<br>weighted avg       0.91      0.91      0.91       320</pre><p>accuracy_score (test hatamız) :</p><pre>0.909375</pre><p>Daha iyi sonuç ve karşılaştırılabilirlik açısından :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*9enCnrKBwy-gEzchW3euzA.png" /><figcaption>10 tane test hatasının ortalaması</figcaption></figure><h3>Sonuç</h3><p>Üzüm türleri, şarap fiyatları ve markaları gibi çeşitli bilgilere de sahip olsaydık daha yüksek doğruluk oranlarına ulaşabilirdik hatta fiyat performans analizi de yapabilirdik diye düşünüyorum. Elimizdeki data ve kurduğumuz modeller kapsamında en iyi modelimiz 0.878125&#39;lik skoruyla Support Vector Classifier oldu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*ZWj79QBJcUdAWcax0Cp3sg.png" /></figure><p>Yazımı okuduğunuz ve vakit ayırdığınız için teşekkür ederim. Daha detaylı bilgi için <a href="https://www.linkedin.com/in/g%C3%B6kberk-abdullah-ab6558212/">LinkedIn</a> ve <a href="https://github.com/abdullahgokberk">Github</a> hesaplarımı ziyaret edebilirsiniz.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c6905066ebd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>