<?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 Sercan Doğan on Medium]]></title>
        <description><![CDATA[Stories by Sercan Doğan on Medium]]></description>
        <link>https://medium.com/@sercandogan?source=rss-52d551ec8c8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6mDBZKJCmgepW5w4Woz-WA.jpeg</url>
            <title>Stories by Sercan Doğan on Medium</title>
            <link>https://medium.com/@sercandogan?source=rss-52d551ec8c8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 19:29:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sercandogan/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[Why scree plot is important in PCA?]]></title>
            <link>https://medium.com/@sercandogan/why-scree-plot-is-important-in-pca-a66cd7dcd624?source=rss-52d551ec8c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/a66cd7dcd624</guid>
            <category><![CDATA[multivariate-analysis]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[dimensionality-reduction]]></category>
            <dc:creator><![CDATA[Sercan Doğan]]></dc:creator>
            <pubDate>Sun, 12 Apr 2020 20:04:40 GMT</pubDate>
            <atom:updated>2020-04-13T11:53:50.681Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I’ll point out several things:<br>1. What is the PCA? <br>2. What is math behind it?<br>3. Component selection with Scree Plot</p><h3>What is PCA?</h3><p>Principal Component Analysis (PCA) is a linear transformation method that mostly used for dimensionality reduction. The magic comes with the idea of finding the “best-fitting” line to project the data with the highest variance in higher-dimensional space. This brings the orthogonality. [1] In other words, it minimizes the correlations between components (If you have multicollinearity problem in your regression model, you can use it as a treatment)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*ewfs7RSRgVRPhu6zGdAkbw.png" /><figcaption>PCA of a multivariate Gaussian distribution [1] The reason for having ellipsoid with orthogonal axes is to minimize the correlation between each other.</figcaption></figure><p>PCA can be done by eigendecomposition of a data covariance/correlation matrix or singular value decomposition of a data matrix. Although using the cross-product (covariance/correlation) matrix cause the loss of precision [2], I will continue with the eigendecomposition method.</p><h3>What is the math behind it?</h3><p>We will (not surprisingly) use the iris dataset to explain the math behind it. I&#39;ll be using <a href="https://github.com/sercandogan/eigpca">eigpca package</a>. But why we don&#39;t use PCA from scikit-learn? First of all, PCA in scikit-learn is based on Singular Value Decomposition. Moreover, I want to mention why the selection of the number of components must be considered after fitting which is vice versa in scikit-learn.</p><pre>from eigpca import PCA<br>from sklearn.dataset import load_iris<br>from numpy as np</pre><pre>X = load_iris().data</pre><p>We need the covariance/correlation matrix of the data to apply eigendecomposition. We can use both the variance-covariance matrix or correlation matrix but which one? The correlation matrix is a unitless measure that provides freedom of unit changes. In other words, whatever unit (cm, km, feet) we measure, we get the same correlation but not same covariance. Therefore, it is required to use the correlation matrix if you don’t have data in the same unit.</p><p>Although all features in the iris dataset are in centimetres, we will use correlation matrix and apply eigendecomposition on it. That’s all.</p><pre>xs = X - X.mean(axis=0)  # standardised<br>S = np.dot(xs.T, xs) / (X.shape[0] - 1)  # variance-covariance matrix<br>d = S.diagonal().T * np.identity(X.shape[1])<br>d_sqrt_inv = (1 / np.sqrt(d).diagonal()).T * np.identity(X.shape[1])<br>corr = np.dot(np.dot(d_sqrt_inv, S), d_sqrt_inv) # correlation-matrix</pre><pre>&gt;&gt; array([[ 1.        , -0.11756978,  0.87175378,  0.81794113],<br>       [-0.11756978,  1.        , -0.4284401 , -0.36612593],<br>       [ 0.87175378, -0.4284401 ,  1.        ,  0.96286543],<br>       [ 0.81794113, -0.36612593,  0.96286543,  1.        ]])</pre><p>After getting correlation matrix:</p><pre>eig_val, eig_vecs = np.linalg.eig(corr)</pre><p>Or simply:</p><pre>pca = PCA()<br>pca = pca.fit(X)</pre><p>Our eigenvalues and vectors:</p><pre>pca.eig_vals<br>&gt;&gt; array([2.91849782, 0.91403047, 0.14675688, 0.02071484])<br>pca.eig_vecs<br>&gt;&gt; array([[ 0.52106591, -0.37741762, -0.71956635,  0.26128628],<br>       [-0.26934744, -0.92329566,  0.24438178, -0.12350962],<br>       [ 0.5804131 , -0.02449161,  0.14212637, -0.80144925],<br>       [ 0.56485654, -0.06694199,  0.63427274,  0.52359713]])</pre><h3>Component selection with Scree Plot</h3><p>We have 4 eigenvalues (equal to the number of variables)and their eigenvectors in a word we have 4 components. Choosing the number of components is related to the amount of variance that is explained. Thus, you can only decide after fitting and view the components with their explained variance ratios.</p><pre>pca.explained_variance_ratio_<br>&gt;&gt; array([0.72962445, 0.22850762, 0.03668922, 0.00517871])</pre><p>Explained variance ratio is determined with the eigenvalues dividing by the number of variables. <br>We are willing to use the eigenvalues are greater than 1. This not a rule but the average eigenvalue will be 1, so &gt; 1 is “higher than average”. [3] Then it comes Scree Plot:</p><pre>pca.plot(y=&quot;eig&quot;)<br>pca.plot(y=&quot;pov&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*iQ2tBVaU_JmMTSQoObSSsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*q_2wBNGu0ywKLroTZBVr5Q.png" /></figure><p>The scree plot is a line plot used to determine how many factors to retain.[4] We can decide the point after seeing a sharp drop (like a cliff) with the rest of the components would add relatively little information. So in this example, I choose the first two components that explain %95 (0.72962445, 0.22850762) of all information. Although scree plot can be subjective, it is helping determine the number of factors remains.</p><pre>pca.transform(X, n_components=2)</pre><p>To sum up, PCA is a linear transformation method that built 2 principal components with 95% explanatorily in this example. However, we cannot entitle the components and only know that components are a linear combination of variables. In order to go further, we should check out Factor Analysis.</p><p>References:<br>[1] <a href="https://www.wikiwand.com/en/Principal_component_analysis">https://www.wikiwand.com/en/Principal_component_analysis</a><br><a href="https://math.stackexchange.com/a/3871">[2] https://math.stackexchange.com/a/3871</a><br>[3] <a href="https://stats.stackexchange.com/a/72440">https://stats.stackexchange.com/a/80318</a><br>[4] <a href="https://www.wikiwand.com/en/Scree_plot">https://www.wikiwand.com/en/Scree_plot</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a66cd7dcd624" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I gained doing a gap year?]]></title>
            <link>https://medium.com/@sercandogan/what-i-gained-doing-a-gap-year-945c78ef4d3c?source=rss-52d551ec8c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/945c78ef4d3c</guid>
            <category><![CDATA[community]]></category>
            <category><![CDATA[ecovillage]]></category>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[gap-year]]></category>
            <dc:creator><![CDATA[Sercan Doğan]]></dc:creator>
            <pubDate>Sun, 05 Jan 2020 20:41:36 GMT</pubDate>
            <atom:updated>2020-01-05T20:41:36.386Z</atom:updated>
            <content:encoded><![CDATA[<p>I am a stats student (almost graduated). I started programming at the early ages of my life. Hence, I professionally did look at the world from a technical perspective for many years. So then, what would you expect from this kind of person for the next step of his life? As you thought, He did the same. He pursued his career as Data Engineer after his internship.</p><p>So far the story was not uncommon and neither I wanted to make it unusual. I was doing my literature review for my bachelor thesis and I was satisfied with my work and colleagues. One day nine months long volunteering project called “Living and growing up in an ecovillage” came out of a clear blue sky.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VGruB6mCR4DPRbVsSr2SEg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SoW7X2V6viIpODkVFgTWqA.jpeg" /><figcaption>Where I lived for nine moths</figcaption></figure><p>If I had to define and sum up full of the experience, I would say nine months of powerful non-formal education. I believe that the new generation including me cares about collaborative work, dynamic and sustainable working culture. Although the tech environment is expanding itself, I think that the way of communication is primitive. It depends on how we see the communication. I’ll touch on some points that have solid impacts on me.</p><h3>1. Working in a diverse environment</h3><p>The volunteers that I worked together with short and long time gave me new a vision of communication and a way of working. I collaborated with people from different countries and various disciplines. I believe that I opened up to different ways of thinking with positive communication.</p><h3>2. Self-Autonomy</h3><p>When I heard the word “Self-Autonomy”, I was chopping zucchini and I asked the size. The answer was simple. I was contributing and the decision had to be made by me. I had many responsibilities during my volunteering activity. If I had not had all the responsibility, none of them would make me satisfied and enjoy it.</p><h3>3. Nonviolent communication</h3><p>It’s a topic that is thankfully in my life. I can briefly explain with my own words. It’s an awareness of how to communicate. It has four components: Observation, Feeling, Needs and Request. Every component gets you deeper on giving and receiving. While reading <a href="https://www.amazon.com/Nonviolent-Communication-Language-Life-Changing-Relationships/dp/189200528X">the book</a> and learning from community members, I tried to apply to different situations. I think everyone needs a bit of it.</p><h3>4. Sociocracy</h3><p>The ecovillage’s governance method is Sociocracy. Even though I heard it for the first time, I had a chance to learn by doing.</p><p>&quot;Sociocracy, also known as dynamic governance, is a system of governance which seeks to achieve solutions that create harmonious social environments as well as productive organizations and businesses.&quot; — wikipedia</p><p>I am still reading on it and learning. I believe and hope that more companies will use it.</p><p>To sum up, I had a great community experience in an ecovillage. I am freshly back to working life as a Data Scientist. I believe every company should consider itself as a community. Therefore, it should work on conflict-management because community means a group of people who has similar objects and able to manage their conflicts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=945c78ef4d3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Romanlarda Noktalama İşaretleri]]></title>
            <link>https://medium.com/@sercandogan/romanlarda-noktalama-i%CC%87%C5%9Faretleri-d4b94b95bfd0?source=rss-52d551ec8c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4b94b95bfd0</guid>
            <category><![CDATA[medium-turkish]]></category>
            <category><![CDATA[novel]]></category>
            <category><![CDATA[türkçe]]></category>
            <category><![CDATA[art]]></category>
            <category><![CDATA[edebiyat]]></category>
            <dc:creator><![CDATA[Sercan Doğan]]></dc:creator>
            <pubDate>Sun, 12 Jun 2016 17:27:42 GMT</pubDate>
            <atom:updated>2016-06-12T17:30:31.215Z</atom:updated>
            <content:encoded><![CDATA[<p>Bir pazar sabahı <a href="https://medium.com/u/4cba1be78e39">Barış Özcan</a>’ın “Kelimeler Arasında” videosunu izleyerek başladım. Videoda geçen <a href="https://medium.com/u/f96422ab6f6b">Adam J Calhoun</a>’un <a href="https://medium.com/@neuroecology/punctuation-in-novels-8f316d542ec4">“Punctuation in novels”</a> yazısına ulaşıp hemen okudum. Noktalama işaretlerinin gücüne inanan biri olarak ben de bir şeyler yapmak istedim ve neden Türk Edebiyatı için bir şeyler yapmıyorum dedim.</p><p>Bir temmuz günü otobüs yolculuğunda okumaya başladığım ve beni çok etkileyen Ayfer Tunç’un Dünya Ağrısı kitabıyla ilk denememi yapmaya başladım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*q6FnJ8Yc7q_tfbbyRaEyrQ.png" /><figcaption>Ayfer Tunç’un Dünya Ağrısı kitabının kelimelerden arındırılmış görüntüsünden bir bölüm</figcaption></figure><p>Ardından bazı eserlerin noktalama işaretlerini kullanım sayısıyla ilgili bir çubuk grafiği oluşturdum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*yckpA_BpaTsAgno3bB9x9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*w816jf8_s2nE002PKR_yNQ.png" /><figcaption>Soldaki Ayfer Tunç’un Dünya Ağrısı, Sağdaki İhsan Oktay Anar’ın Suskunlar romanı</figcaption></figure><p>Bu karşılaştırmada bence en çok dikkat edilmesi gereken nokta ve virgülün kendi arasındaki ilişki. Çünkü eserde yazarın kullandığı dil ile ilgili bize sırrını paylaşıyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*h3b1z3vUvUjrwbrYmZW9Zg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*KPmhGAtWAGTtsR7ufDJ3ew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*yckpA_BpaTsAgno3bB9x9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*d094FwloTe022zwRvSzypw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*c7Kxvp_Cu5-cLSlGjmTVVQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*PP9gu72CTELk10PuF8fHag.png" /></figure><p>Buraya kadar çok hızlı gelmiştim ancak yapmak istediğim sıcaklık haritasını henüz çıkaramamıştım. Finallerim bitince bir gece tekrar çalışmaya başladım.</p><blockquote>Virgül, tırnak ve kesme işaretini yeşil, noktalı virgül, iki nokta ve noktayı mavi, soru ve ünlem işaretini de kırmızı temsil etmesine karar verdim.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*jLbSPkynCcmI1cQQWiNjxQ.png" /><figcaption>Dünya Ağrısı için sıcaklık haritası</figcaption></figure><p>Sonuç olarak yukarıdaki gibi görsel edinmiştim ancak hâlâ tatmin olmamıştım. Başka ne yapabilirim diye düşünürken eserlerin sıcaklık haritasıyla yazarların fotoğraflarını derin öğrenme algoritması olan “neural style” ile neden çalıştırmayayım dedim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*pEyrmGJvd0wUZXNjmh-y3w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*83h-mcpUT0QE-PiegzD53w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*_kTXMFBkZjjL4L_zeQVzlw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JmsjUNkpC9SHhOXae0DSbg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7FygWrde5pXyQCgnF7sI3A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WXWmvlzDW94FU6Ie3X8D0A.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4b94b95bfd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>