<?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 Beyza Uludağ on Medium]]></title>
        <description><![CDATA[Stories by Beyza Uludağ on Medium]]></description>
        <link>https://medium.com/@beyzakendirli?source=rss-4d26f1188692------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*K7oUmf4RbJSj_BgS5fwq5w@2x.jpeg</url>
            <title>Stories by Beyza Uludağ on Medium</title>
            <link>https://medium.com/@beyzakendirli?source=rss-4d26f1188692------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:28:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@beyzakendirli/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[AI Agent Nedir & Nasıl Çalışır: Örnek Bir Akış Üzerinden İnceleyelim]]></title>
            <link>https://medium.com/@beyzakendirli/ai-agent-nedir-nas%C4%B1l-%C3%A7al%C4%B1%C5%9F%C4%B1r-%C3%B6rnek-bir-ak%C4%B1%C5%9F-%C3%BCzerinden-i%CC%87nceleyelim-6ea29bb650d2?source=rss-4d26f1188692------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ea29bb650d2</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Beyza Uludağ]]></dc:creator>
            <pubDate>Mon, 12 Jan 2026 14:42:39 GMT</pubDate>
            <atom:updated>2026-01-12T14:42:39.537Z</atom:updated>
            <content:encoded><![CDATA[<p>Son dönemlerde yapay zekânın nasıl bir atılım yaptığını ve kısa bir süre içerisinde oldukça yüksek bir ivmeyle nasıl geliştiğini artık hepimiz biliyoruz :) İlk aşamada yapay zekâ daha çok sınıflandırma, tahmin ve optimizasyon gibi görevleri yerine getiren karar ve tahmin modelleri<strong> </strong>ile sınırlıydı; modeller belirli bir girdiye karşılık tekil bir çıktı üretir, sürecin geri kalanına müdahil olmazdı. Zamanla derin öğrenme ve büyük veri altyapılarının olgunlaşmasıyla birlikte Generative AI yani üretken yapay zekâ kavramı ortaya çıktı ve yapay zekâ yalnızca karar veren değil, metin, kod, görsel ve ses üretebilen bir yapıya evrildi.</p><p>Bugün gelinen noktada ise bu üretken modeller, planlama, hafıza ve araç kullanma yetenekleriyle birleşerek <strong>AI agent</strong> kavramını doğurdu.</p><p>AI agent’lar; belirli bir hedef doğrultusunda çevresini <strong>algılayabilen</strong>, aldığı geri bildirimlere göre <strong>plan yapabilen</strong> ve gerektiğinde birden fazla aracı ya da modeli birlikte kullanarak süreci <strong>uçtan uca yönetebilen</strong> otonom sistemlerdir.</p><p>Agent’lar en temelde iki önemli bileşenden oluşur, gelişmiş bir dil modeli (LLM) ve araçlar (tools).</p><ul><li>LLM (Large Language Model) : LLM’ler, çok büyük metin veri setleri üzerinde eğitilmiş ve dili istatistiksel olarak öğrenmiş yapay zekâ modelleridir. Temel amaçları, girdiyi (user input) <strong>anlamak</strong> ve <strong>anlamlı çıktı üretmektir</strong>.</li><li>Tools : Agentic dünyada tool’lar, agent’ın <strong>yalnızca metin üretmekle kalmayıp</strong> dış dünyayla <strong>etkileşime geçmesini</strong> sağlayan araçlardır. Bir LLM tek başına düşündüğünde yalnızca dil üretir; ancak bir tool kullanabildiğinde veri çekebilir, kod çalıştırabilir, bir API’ye istek atabilir ya da bir sistem üzerinde aksiyon alabilir. <em>Bu nedenle tool’lar, agent’ları pasif bir “yanıt motoru”ndan aktif bir “iş yapan” yapıya dönüştüren en kritik bileşenlerden biridir.</em></li></ul><p>Bir agent çalışırken önce kullanıcının amacını analiz eder ve bu hedefe ulaşmak için bir plan oluşturur. Ardından hangi adımda hangi tool’a ihtiyaç duyduğuna karar verir.</p><p>Daha iyi anlayabilmek adına aşağıdaki örneği ve agent’ın çalışma mantığını beraber inceleyelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oP65RgzI_5oxNR5wOatUVQ.png" /><figcaption>Örnek bir agent çalışma akışı</figcaption></figure><ul><li><strong>User input </strong>: Burada kullanıcının amacı; 7 ile 3&#39;ün çarpımının kaç olduğunu anlamaktır. “What is 7*3?” şeklinde bir girdi ile sorusunu yöneltir. Bu girdilere aynı zamanda <strong>prompt</strong> da denir. Modele iyi bir girdi vermek yani iyi bir prompt yazmak modelin doğru sonuç üretmesinde oldukça önemlidir.</li><li><strong>LLM :</strong> User input LLM’e iletilir ve burada modelin yapması gereken; girdiyi anlamak ve doğru sonucu üretebilmek için hangi tool’un kullanılması gerektiğine karar vermektir. Model; girdideki çarpma işlemi işaretini yakalar ve tanımlı tool’lar içerisinden doğru tool olan çarpma tool’unu seçerek girdideki parametreleri yani 7 ve 3 rakamlarını çarpma tool’una iletir.</li><li><strong>Tools :</strong> Tool parametreleri alır ve tanımı gereği 7 ve 3 rakamlarını çarparak ilgili çıktıyı üretir. Daha sonrasında ürettiği çıktıyı modele geri gönderir ve model tool’un ürettiği nihai çıktıyı son kullanıcıya ileterek akışı tamamlar.</li></ul><p>AI agent’lar ile yapabileceklerimizin sınırı yokmuş gibi görünse de; bu gücün beraberinde bir maliyet ve sorumluluk getirdiğini unutmamak gerekiyor. Her tool çağrısı, her aksiyon ve her karar hem teknik hem de operasyonel bir bedel yaratıyor. Bu nedenle AI agent’ları sınırsız yetkilerle donatmak yerine, nerede durmaları gerektiğini bilen, kontrollü ve bilinçli akışlar tasarlamak asıl farkı yaratacak gibi duruyor.</p><p>Bu yazımda kendi bilgi birikimimi ve gözlemlerimi sizlerle de paylaşmak istedim, vakit ayırıp okuduğunuz için teşekkür ederim :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ea29bb650d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Veri Konuşur: Tableau ile İleri Analitik ve Akıllı İçgörüler]]></title>
            <link>https://medium.com/sahibinden-technology/veri-konu%C5%9Fur-tableau-ile-i%CC%87leri-analitik-ve-ak%C4%B1ll%C4%B1-i%CC%87%C3%A7g%C3%B6r%C3%BCler-d019c4f84d21?source=rss-4d26f1188692------2</link>
            <guid isPermaLink="false">https://medium.com/p/d019c4f84d21</guid>
            <category><![CDATA[clustering]]></category>
            <category><![CDATA[tableau]]></category>
            <category><![CDATA[advanced-analytics]]></category>
            <category><![CDATA[correlation]]></category>
            <category><![CDATA[trendline]]></category>
            <dc:creator><![CDATA[Beyza Uludağ]]></dc:creator>
            <pubDate>Tue, 30 Dec 2025 11:45:13 GMT</pubDate>
            <atom:updated>2026-03-03T13:23:24.261Z</atom:updated>
            <content:encoded><![CDATA[<p>Günümüzde veri artık sadece raporlanan rakamlardan ibaret değil; doğru yöntemlerle ele alındığında geleceği öngörebilen, karar süreçlerini güçlendiren stratejik bir varlığa dönüşmüş durumda. Kurumlar için rekabet avantajı yaratmanın yolu, yalnızca veriye sahip olmaktan değil, <strong>veriden doğru ve aksiyon alınabilir içgörüler </strong>üretebilmekten geçiyor. İşte burada, analitik düşünme becerisi ve ileri analitik yöntemler devreye giriyor.</p><p>İleri analitik; istatistiksel yöntemler, tahminleme modelleri ve veri keşfi teknikleriyle verinin arkasındaki gizli ilişkileri ortaya çıkarmayı, “ne oldu?” sorusunun ötesine geçerek “neden oldu?” ve “sonra ne olabilir?” sorularına yanıt vermeyi amaçlar. Tableau; verileri hızlı ve etkileşimli bir şekilde görselleştirmeye yarayan, ileri analitik yöntemlerin uygulanabildiği, kullanıcı dostu bir iş zekâsı<strong> </strong>raporlama aracıdır. Bu yazıda Tableau’nun ileri analitik fonksiyonlarının nasıl kullanılabileceği ve üretilen çıktılar ile nasıl içgörüler geliştirilebileceği ile ilgili bilgi paylaşımı yapmak amaçlanmıştır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*-KS0cK2C7TOLU24OW_az_w.png" /></figure><p>Çalışma kapsamında Türkiye İstatistik Kurumu’nun resmi sitesinde yayımladığı 2019–2024 yılları arasına ait konut satış istatistikleri, genel nüfus sayımları ve ikâmet amaçlı daire yapı izin istatistikleri; tarih ve il bazında tek bir tabloda birleştirilerek kullanılmıştır. İlgili veri setine <a href="https://github.com/beyzakendirli/tableau_ileri_analitik">github</a> hesabım üzerinden erişebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fuxsSAnqnHCtzwmaSx6wUg.png" /><figcaption>Tarih ve il bazlı Türkiye İstatistik Kurumu verileri</figcaption></figure><h3>Korelasyon Katsayısı</h3><p>Korelasyon, iki sayısal değişken arasındaki <strong>ilişkinin yönünü ve gücünü</strong> ölçer. Temel olarak şu soruya cevap verir: bir değişken artarken veya azalırken diğeri nasıl davranıyor? Korelasyon katsayısı ise iki değişkenin arasındaki bu ilişkinin katsayısıdır. Bu katsayının mutlak değeri 1&#39;e ne kadar yakın olursa, iki değişken arasındaki ilişki o kadar kuvvetli demektir. Tableau, korelasyon hesaplamalarında varsayılan olarak Pearson Korelasyon modelini kullanır.</p><p>Çalışma kapsamında 2019–2024 yılları arasında Türkiye geneli konut satış adetleri ve nüfus bilgisi arasındaki korelasyon katsayısı hesaplanmış ve model 0.97 sonucunu üretmiştir.</p><p><strong>İçgörü:</strong> Türkiye genelinde konut satışlarının mekânsal ve zamansal dağılımı, nüfusun dağılımı ile büyük ölçüde paralel hareket etmektedir. Konut talebi Türkiye genelinde nüfusun yoğunlaştığı bölgelerde belirgin şekilde kümelenmektedir. Nüfus bilgisi, konut satışları için güçlü bir öncü gösterge olarak değerlendirilebilir ve <em>nüfus artış hızının yüksek olduğu bölgelerde konut arzı planlaması, talep baskısını dengelemek açısından kritik öneme sahiptir.</em></p><h3>Clustering</h3><p>Clustering (kümeleme), benzer özelliklere sahip gözlemleri önceden bir etiketleme olmadan (unsupervised learning) gruplara ayıran bir analiz yöntemidir. Veri setindeki <strong>doğal segmentleri</strong> keşfetmeyi ve karmaşık verileri daha <strong>anlamlı gruplara</strong> ayırmayı amaçlar. Temel olarak şu soruya cevap verir: bu veriler doğal olarak hangi gruplara ayrılıyor?</p><p>Tableau, görselleştirme üzerinde doğrudan otomatik kümeleme yapmayı mümkün kılar. Kullanıcı herhangi bir algoritmayı manuel yazmaz; Tableau arka planda kümeleme modelini çalıştırır ve varsayılan olarak K-Means clustering algoritmasını kullanır.</p><p>Çalışma kapsamında 2024 yılı Türkiye geneli konut satış adedi ve nüfus verileri clustering algoritması kullanılarak analiz edilmiş ve model illeri beş doğal segmente ayırmıştır.</p><ul><li>İstanbul, hem nüfus büyüklüğü hem de konut satış adedi açısından diğer tüm illerden belirgin şekilde ayrışarak tek başına bir küme oluşturmuştur.</li><li>Ankara da yine diğer illerden belirlin şekilde ayrışarak üst segmentte ayrı bir kümede konumlanmıştır. Ankara’nın konumlandığı küme, başkent olmanın getirdiği görece istikrarlı talep, kamu ve hizmet sektörü ağırlıklı nüfus yapısı gibi faktörlerin konut piyasasına doğrudan yansıdığını göstermektedir.</li><li>İzmir, Bursa ve Antalya gibi iller; orta–yüksek nüfus ve yüksek konut satış hacmi özellikleriyle <strong>büyükşehir konut piyasası</strong> segmentini temsil etmektedir. Bu küme, ekonomik çeşitliliği yüksek, göç alan ve turizm veya sanayi etkisi güçlü turizm veya sanayi etkisi güçlü illerin benzer konut dinamiklerine sahip olduğunu ortaya koymaktadır.</li><li>Adana, Mersin, Diyarbakır, Aydın gibi iller; orta düzey nüfus ve görece daha sınırlı konut satış hacmi özellikleriyle <strong>gelişen veya bölgesel merkez</strong> segmentini temsil etmektedir.</li><li>Grafiğin sol-alt kısmında yoğunlaşan iller; düşük nüfus ve düşük konut satış adedi özellikleriyle <strong>küçük ölçekli konut piyasaları</strong> segmentini temsil etmektedir.</li></ul><p><strong>İçgörü</strong>: Ortaya çıkan kümeler, <em>Türkiye’de konut piyasasının merkezileşmiş ve hiyerarşik bir yapıya sahip olduğunu ve konut piyasasının tek tip bir yapıdan ziyade segment bazlı değerlendirilmesi gerektiğini açıkça göstermektedir.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ou3iLhOCNwRSCEU17kh1pg.png" /><figcaption>Korelasyon Katsayısı ve Clustering</figcaption></figure><h3>Trendline</h3><p>Trendline, bir görselleştirme üzerindeki verilerin genel eğilimini (trendini) gösteren istatistiksel bir doğrudur. Tableau’da trendline’lar, verideki <strong>artış, azalış veya durağanlık</strong> <strong>eğilimlerini</strong> görsel olarak analiz etmeyi sağlar. Temel olarak şu soruya cevap verir: Veri zaman içinde ya da iki değişken arasında nasıl bir eğilim gösteriyor?</p><p>Çalışma kapsamında 2024 yılı Türkiye geneli konut satış adedi ve nüfus bilgisi verileri arasındaki ilişki incelenmiş ve kurulan doğrusal regresyon modeli pozitif eğimli bir trendline üretmiştir.</p><p><strong>R-Squared:</strong> Modelin R-Squared değeri 0.946813 olarak hesaplanmıştır. Bu değer, kurulan doğrusal modelin konut satış adetlerindeki değişimin yaklaşık %94,7’sini nüfus değişkeniyle açıkladığını göstermektedir.</p><p><strong>P-value:</strong> Modelin p-value değeri 0.0001 olarak hesaplanmıştır. Bu değer, modeldeki ilişkinin istatistiksel olarak son derece anlamlı olduğunu gösterir.</p><p><strong>İçgörü: </strong>Trendline’ın pozitif eğimli olması, <em>nüfus arttıkça konut satış adetlerinin de genel olarak arttığını ortaya koymaktadır.</em> Trendline’ın üzerinde konumlanan illerde, örneğin İstanbul ve İzmir’de, nüfus büyüklüğüne kıyasla konut satışlarının görece yüksek olduğu görülmekte olup, bu durum söz konusu illerde konut talebinin ortalamanın üzerinde seyrettiğine işaret etmektedir.</p><p>2023 yılında meydana gelen ve 11 ilimizi etkileyen deprem sonrası dönemde, bazı illerde konut satış adetlerinin trendline’ın üzerinde konumlanması; yeniden yapılaşma ve artan konut ihtiyacı gibi faktörlerin konut piyasası üzerindeki etkisini düşündürmektedir. Ancak bu bulgu, doğrudan bir nedensellik ilişkisi kurmaktan ziyade, ileri analizler için önemli bir gösterge niteliği taşımaktadır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*73YG8r3JHXv4V2dqg8SZ5w.png" /><figcaption>Trendline</figcaption></figure><p>Bu trend analizi incelenirken; konut talebinin yalnızca nüfus büyüklüğüyle açıklanamayacağının altını çizmek gerekir. Konut satışlarının artmasının bir diğer olası nedeni, ilgili ilde inşa edilen yeni konut adedinin artması olabilir. Bu çıkarımı desteklemek için Türkiye İstatistik Kurumu’nun resmi sitesinde yayımlanan ikâmet amaçlı daire yapı izin istatistikleri verisi incelenmiştir.</p><p>Trendline’ın üzerinde konumlanan illerde, örneğin İstanbul’da, 2024 yılında ikâmet amaçlı daire yapı izin adedi 121.440 iken, trendline’ın altında konumlanan illerde, örneğin Ankara’da, 2024 yılında ikâmet amaçlı daire yapı izin adedi 49.681&#39;dir. Bu rakamlar; konut talebinin yalnızca nüfus büyüklüğüyle açıklanamayacağını ve bölgesel dinamiklerin konut talebi üzerindeki etkisinin göz ardı edilmemesi gerektiğini göstermektedir.</p><p>Bu yazıda Tableau’nun ileri analitik yetkinliklerini kullanarak konut satışları ve nüfus verilerinin nasıl birlikte okunabileceğine ve içgörüler üretilebileceğine dair örnekler paylaştım, umuyorum faydalı olmuştur. Yazma sürecimde model çıktılarını değerlendirmemde desteklerini esirgemeyen Meriç Çevik’e ve vakit ayırıp okuduğunuz için sizlere teşekkür ederim :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d019c4f84d21" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sahibinden-technology/veri-konu%C5%9Fur-tableau-ile-i%CC%87leri-analitik-ve-ak%C4%B1ll%C4%B1-i%CC%87%C3%A7g%C3%B6r%C3%BCler-d019c4f84d21">Veri Konuşur: Tableau ile İleri Analitik ve Akıllı İçgörüler</a> was originally published in <a href="https://medium.com/sahibinden-technology">Sahibinden Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Raw Data to Insights: Cleaning, Indexing and Visualizing Data with Elasticsearch and Kibana]]></title>
            <link>https://medium.com/@beyzakendirli/from-raw-data-to-insights-cleaning-indexing-and-visualizing-data-with-elasticsearch-and-kibana-70beeb9c11b1?source=rss-4d26f1188692------2</link>
            <guid isPermaLink="false">https://medium.com/p/70beeb9c11b1</guid>
            <category><![CDATA[kibana]]></category>
            <category><![CDATA[real-time-data-analytics]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Beyza Uludağ]]></dc:creator>
            <pubDate>Thu, 19 Dec 2024 14:43:19 GMT</pubDate>
            <atom:updated>2024-12-19T14:43:19.873Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi. In this article, I will demonstrate the process of indexing and visualizing raw data using Elasticsearch and Kibana, following a data cleaning phase performed with Python.</p><p>Elasticsearch is a powerful, open-source search and analytics engine designed for handling large volumes of data with near real-time search capabilities. It is part of the <strong>Elastic Stack</strong>, which includes tools like Beats for data collection, Logstash for data processing and Kibana for data visualization. Elasticsearch performs advanced text-based searches, supports near real-time search and allows for complex data analysis and aggregations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*VKYQXkBKI4sVX4lD8e1Y_Q.png" /><figcaption>Elastic Stack</figcaption></figure><h3>Setting Up Elasticsearch with Docker</h3><p>We need to pull desired version of Elasticsearch Docker image first.</p><pre>docker pull elasticsearch:8.10.0</pre><p>If we have multi-container environments than we need to use docker-compose to orchestrate Elasticsearch and related services (e.g., Kibana). We need to create a docker-compose.yml file and it has to contain elasticsearch, kibana and spark clusters in it.</p><pre>version: &#39;3.7&#39;<br>services:<br>  elasticsearch:<br>    image: elasticsearch:8.10.0<br>    container_name: elasticsearch<br>    environment:<br>      - discovery.type=single-node<br>    ports:<br>      - &quot;9200:9200&quot;<br>      - &quot;9300:9300&quot;</pre><p>Let’s run the setup.</p><pre>docker-compose up -d</pre><h3>Data Cleaning with Python</h3><p>Real-world data often contains inaccuracies, duplicates, or missing values. Cleaning ensures the dataset is accurate and consistent for more reliable and meaningful insights. Besides, many systems or tools (e.g., Elasticsearch, Kibana) require data in a specific format. We’ll clean and format our data with Python in this phase.</p><p>First of all, we need to connect Spark container.</p><pre>docker exec -it spark_client  jupyter lab --ip 0.0.0.0 --port 8888 --allow-root</pre><p>Then, we need to install desired version of Elasticsearch library in Jupyter Lab, as well. After installation, we’ll structure our dataset in 5 steps.</p><pre>! pip install Elasticsearch==8.16.0</pre><h4># Step 1: Download the dataset</h4><pre>url = &quot;https://github.com/erkansirin78/datasets/raw/master/market1mil.csv.gz&quot;<br>try:<br>    response = requests.get(url)<br>    with open(&quot;market1mil.csv.gz&quot;, &quot;wb&quot;) as file:<br>        file.write(response.content)<br>    print(&quot;Dataset downloaded successfully.&quot;)<br>except Exception as e:<br>    print(f&quot;Failed to download the dataset: {e}&quot;)<br>    exit()</pre><h4># Step 2: Connect to Elasticsearch</h4><pre>try:<br>    es = Elasticsearch(&quot;http://localhost:9200&quot;)  # Update the host if needed<br>    if not es.ping():<br>        raise ValueError(&quot;Connection to Elasticsearch failed!&quot;)<br>    print(&quot;Connected to Elasticsearch.&quot;)<br>except Exception as e:<br>    print(f&quot;Failed to connect to Elasticsearch: {e}&quot;)<br>    exit()</pre><h3>Key Components of Elasticsearch</h3><p>Before proceeding, I would like to provide a brief overview of the key components of Elasticsearch.</p><p>Elasticsearch is composed of several key components that work together to enable powerful search and analytics capabilities such as documents, indexes and fields.</p><p><strong><em>Document:</em></strong> A document is a basic unit of information in Elasticsearch. It represents a single record or object, such as a user, product, or log entry.</p><p><strong><em>Index:</em></strong> An index is a collection of documents. It serves as a container for storing and organizing documents in Elasticsearch.</p><p><strong><em>Field:</em></strong> A field is a key-value pair in a document. Fields are used to store and retrieve data. Each field has a name and a value</p><h4># Step 3: Define Elasticsearch Mapping</h4><p>Elasticsearch Mapping refers to the process of defining how the fields in a document are stored and indexed in Elasticsearch. It is essentially the schema definition for your Elasticsearch index, specifying the structure of documents and how their fields are treated. Mapping allows you to control how different types of data are handled, whether they are strings, numbers, dates, or complex objects.</p><pre>try:<br>    index_name = &quot;market-data&quot;<br>    if not es.indices.exists(index=index_name):<br>        mapping = {<br>            &quot;mappings&quot;: {<br>                &quot;properties&quot;: {<br>                    &quot;LOGICALREF&quot;: {&quot;type&quot;: &quot;integer&quot;},<br>                    &quot;ITEMCODE&quot;: {&quot;type&quot;: &quot;integer&quot;},<br>                    &quot;ITEMNAME&quot;: {&quot;type&quot;: &quot;text&quot;},<br>                    &quot;AMOUNT&quot;: {&quot;type&quot;: &quot;float&quot;},<br>                    &quot;PRICE&quot;: {&quot;type&quot;: &quot;float&quot;},<br>                    &quot;LINENETTOTAL&quot;: {&quot;type&quot;: &quot;float&quot;},<br>                    &quot;BRANCH&quot;: {&quot;type&quot;: &quot;keyword&quot;},<br>                    &quot;CITY&quot;: {&quot;type&quot;: &quot;keyword&quot;},<br>                    &quot;BRAND&quot;: {&quot;type&quot;: &quot;keyword&quot;},<br>                    &quot;STARTDATE&quot;: {&quot;type&quot;: &quot;date&quot;},<br>                    &quot;LOCATION&quot;: {&quot;type&quot;: &quot;geo_point&quot;},<br>                }<br>            }<br>        }<br>        es.indices.create(index=index_name, body=mapping)<br>        print(&quot;Elasticsearch index and mapping created.&quot;)<br>    else:<br>        print(&quot;Index already exists.&quot;)<br>except Exception as e:<br>    print(f&quot;Failed to create index or mapping: {e}&quot;)<br>    exit()</pre><h4># Step 4: Load and Clean the Dataset in Chunks</h4><pre>def generate_data_from_chunks():<br>    try:<br>        with gzip.open(&quot;market1mil.csv.gz&quot;, &quot;rt&quot;, encoding=&quot;utf-8&quot;) as file:<br>            chunks = pd.read_csv(file, delimiter=&quot;;&quot;, on_bad_lines=&quot;skip&quot;, chunksize=10000)<br>            for chunk in chunks:<br>                # Preprocess each chunk<br>                chunk.dropna(subset=[&quot;LOGICALREF&quot;, &quot;STARTDATE&quot;, &quot;LINENETTOTAL&quot;], inplace=True)<br>                chunk[&quot;STARTDATE&quot;] = pd.to_datetime(chunk[&quot;STARTDATE&quot;], errors=&quot;coerce&quot;).dt.strftime(&#39;%Y-%m-%dT%H:%M:%S&#39;)<br>                chunk[&quot;LOCATION&quot;] = chunk[&quot;LOCATION&quot;].apply(<br>                    lambda x: x if isinstance(x, str) and &#39;,&#39; in x else None<br>                )<br>                chunk.dropna(subset=[&quot;STARTDATE&quot;], inplace=True)  # Drop invalid dates<br>                <br>                for _, row in chunk.iterrows():<br>                    yield {<br>                        &quot;_index&quot;: index_name,<br>                        &quot;_source&quot;: row.to_dict()<br>                    }<br>        print(&quot;Dataset processed successfully.&quot;)<br>    except Exception as e:<br>        print(f&quot;Failed during data loading and processing: {e}&quot;)<br>        exit()</pre><h4># Step 5: Bulk Index the Data</h4><pre>try:<br>    bulk(es, generate_data_from_chunks())<br>    print(&quot;Data indexed successfully!&quot;)<br>except Exception as e:<br>    print(f&quot;Failed during data indexing: {e}&quot;)<br>    exit()</pre><h3>Data Visualization with Kibana</h3><p>Kibana is an open-source data visualization and exploration tool that is part of the Elastic Stack (formerly known as ELK Stack). It enables users to run advanced searches and queries on Elasticsearch data using the Kibana Query Language (KQL). It is useful for analyzing logs, errors, and events, making it a popular choice for IT and DevOps teams. Plus, Kibana offers real-time exploration of data for deeper insights and this makes it even more powerful.</p><p>In the final step, we utilized Kibana to visualize our market data and developed a dynamic dashboard that updates in real-time as the data in Elasticsearch changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXwYbbj5ge6UhOGmWvVkvA.png" /></figure><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70beeb9c11b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Kafka: A Hands-on Guide for Sending Messages from Producer to Consumer]]></title>
            <link>https://blog.devgenius.io/getting-started-with-kafka-a-hands-on-guide-to-sending-messages-from-producer-to-consumer-fc44fa24e07e?source=rss-4d26f1188692------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc44fa24e07e</guid>
            <category><![CDATA[kafka-producer]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[kafka-message-key]]></category>
            <category><![CDATA[kafka-consumer]]></category>
            <dc:creator><![CDATA[Beyza Uludağ]]></dc:creator>
            <pubDate>Tue, 29 Oct 2024 10:22:34 GMT</pubDate>
            <atom:updated>2024-10-30T16:42:04.122Z</atom:updated>
            <content:encoded><![CDATA[<h3>Apache Kafka</h3><p>Kafka, officially known as <strong>Apache Kafka</strong>, is an open-source distributed event streaming platform primarily used for real-time data processing and message delivery. Originally developed by LinkedIn and later open-sourced, Kafka is now managed by the Apache Software Foundation. It’s widely used for building data pipelines, real-time analytics, and streaming applications due to its reliability, scalability, and performance.</p><h3>Kafka Components</h3><p>Kafka is composed of several key components that work together to handle high volume of data. Producers and consumers are two of the key components of Kafka. <em>With simply saying, producers are responsible for message sending, and the consumer is responsible for reading messages.</em> In another expression, we can consider producers are source systems and consumers as target systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*Y2F8uosr0J8YJ7LrnwEuTw.png" /><figcaption>Kafka Components</figcaption></figure><p>I would like to simulate how to send messages from Producer to Consumer within this tutorial today. I’ve created one producer and two consumer consoles for this purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JE0H1MhFYYGx980At4eWNQ.png" /></figure><p>Here, I would like to mention about what is a Kafka message and what does a Kafka message consist of before continue.</p><h3>Kafka Message</h3><p>A Kafka message is a structured piece of data that is sent from a producer to a Kafka topic and later consumed by a consumer. Kafka message components can be listed as key, value, timestamp and header (optional).</p><p><em>Key</em>: The <strong><em>key</em></strong> is an optional part of the message and is often used to determine the partition where the message will be stored.</p><p><em>Value</em>: The <strong><em>value</em></strong> is the actual content or payload of the message, which holds the data being transmitted.</p><p><em>Timestamp</em>: Kafka automatically includes a <strong><em>timestamp</em></strong> in each message, which typically represents the time the message was produced.</p><p><em>Header</em>: <strong><em>Headers</em></strong> allow you to include additional metadata as key-value pairs with each message.</p><h3>Sending Messages from Producer to Consumer</h3><p>I’ve used dataframe_to_kafka.py for sending data from a <strong>Pandas DataFrame</strong> to a Kafka topic. It reads data from tr_il_plaka_kod.csv file loaded into a DataFrame and then produces Kafka messages based on that data, publishing them to a Kafka topic.</p><p>-k 0: Specifies that column index 0 in the csv file should be used as the message key.</p><p>-r 2: Sets the replication factor for the topic to 2. The <strong>replication factor</strong> in Kafka is a configuration setting that determines the number of copies (replicas) of each partition in a topic.</p><p>Let’s observe in the below that how producer is sending messages and in the mean time how consumer is consuming these messages.</p><p>Ps: Details for dataframe_to_kafka.py can be found in related <a href="https://github.com/erkansirin78/data-generator">Github repo</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*QSZnCXGol67FBz1Rwdj3Ew.png" /><figcaption>Producer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*6vgSAyomr5fGSUwb8G2_Xg.png" /><figcaption>Consumer 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wNfWhXj1q_CABHMzV3QANg.png" /><figcaption>Consumer 2</figcaption></figure><h3>Message Delivery Guarantees for Kafka</h3><p>Kafka provides several guarantees when sending messages, ensuring reliability, durability, and ordering for message delivery. I would like to highlight that how Kafka guarantees that m<em>essages with the same key are sent to the same partition</em>, ensuring order for messages with identical keys within that partition. Please see the yellow highlighted messages below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*i9dl_TrHgnm-OYY9-JyGxg.png" /></figure><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc44fa24e07e" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/getting-started-with-kafka-a-hands-on-guide-to-sending-messages-from-producer-to-consumer-fc44fa24e07e">Getting Started with Kafka: A Hands-on Guide for Sending Messages from Producer to Consumer</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How ChatGBT explains “data science” to a person who has no knowledge at all?]]></title>
            <link>https://medium.com/@beyzakendirli/how-chatgbt-explains-data-science-to-a-person-who-has-no-knowledge-at-all-762100c85f20?source=rss-4d26f1188692------2</link>
            <guid isPermaLink="false">https://medium.com/p/762100c85f20</guid>
            <dc:creator><![CDATA[Beyza Uludağ]]></dc:creator>
            <pubDate>Tue, 18 Apr 2023 10:46:41 GMT</pubDate>
            <atom:updated>2023-04-18T10:46:41.204Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, my name is Beyza. I also have curiosity about ChatGPT in these days like everyone else who have interest in machine learning field. Recently, I wondered that how ChatGBT explains “data science” to a person who has no knowledge at all. Then, I addressed this question directly to ChatBGT. Let see how it answered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/0*RPzQtYc6Zchp0V3y" /></figure><blockquote>Data science is the field of study that involves extracting useful insights and knowledge from large and complex sets of data. It combines elements of statistics, mathematics, computer science, and domain-specific knowledge to make sense of data and draw conclusions that can inform decision-making.</blockquote><blockquote>In simpler terms, data science involves using computers and mathematics to analyze large amounts of information to find patterns, make predictions, and answer questions. It helps people make informed decisions by providing valuable insights and actionable information.</blockquote><blockquote>For example, data scientists may analyze data to determine which marketing strategies are most effective, predict customer behavior, or identify trends in healthcare that could lead to better treatments.</blockquote><blockquote>Overall, data science is an important field that helps us make sense of the vast amounts of data we collect in today’s digital age and use it to make more informed decisions.</blockquote><p>Quite explanative, right? I’m so grateful that we have a tool like ChatGBT now. Thank you ChatGBT for making our lives easier!</p><p>Thank you for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=762100c85f20" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multiple Linear Regression Best Practice: House Price Prediction in 5 Steps]]></title>
            <link>https://medium.com/@beyzakendirli/multiple-linear-regression-best-practice-house-price-prediction-e00105996cb6?source=rss-4d26f1188692------2</link>
            <guid isPermaLink="false">https://medium.com/p/e00105996cb6</guid>
            <category><![CDATA[sklearn]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Beyza Uludağ]]></dc:creator>
            <pubDate>Wed, 12 Apr 2023 13:37:32 GMT</pubDate>
            <atom:updated>2023-04-17T15:54:32.586Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, my name is Beyza. Recently, I trained a model to predict the price of a house by using MLR (Multiple Linear Regression) technique. You may have also heard SLR (Single Linear Regression). They are both methods of linear regression.</p><p>First, I would like to explain a bit what is the difference between single and multiple linear regression, then, I’ll share my best practice with you in 5 steps.</p><h4>What is the difference between single and multiple linear regression?</h4><p>Linear regression refers to a statistical technique that uses an <em>independent variable</em> to predict the outcome of a <em>dependent variable</em>. If there are more than one independent variable used, then we call it as multiple linear regression.</p><h4>Step 1: Let’s get familiar with the dataset that we will work on</h4><p>Your dataset is your environment. If you try to get to know it, it tells you a lot. This is why, I always find important getting familiar with the data to find our way in the environment.</p><p>I downloaded the <a href="https://www.kaggle.com/datasets/shree1992/housedata">house price prediction dataset</a> for this project from Kaggle which is a great data science platform. It contains 4600 rows of data with the columns as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Jv3t-vyjdKJzL-9V7sZSw.png" /></figure><p>While getting familiar with the data, one of the most important decision that we need to make is <em>cleaning</em>. We need to check:</p><ol><li><strong>Missing Values:</strong> It doesn’t matter if we are doing just a basic data analysis or developing a machine learning model, missing value handling is always crucial. Missing values decrease the performance of the model. This is why we need to decide how to treat them. Dropping missing values can be an option in here, however, this is not a best fit for every scenario. Sometimes, we may need to imput new values into missing ones. Luckily, we do not have any missing value in our dataset.</li><li><strong>Categorical Variables: </strong>Categorical variables can not be used directly as they are in Linear Regression algoritm. It means that they require special attention. Usage of g<em>et_dummies </em>function is one of the common ways to create dummy variables for categorical variables. Please take a look at “<a href="https://medium.com/@guaisang/handling-categorical-features-get-dummies-onehotencoder-and-multicollinearity-f9d473a40417">Handling categorical features: get_dummies, OneHotEncoder and multicollinearity</a>” article if you would like to deep dive further.</li></ol><h4>Step 2: Let’s prepare the data and remove outliers</h4><pre># Data Preparation<br><br>#let&#39;s format the data types.<br>df[&#39;date&#39;] = pd.to_datetime(df[&#39;date&#39;])<br>df[&#39;price&#39;]     = df[&#39;price&#39;].astype(&#39;int64&#39;)<br>df[&#39;bedrooms&#39;]  = df[&#39;bedrooms&#39;].astype(&#39;int64&#39;)<br>df[&#39;floors&#39;]    = df[&#39;floors&#39;].astype(&#39;int64&#39;)<br>df[&#39;street&#39;]    = df[&#39;street&#39;].astype(&#39;string&#39;)<br>df[&#39;city&#39;]      = df[&#39;city&#39;].astype(&#39;string&#39;)<br>df[&#39;statezip&#39;]  = df[&#39;statezip&#39;].astype(&#39;string&#39;)<br>df[&#39;country&#39;]   = df[&#39;country&#39;].astype(&#39;string&#39;)<br><br>#there are some records which have 0 as house price. let&#39;s remove them.<br>(df.price == 0).sum()<br>df[&#39;price&#39;].replace(0, np.nan, inplace = True)<br>df.dropna(inplace=True)<br><br>df.head()</pre><h4>Step 3: Let’s understand the correlation between variables</h4><p>Linear regression is a technique which is used when we assume that there is a linear relationship between variables. We can decide which features can be used as independent variable by checking how these independent variables correlate with dependent variable or each other.</p><p>Note: Please be careful in here, it is also important to check the correlation between independent variables themselves. Independent variables must higly correlate with dependent variable, however, they must not correale with each other.</p><p>For now, let’s just check the relation between <em>sqft_living (independent variable)</em> and <em>price (dependent variable) </em>by using scatter plot<em>. </em>Red line<em> </em>represents a positive linear relationship between these variables. So, we can say that <em>sqft_living </em>can be used as independent variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*10417O5N3_gUYw5tFFSTgw.png" /></figure><p>For further correlation analysis, heatmap function can be used to see all relationships between all variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*oYCeZfxoDPKi8c7KOUvZ9A.png" /></figure><h4>Step 4: Let’s build and perform the model for prediction</h4><p>[Input]</p><pre>def find_optimal_lm_mod(X, y, cutoffs, test_size = .2, random_state=42, plot=True):<br>    <br>    r2_scores_test, r2_scores_train, num_feats, results = [], [], [], dict() <br>    <br>    for cutoff in cutoffs:<br>        <br>        <br>        #reduce X matris<br>        reduce_X = X.iloc[:, np.where((X.sum() &gt; int(cutoff)) == True)[0]]<br>        num_feats.append(reduce_X.shape[1])<br>        <br>        #split the data into train and test<br>        X_train, X_test, y_train, y_test = train_test_split(reduce_X, y, test_size = .2, random_state=42)<br>        <br>        #global variable definition is crucial if you&#39;ll use the same variable out side of this function<br>        global lm_model <br><br><br>        #fit the model and obtain pred response<br>        lm_model = LinearRegression(normalize=True)<br>        lm_model.fit(X_train, y_train)<br>        y_test_preds = lm_model.predict(X_test)<br>        y_train_preds = lm_model.predict(X_train)<br>        <br>        #append the r2 value from the test set<br>        r2_scores_test.append(r2_score(y_test, y_test_preds))<br>        r2_scores_train.append(r2_score(y_train, y_train_preds))<br>        results[str(cutoff)] = r2_score(y_test, y_test_preds)<br>        <br>    if plot:<br>        plt.plot(num_feats, r2_scores_test, label= &#39;Test&#39;, alpha=.5)<br>        plt.plot(num_feats, r2_scores_train, label= &#39;Train&#39;, alpha=.5)<br>        plt.xlabel(&#39;Number of features&#39;)<br>        plt.ylabel(&#39;Rsquared&#39;)<br>        plt.title(&#39;Rsquared by Number of features&#39;)<br>        plt.legend(loc=1)<br>        plt.show()<br>        <br>        <br>    best_cutoff = max(results, key=results.get)<br>    <br>    #reduce X matris<br>    reduce_X = X.iloc[:, np.where((X.sum() &gt; int(best_cutoff)) == True)[0]]<br>    <br>    #split the data into train and test<br>    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.2, random_state = 42)<br>    <br>    #fit the model<br>    lm_model = LinearRegression(normalize=True)<br>    lm_model.fit(X_train, y_train)<br>    <br>    return r2_scores_test, r2_scores_train, lm_model, X_train, X_test, y_train, y_test</pre><pre>#cutoffs here pertains to the number of missing values allowed in the used columns<br>#therefore, lower values for the cutoff provides more predictors in the model<br>X = df[[&#39;bedrooms&#39;,&#39;bathrooms&#39;, &#39;sqft_living&#39;, &#39;sqft_lot&#39;,&#39;floors&#39;,&#39;waterfront&#39;,&#39;view&#39;,&#39;condition&#39;,&#39;sqft_above&#39;,&#39;sqft_basement&#39;,&#39;yr_built&#39;,&#39;yr_renovated&#39;]]<br>y = df[&#39;price&#39;]<br><br>cutoffs = [5000, 3500, 2500, 1000, 100, 50, 30, 25,10,5]<br><br>r2_scores_test, r2_scores_train, lm_model, X_train, X_test, y_train, y_test = find_optimal_lm_mod(X, y, cutoffs)</pre><p>[Output]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*ozroSI28n-GX1ms0M_BWEQ.png" /></figure><h4>Step 5: Finally, let’s evaluate the results</h4><p>[Input]</p><pre>#r square is a statistical measure that represents the goodness of fit. the best possible score is 1.0<br>&quot;The r square score for the model using only quantitative variables was {} on {} values&quot;.format(r2_score(y_test,y_test_preds), len(y_test))</pre><pre>from sklearn.metrics import mean_absolute_error,mean_squared_error,r2_score<br>print(mean_absolute_error(y_test,y_test_preds))<br>print(mean_squared_error(y_test,y_test_preds))</pre><p>[Output]</p><blockquote><strong><em>R2 Score: 0.6001975051169848</em></strong></blockquote><blockquote><strong><em>Mean absolute error: 160809.8502486896</em></strong></blockquote><blockquote><strong><em>Mean squared error: 59478775378.600044</em></strong></blockquote><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e00105996cb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>