<?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 Huda Nassar on Medium]]></title>
        <description><![CDATA[Stories by Huda Nassar on Medium]]></description>
        <link>https://medium.com/@nassarhuda?source=rss-ce600a9935d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7_bTSUO_UDT4BQ_24w5FPQ.jpeg</url>
            <title>Stories by Huda Nassar on Medium</title>
            <link>https://medium.com/@nassarhuda?source=rss-ce600a9935d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:57:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nassarhuda/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[Yet another blogpost about PageRank]]></title>
            <link>https://medium.com/@nassarhuda/yet-another-blogpost-about-pagerank-25c4d23e7374?source=rss-ce600a9935d------2</link>
            <guid isPermaLink="false">https://medium.com/p/25c4d23e7374</guid>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[knowledge]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[relational-databases]]></category>
            <dc:creator><![CDATA[Huda Nassar]]></dc:creator>
            <pubDate>Wed, 10 Jan 2024 12:40:37 GMT</pubDate>
            <atom:updated>2024-01-10T12:40:37.061Z</atom:updated>
            <content:encoded><![CDATA[<p>Though, maybe, the first one with half basketballs 🏀.</p><p>❓But no, seriously, why am I writing yet another blogpost about PageRank? The simple answer is that I often find myself re-explaining PageRank in my own way, and sometimes in a way that avoids the nitty-gritty details of the Math involved. Because I do this often, and because I believe everyone (I really mean everyone) should be able to understand the intuition of this neat algorithm, I’m putting my own thoughts in words.</p><p>📔 For a review that involves the nitty-gritty details of the Math involved, I strongly recommend reading this <a href="https://arxiv.org/abs/1407.5107">paper</a>.</p><h3>An analogy to PageRank</h3><p>Here, I will explain PageRank as a game. Nodes in the graph are people, and an edge between two nodes (people) means the existence of a direct path between the two. Let’s use this figure below as a guiding example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*mRhzNzenXwNYeVkH-uPo_w.png" /><figcaption>The initial positions of all players and their connections.</figcaption></figure><h4><strong>The setup</strong></h4><p>Now imagine that every player in this game is given a certain amount of goods, let’s say everyone is given three basketballs. The task of every player will be to equally distribute their basketballs to all their neighbors. For example, player 2 below, will give one basketball to each of their neighbors (players 3, 4, and 5), and will also receive three basketballs from player 1 (since player 2 is the only outgoing neighbor player 1 has). In the two figures below you can see what the distribution of basketballs will look like after one round of this setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nT1WsPX1EwGwh7CF" /><figcaption>Initial game setup.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f49nQqTI4mvfnS0G" /><figcaption>After one round of the game.</figcaption></figure><p>⚠️: our basketballs are special, you can cut them in half 😉</p><p>In this simplistic form, we will declare a winner after the referee decides on a number of rounds. Whoever has the highest number of basketballs at the end of that round wins. And the ranking of everyone else will correspond to the number of balls they have.</p><h4>“Level 2” of this game</h4><p>😰<strong> Players with no outgoing paths</strong> (known as dangling or sink nodes):</p><p>In this game, we will also guarantee that every player <em>can </em>participate. Participating here means that every player has at least one outgoing edge. Note that for a player to not have outgoing edges, it means that this player cannot <em>send</em> the basketballs to anyone. Also note that the only move a player can take is: “send goods”.</p><p>If we have a situation like this, the referee will intervene. A player with no outgoing edges will be given imaginary outgoing edges to everyone in the game. This means if the node doesn’t pick someone to give their basketballs to, they by default pick everyone! This is how we interpret “no choice” (<em>there are other good choices you can make here too; for a review of choices on how to handle dangling nodes, you can refer to the article I reference at the beginning of this blogpost</em>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vicegDgRbKDlXJ7T" /><figcaption>An illustration of what happens when we have a game setup with a dangling node (a node with no outgoing edges, node 6 in this case).</figcaption></figure><pre><strong>New score of a player =</strong><br>    number of 🏀s received from neighbors pointing to player + <br>    (number of 🏀s all dangling nodes have) / number of players<br><br><strong>Example: After just the first round, player 1’s score is:</strong><br>(🏀s received from player 5) + portion received from player 6 =<br>🏀🏀🏀 + (🏀🏀🏀) / 6 = 3.5 🏀s</pre><p>⚖️ <strong>Re-leveling of the playing field</strong> (known as the teleportation parameter in PageRank)</p><p>In this version of the game, we will introduce a way that will keep people receiving a low score somehow interested in this game. We will also keep those with no incoming edges (i.e. no incoming basketballs) engaged in the game as well.</p><p>At each round, the players will play according to the setup explained above, but the referee will also provide everyone with three new basketballs. The importance of these new goods will also be determined by the referee.</p><p>For example, it could be that the referee decides that every player gets ¾ of what they can get through playing the game and ¼ of what the referee gives… or it could be 0.85 of what they can get from playing and 0.15 of what they get from the referee. This fraction (¾ or 0.85) is usually called the damping parameter in the PageRank equation.</p><p>Then, the total score of every player, given a damping parameter (½, or ¾, or whatever the referee decides), will be as follows:</p><pre><strong>New score of a player</strong> =<br>α * [🏀s received from playing] + (1-α) * [🏀s received from the referee]<br><br><strong>Example: After just the first round, and α = ½, player 1’s score is</strong>:<br>1/2 * [<br>    (🏀s received from player 5) + portion received from player 6<br>] +<br>1/2 * [<br>    🏀🏀🏀<br>] = <br>————————————————————————————————————————————————————————————————————————<br>1/2 * [🏀🏀🏀 + (🏀🏀🏀) / 6] +  1/2 * (🏀🏀🏀) = 3.25 🏀s</pre><p>↪️ <strong>Number of rounds </strong>(known as PageRank convergence)</p><p>In the earlier version, we allowed the referee to decide on the number of rounds played. Here, we will allow the game to run for enough turns, until a certain <em>equilibrium </em>is reached. This equilibrium can be understood as “when the number of basketballs a player has no longer changes” (or more precisely doesn’t change much). Thankfully, the PageRank theory supports that we will indeed reach such a steady state. And once that steady state is reached, we have a ranking of the nodes.</p><h3>Finally,</h3><p>There you go, a PageRank explanation without any of the Math or any of the code. More on the Math and the code coming up soon.</p><p>For now, you might be interested in reading more about the <a href="https://medium.com/@nassarhuda/pagerank-and-centrality-they-measure-importance-2458aa8b6eef">significance of PageRank and Centrality</a> in general. Or about how I used centrality measures to determine <a href="https://medium.com/@nassarhuda/who-is-the-most-important-member-of-the-targaryen-family-de67d522304d">who is the most important member of the Targaryen Family</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25c4d23e7374" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PageRank and Centrality: They measure importance.]]></title>
            <link>https://medium.com/@nassarhuda/pagerank-and-centrality-they-measure-importance-2458aa8b6eef?source=rss-ce600a9935d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2458aa8b6eef</guid>
            <category><![CDATA[knowledge]]></category>
            <category><![CDATA[pagerank]]></category>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[Huda Nassar]]></dc:creator>
            <pubDate>Sat, 06 Jan 2024 13:11:04 GMT</pubDate>
            <atom:updated>2024-01-06T13:11:04.236Z</atom:updated>
            <content:encoded><![CDATA[<p>Alright, so, yet another, “what is PageRank” answer:</p><p>PageRank is the algorithm that kickstarted Google. Its key goal was to <em>rank pages</em> in terms of measured importance. It relied heavily on the web’s connections… For example, and just for the sake of illustration, imagine that there are only 100 webpages on the Internet, and 99 of them have a redirecting link to the 100th page. This type of pattern is indicative that the 100th page is very important. Here is an example to illustrate this scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*SkZCduXHFMu6JdlHSdMXmw.png" /></figure><p>And, for the curious, here are the actual PageRank values of the above graph. Node 17 is the center node in the figure; it is the one with the highest PageRank value (The edge list of the graph above is provided at the bottom of this post).</p><pre> (1, 0.012031862745098041)<br> (2, 0.012232557189542486)<br> (3, 0.017431393995098042)<br> (4, 0.11277653873406326)<br> (5, 0.04077737697022948)<br> (6, 0.17389675820604356)<br> (7, 0.06862827472407124)<br> (8, 0.008823529411764707)<br> (9, 0.008823529411764707)<br> (10, 0.1172937216767716)<br> (11, 0.013823529411764708)<br> (12, 0.008823529411764707)<br> (13, 0.019344362745098043)<br> (14, 0.011323529411764708)<br> (15, 0.008823529411764707)<br> (16, 0.011323529411764708)<br><strong> (17, 0.35382244713163113)</strong></pre><h3>Centrality</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z_JqWfxvSwCRv4qu" /><figcaption>Photo by <a href="https://unsplash.com/@designedbyflores?utm_source=medium&amp;utm_medium=referral">Omar Flores</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’ve heard of PageRank before, you may have heard of “centrality”. As mentioned earlier, PageRank is a way to <em>rank</em> nodes in a graph and in some way, measure their importance.</p><p><strong>First, on the topic of <em>importance</em></strong>:</p><p>Quantifying this importance can be crucial in various cases. For example, consider a social network where <strong>two ad agencies/influencers offer to advertise your product and ask for the same price</strong>. You would likely want to go with the agency that is “<strong>more important</strong>”. In a similar way, we can measure the importance of airports in a flight network and decide to have a layover in a “more important” airport (if we have concerns about delays).</p><p><strong>Second, on <em>centrality</em></strong><em>:</em></p><p><strong>Centrality</strong>: In plain terms, centrality measures how <em>central or important </em>a node is in a graph.</p><p>So far, we’ve indicated that the PageRank value of a given node correlates with the “importance” of that node. Other methods exist to measure centrality.</p><p>A trivial measure of centrality is degree centrality. In this measure the importance of a node is correlated with how many edges are connected to it. This type of centrality only looks at the most immediate neighbors of a node while a measure like PageRank looks at the graph somewhat more collectively. Depending on the graph and problem at hand, degree centrality could be problematic. To see why the degree centrality measure can be problematic, consider a transportation network where we have one airport connecting two hubs. At a first glance, this node seems to be not important according to its degree centrality; nevertheless, because it connects two hubs, this node will likely have a high PageRank value, indicating an importance that is higher than anticipated.</p><p>If you want to know all the details and history, please see “<a href="https://arxiv.org/abs/0912.0238">A History of Spectral Ranking</a>”. Some ideas related to those we discuss date back to ways to rank chess players from the late 1800s!</p><p>Also, if you are curious: I talk about five types of centrality in this <a href="https://medium.com/@nassarhuda/who-is-the-most-important-member-of-the-targaryen-family-de67d522304d">blogpost</a> with a really fun dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P3y49GKlAFe5AGosutiiVQ.jpeg" /></figure><p>Lastly, I promised the edges of the graph above, here it is:</p><pre> (1, 2)<br> (1, 3)<br> (2, 3)<br> (3, 4)<br> (3, 6)<br> (3, 7)<br> (4, 5)<br> (4, 6)<br> (7, 6)<br> (8, 7)<br> (9, 7)<br> (9, 11)<br> (10, 7)<br> (12, 11)<br> (12, 13)<br> (13, 10)<br> (14, 13)<br> (15, 14)<br> (15, 16)<br> (16, 1)<br> (16, 13)<br> (1, 17)<br> (2, 17)<br> (3, 17)<br> (4, 17)<br> (5, 17)<br> (6, 17)<br> (7, 17)<br> (8, 17)<br> (9, 17)<br> (10, 17)<br> (11, 17)<br> (12, 17)<br> (13, 17)<br> (14, 17)<br> (15, 17)<br> (16, 17)<br> (17, 4)<br> (17, 6)<br> (17, 10)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2458aa8b6eef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Year of Reading, a Lifetime of Lessons: Reflecting on what I learned in 2022.]]></title>
            <link>https://medium.com/@nassarhuda/a-year-of-reading-a-lifetime-of-lessons-reflecting-on-what-i-learned-in-2022-87bc1d79a79c?source=rss-ce600a9935d------2</link>
            <guid isPermaLink="false">https://medium.com/p/87bc1d79a79c</guid>
            <dc:creator><![CDATA[Huda Nassar]]></dc:creator>
            <pubDate>Mon, 13 Feb 2023 15:59:33 GMT</pubDate>
            <atom:updated>2023-02-13T15:59:33.941Z</atom:updated>
            <content:encoded><![CDATA[<p>Last year, I made a resolution to read at least 5 books, and I’m proud to say that I exceeded that goal by reading a total of 7. Despite my initial goal, even just reading one book would have been a personal accomplishment. I am writing about it now to celebrate this modest yet significant achievement and reflect on what I learned from these seven books.</p><h3>Will</h3><p>When I first set out with the goal of reading five books, I wanted my first choice to be a storybook. I was intimidated by the thought of committing to reading something more academic, like a science or finance book, or a political treatise. I simply wanted to immerse myself in someone’s tale.</p><p>Approximately two months prior, “<a href="https://willthebook.com/">Will the book</a>” had been released, and it seemed like the perfect fit for what I was looking for. The first story in the book revolved around Will’s father asking him to build a wall. After some back-and-forth dialogue, the story conveyed the main point: <strong>instead of feeling overwhelmed by the daunting task of building a wall, focus on laying one brick down. </strong>It’s cheesy, but a good reminder —and this idea served as an excellent starting point for my reading journey.</p><p>The book went on to describe Will’s life and his experiences, including a recount of the times he messed up and the times he reached rock bottom. Reading about the journey of a successful person and <strong>realizing that even the most successful has to pick themselves up sometimes and try again was comforting in its own way.</strong> It was the reminder that I needed.</p><h3>Atomic Habits</h3><p>I used to shy away from self-help books, but “<a href="https://jamesclear.com/atomic-habits">Atomic Habits</a>” certainly changed that for me. It’s packed with valuable lessons that I now frequently recommend the book to friends and family. It’s hard to list all my takeaways from this book, but here are the three that I did most regularly last year:</p><ol><li><strong>Build systems, not goals</strong>. For example, instead of saying “I’ll read for 30 minutes every day,” set aside 30 minutes each day between breakfast and the start of your work day as dedicated reading time. The two routes sound similar, but they’re not really: one includes a plan (or a system).</li><li><strong>Track, track, track</strong>. If you find yourself repeatedly trying to stick to a habit, like working out, it’s so easy to mindlessly keep trying. If a month had gone by and you’ve only done 3 workouts, then something is not working. If you have the data, you can look back and maybe realize: “I need a new strategy”. I used habit trackers for the first seven months of the year and found it incredibly helpful.</li><li><strong>Create an environment that supports your habit</strong>. It’s simple, but sometimes really hard. If you know receiving a text notification will stop you from typing mid-sentence while doing your homework, turn off your phone entirely for an hour (trust me, I missed out on nothing by turning off my phone for an hour here and there). If you know a certain type of music makes you focus better, put that music on as soon as you sit at your desk.</li></ol><p>I like this book so much, I’ve read it twice already!</p><h3>Remember</h3><p>The story of how I came across this book is a bit funny. I met the author of “<a href="https://www.lisagenova.com/book-inner">Remember</a>”, Lisa Genova, through her dog, Peanut. Peanut and my dog, Winnie, once happened to play very nicely with each other. Upon talking to Lisa a little more I found out that she’s a neuroscientist and author, and learned about “Remember”… so naturally, this was my next pick for a book to read. I started reading this book initially motivated by the fact that I had met Lisa, and I finished this book thinking it is a must-read for anyone looking to improve their brain health and better understand the challenges faced by those affected by debilitating diseases related to the brain. I have many favorites from this book, and here is a brief list:</p><ol><li><strong>Pay attention, commit to memory</strong>. As a computer scientist, this immediately clicked. It’s simple: if you want to <em>remember, </em>you need to <em>commit</em> the event to memory (just like you would save something on a computer). <strong>The act of remembering starts by first <em>saving </em>the memory<em>.</em></strong></li><li><strong>Use tools</strong>. This one was a big one to learn. I had always thought that I wanted to keep my brain active, so, for example, I wanted to remember as many phone numbers as I can. Lisa argued in the book that if there are tools to help us achieve something, like saving phone numbers, taking pictures to record memories, or looking something up on the web, it’s a completely valid thing to do… it doesn’t mean that your brain is on a decline.</li><li><strong>Associate meaning or build a story</strong>. In the book, Lisa gives an example about how remembering someone’s name could be easier if, for instance, we imagine the the meaning of the name (if it has a meaning). For example, if I want to remember <a href="https://en.wikipedia.org/wiki/Charlie_Baker">Charlie Baker</a>’s name, it’s easier to imagine a baker in my head. (Side note: I had always struggled to remember Charlie Baker’s name but somehow, I never forgot it after I learned about this trick.)</li><li><strong>Binge studying doesn’t actually work on the long run. </strong>This was another fascinating discovery from this book. I remember in undergrad, I used to think if I binge-study the day before the exam, it’ll be “fresh” in my mind for the exam. But the reality is that the more you spread things out the better your brain will process the content you’re giving it. The more I started to practice this technique the more I felt that my brain is sharper.</li></ol><h3>Love and Work</h3><p>I discovered Marcus Buckingham on one of our company’s Slack channel when someone shared a link to one of his talks. Coincidentally, I had been seeking insights on discovering my passions and purpose and was delighted to learn that his new book, “<a href="https://www.marcusbuckingham.com/books/">Love and Work</a>,” had just been published. I eagerly started reading and was not disappointed. The book not only imparted valuable lessons, but it also helped me find greater fulfillment in my work. If you’re looking for a career change, or understanding your purpose better, I strongly recommend this book. After reading this book, the following two thoughts became very frequent in my mind:</p><ul><li><strong>There is always love in excellence</strong>. The book contains a powerful statement that encapsulates this idea: “<strong>When you see someone do something with excellence, there is always love in it.</strong>” In the book, Marcus highlights a product that was labeled “made with love” and shares the story of the creator who went to great lengths to carefully select the perfect materials. He asserts that this added touch of love made the product be more authentic and genuine. This resonated with me instantly, and I immediately noticed that any product I had put more love in, was simply better.</li><li><strong>Focus on the what not the why</strong>. The emphasis should be on the “what,” not the “why.” This may seem counterintuitive, especially given that I started reading the book with the intention of gaining a better understanding of my purpose or “why.” However, the author made a compelling argument. For our passions to lead to meaningful contributions, we must focus on the specific activities we love, without getting bogged down by the outcomes. At one point in the book, he asks the reader to reflect on recent tasks they’ve found enjoyable. That’s when I noticed that there are tasks that simply take me to a different place that I forget about time… these were the “what”s that I was looking for and managed to incorporate into my work.</li></ul><h3>The Power of Now</h3><p>I can’t recall how I stumbled upon “<a href="https://learn.eckharttolle.com/the-power-of-now/">The Power of Now,</a>” but I’m almost sure it was mentioned in one of the books I had previously read. Despite having an idea of what the book was about, I wasn’t sure if I was ready for this type of spiritual reading. Nonetheless, I was intrigued because I knew of the book’s popularity, and wanted to overcome my reservations towards this genre of books. It turned out to be exactly what I needed, despite my initial resistance.</p><p>I don’t think this type of books is “summarizable” in the way other books I’ve read were. To me, <strong>reading this book was a journey</strong>. <strong>While there may not be a recipe for living in the present moment and avoiding being preoccupied with the past or future, “The Power of Now” offered me glimpses of that</strong>. These glimpses were minimal, and will require a lot more intention and practice but it happened, and I hope to experience this a little more this year. If you struggle with staying present, I highly recommend this book.</p><h3>How to Win Friends and Influence People</h3><p>An old classic. I was sharing my reading journey with a friend over dinner when he recommended “How to Win Friends and Influence People” to me. Although many of the tips in the book were not quite in line with my personal approach, it still reinforced two key principles about human nature that I already held to be true. The book served as a useful reminder for me. These are the two principles:</p><ul><li><strong>Show genuine interest in people</strong>. This idea is something I had already established in my life, so I’ll put my own spin on it: if you’re part of my life, I am invested in your well-being. This means actively listening, asking meaningful questions, providing support, and paying attention to your needs. My read of how it was presented in the book felt a little deceptive to be honest. Sure, while it’s true that being this kind of person can have positive outcomes, an inauthentic display of these behaviors can quickly become a turn off.</li><li><strong>No one screws up intentionally</strong>. While in my mind, this has always translated to sympathy or compassion, the author shares an excellent story to make the point clear. Here is the gist of the story:</li></ul><p><em>A renowned pilot was flying a plane when both of his engines failed. He managed to land safely but the aircraft was severely damaged. The cause of the engine failure was found to be an accidental filling with the wrong fuel. When the pilot returned to the airport, he encountered the mechanic who made the mistake. The mechanic was in tears anticipating the pilot’s anger. However, the pilot said that to demonstrate his faith in the mechanic having learned his lesson, he’d like the same mechanic to service his plane the next day. </em><strong><em>The pilot essentially said that he trusted that mechanic even more now because he will likely never make this mistake again.</em></strong></p><h3>Quiet: The Power of Introverts in a World That Can’t Stop Talking</h3><p>The last book of the year! And I finished this book on December 31st 🙃. This book was recommended to me by a very close person, who maybe knew me better than I knew myself. Sometimes, it felt like the author was literally talking about me. Even though this was the last book I read (i.e. its impact hasn’t been well tested), I can already feel that this book will have a lasting impact for the rest of my life. For the longest time, I thought that I was an extrovert, but what I had missed was that I can still enjoy good company and good experiences, yet absolutely need my alone time to recharge. This book helped me understand myself better, and here are my top favorite findings from this book:</p><ul><li><strong>Being an introvert does not mean that someone is shy or lacks social skills. </strong>Perhaps this is the reason I’ve always wanted to stay away from being labelled as introvert… I’ve always enjoyed giving talks, I enjoy hosting people, and I often talk to strangers at coffeeshops. The book deconstructed all of that for me, and I finally understood that I could enjoy doing all these things, yet need my down time to fully recharge.</li><li><strong>Work alone</strong>. The author challenges the notion that working alone is bad and refutes the emphasis placed on teamwork in work culture. Drawing on the perspectives of experts such as Steve Wozniak, she argues that solitude fosters creativity and cites research studies to support her claim, including studies that show the effectiveness of allowing individuals to brainstorm alone. Of course, it’s still important to work in teams… it’s just not bad to sometimes work alone.</li><li>Maybe my favorite quote from a year of reading:<strong> “Embarrassment is a moral emotion”</strong>. I think this quote encapsulates a slightly bigger idea for me: <strong>getting comfortable with vulnerable emotions</strong> like embarrassment. I will leave you with this page from the book 👇</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fXjjvtGdsKcq-C3xk9Wg5w.jpeg" /></figure><p>Finally, if you’ve made it this far: thank you for reading! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87bc1d79a79c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Graph Analytics talk @ PyData Global 2022]]></title>
            <link>https://medium.com/@nassarhuda/pydata-global-7e89a941fda8?source=rss-ce600a9935d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e89a941fda8</guid>
            <category><![CDATA[network-science]]></category>
            <category><![CDATA[julialang]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[graph-analytics]]></category>
            <dc:creator><![CDATA[Huda Nassar]]></dc:creator>
            <pubDate>Mon, 28 Nov 2022 14:56:39 GMT</pubDate>
            <atom:updated>2022-11-28T14:56:39.249Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a place to keep the slides for this talk and leave any relevant material after the talk.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdocs.google.com%2Fpresentation%2Fembed%3Fid%3D1kitcdi4vvuliCp3pDH73FP3t3oqzLLch8Ryt8FQ58UU%26size%3Dl&amp;display_name=Google+Docs&amp;url=https%3A%2F%2Faccounts.google.com%2Fv3%2Fsignin%2Fidentifier%3Fdsh%3DS1863287135%253A1669645984270725%26continue%3Dhttps%253A%252F%252Fdocs.google.com%252Fpresentation%252Fd%252F1kitcdi4vvuliCp3pDH73FP3t3oqzLLch8Ryt8FQ58UU%252Fedit%26followup%3Dhttps%253A%252F%252Fdocs.google.com%252Fpresentation%252Fd%252F1kitcdi4vvuliCp3pDH73FP3t3oqzLLch8Ryt8FQ58UU%252Fedit%26ltmpl%3Dslides%26osid%3D1%26passive%3D1209600%26service%3Dwise%26flowName%3DWebLiteSignIn%26flowEntry%3DServiceLogin%26ifkv%3DARgdvAswCBca6mi9dCVYdJvaxUHTGSDhWIwxxyUlZF2OLSMt6bbsdtqzrr8Jgc8FXGnpoCvkIpaw-g&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=google" width="700" height="559" frameborder="0" scrolling="no"><a href="https://medium.com/media/a76e99e4b96f682fcfd5e18bfcc91534/href">https://medium.com/media/a76e99e4b96f682fcfd5e18bfcc91534/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e89a941fda8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who is the most important member of the Targaryen family?]]></title>
            <link>https://medium.com/@nassarhuda/who-is-the-most-important-member-of-the-targaryen-family-de67d522304d?source=rss-ce600a9935d------2</link>
            <guid isPermaLink="false">https://medium.com/p/de67d522304d</guid>
            <category><![CDATA[centrality]]></category>
            <category><![CDATA[relational-databases]]></category>
            <category><![CDATA[targaryen]]></category>
            <category><![CDATA[pagerank]]></category>
            <category><![CDATA[graph]]></category>
            <dc:creator><![CDATA[Huda Nassar]]></dc:creator>
            <pubDate>Mon, 10 Oct 2022 12:27:00 GMT</pubDate>
            <atom:updated>2022-10-17T17:19:17.074Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Short answer: well… it depends. Slightly longer answer: keep reading :).</em></p><p>⚠️ this blogpost contains some spoilers ⚠️</p><p>If you are one of the ~44 million people who have watched <em>Game of Thrones</em>, or if you’ve recently started watching <em>House of the Dragon, </em>then you already know about the Targaryens. Well, chances are, even if you haven’t seen these shows, you probably already know about this family anyway 🙃.</p><p>So… without too much suspense, I’ll jump straight to the point. In this blogpost I want to answer one key question: “<strong>who is the most important Targaryen?</strong>”— maybe the next time someone asks you who your favorite Targaryen is, you can point them to this blogpost and possibly back up your answer.</p><p>I will use some common graph algorithms strategies (graph centrality in specific) to try and investigate this. You can also learn a lot about graph centrality throughout this post.</p><p>Enjoy!</p><h3><strong><em>The Targaryen family tree as a graph.</em></strong></h3><p>House Targaryen is known for many things, and one of them is that marriage is allowed between siblings, first cousins, and uncles/aunts with nephews/nieces. So the family <em>tree</em> is not really a tree, think of it as a graph.</p><p>I used the figure from <a href="https://www.popsugar.com/entertainment/targaryen-family-tree-48863948">here</a> to build my own Targaryen graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wC4ZA4rMWwsWrQv-ywNTLg.jpeg" /><figcaption>House Targaryen (<a href="https://media1.popsugar-assets.com/files/docs/POPSUGAR_House_of_Targaryen_Family_Tree_16632605648193.pdf">source</a>)</figcaption></figure><h4>Here’s how I built the graph:</h4><p>I simplified things and only created the relations where two people are married or when one person is the parent of another person. The data is organized in two files and looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fRgvQSGl-T_jt5Cq" /><figcaption>From the edges file, we know that “node 1” and “node 2” are married, and “node 1” is a parent of “node 5”. From the characters file, we know that “node 1” is King Aegon I Targaryen. The full data is available <a href="https://github.com/nassarhuda/Targaryen">here</a>.</figcaption></figure><p>This file has one missing relationship that is important to record, and that is the siblings relationship. But this is pretty easy to deduce in any programming language and especially easy to deduce in <a href="https://relational.ai/">RelationalAI</a>’s declarative language Rel. The Rel code to obtain the siblings relationship is pretty straightforward — you only need to write the logic:</p><pre>def T(“sibling”, x, y) = exists(<br>    p1, p2 : <strong>// exists parents p1 and p2 such that</strong><br>    T(&quot;married&quot;, p1, p2) and <strong>// p1 and p2 are married, and</strong><br>    T(&quot;child&quot;, p1, x) and T(&quot;child&quot;, p2, x) and <strong>// both parents of x</strong><br>    T(&quot;child&quot;, p1, y) and T(&quot;child&quot;, p2, y) and <strong>// both parents of y</strong><br>    x != y <strong>// and a child can&#39;t be a sibling of themselves.</strong><br>)</pre><pre><strong>// Note: T is the relation name, it has the set of all tuples <br>// of the form (relation_type, person1, person2)</strong></pre><h4>We’re ready to define the graph:</h4><p>There are multiple ways you can build this graph (for example: you can create a labeled graph or a hypergraph), but for now, we will keep things simple and define our nodes and edges as follows.</p><ul><li>A node in this graph is a member of the Targaryen family from <a href="https://github.com/nassarhuda/Targaryen/blob/main/characters.txt">here</a>.</li><li>An edge between two nodes in this graph means that the two nodes are part of the same immediate family, meaning they are either siblings, partners, or one is the parent of the other.</li></ul><p>This formulation, is, again, easily achievable in Rel in the following way:</p><pre>def G = person1, person2 : T(_, person1, person2)<br><strong>// The `_` means that this value could be anything<br>// in our case it was either &quot;married&quot; or &quot;child&quot; or &quot;sibling&quot;.</strong></pre><h3>Applying centrality algorithms.</h3><p>In very basic terms, the goal of centrality algorithms is to measure a node’s importance in a graph. If you use Twitter for example, and you follow some people and some people follow you, then you are a node in the Twitter graph and every follow represents an edge. I don’t have access to the full Twitter data, but I am willing to bet that people like Elon Musk, Barack Obama, Taylor Swift, and Oprah have some of the higher centrality scores (in multiple centrality measures) in the network.</p><p>There are many different kinds of centrality, and I am hoping to dissect each of them in future blogposts (<a href="https://twitter.com/nassarhuda/status/1549380522727641091">sneak peek</a> for the PageRank one, it’s coming up next). For now, I will give a very brief explanation of the five centrality measures we will use, and then, finally, answer the question I posed in the very beginning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B2h4Sy-v1B3Wr05_" /><figcaption>A brief summary of the five types of centrality algorithms we use.</figcaption></figure><ul><li><strong>Degree Centrality: </strong>this is one of the most basic centrality measures. A node’s importance is immediately correlated with how many connections this node has (known as a node’s degree). For example, on the Twitter network, recent <a href="https://en.wikipedia.org/wiki/List_of_most-followed_Twitter_accounts#:~:text=Most%20followed%20accounts%20on%20Twitter,-The%20following%20table&amp;text=Former%20U.S.%20President%20Barack%20Obama,with%20over%20133%20million%20followers.">numbers</a> show that Barack Obama is the most followed person on Twitter, and thus his degree centrality measure is the highest (there is a subtlety here: because the Twitter graph is directed, this is really the in-degree centrality, but we will get to this in more detail when I discuss this type of centrality in the future — for now, the goal is to understand it intuitively).</li><li><strong>Betweenness Centrality: </strong>this centrality is good at measuring how much a node happens to appear on paths <em>between</em> any two nodes in the graph. So for example, if we build a graph for train stations in the US, we will likely find that train stations in the middle of the country will have a higher betweenness centrality measure.</li><li><strong>Eigenvector Centrality: </strong>an easy way to understand this type of centrality is to think of it as: “a node is as important as its neighboring nodes”. If you look at the equation in the above figure, you’ll notice that the eigenvector centrality of a node is a summation of the eigenvector centrality of all its neighbors (multiplied by the same scalar).</li><li><strong>Katz Centrality:</strong> when you hear about eigenvector centrality, you often also hear about Katz centrality — and that’s because these two types of centralities are very similar mathematically. Here is what the Katz centrality means: a node’s importance is determined by its 1-hop neighbors’ importance, and its 2-hop neighbors’ importance, and so on. Though, this importance of k-hop nodes is weighted according to how close they are to the node of interest. For example, nodes at 10-hops away from the node of interest still contribute to the Katz centrality but not as much as nodes at a 1-hop nodes.</li><li><strong>PageRank: </strong>since the PageRank centrality blogpost is coming up next, and since it is a little tricky to explain this type of centrality without diving into some mathematical formulations, I will postpone the full details for the next blogpost on PageRank and stick to the small definition provided in the figure above.</li></ul><h3>Okay, so who is the most important Targaryen.</h3><p>Before I share the rest of the results, I want to share a personal gratification story.</p><p><em>For the past three months, I’ve been working on implementing these algorithms in Rel (</em><a href="https://relational.ai/"><em>RelationalAI</em></a><em>’s declarative language) and for the past couple of days I got to run my own Rel implementations on the Targaryen graph… It was pretty gratifying to use Rel to do this. (Also, don’t worry, I’ve validated the results with </em><a href="https://github.com/JuliaGraphs/Graphs.jl"><em>Graphs.jl</em></a><em> and </em><a href="https://github.com/JuliaGraphs/MatrixNetworks.jl"><em>MatrixNetworks.jl</em></a><em>).</em></p><p>Anyway, finally, time for the results. Below, I share the top 10 characters in each of the centrality measures I used. I accompany them with the original <a href="https://media1.popsugar-assets.com/files/docs/POPSUGAR_House_of_Targaryen_Family_Tree_16632605648193.pdf">figure</a> I used, and I circle the top 10 characters. While the figure with the circles might be too small, the reason I provide it is to make a few observations clearer. So here are some observations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XaFi6KcU2r9_Ilc38rUBcA.png" /><figcaption>The top-10 results of the five centrality measures I applied on the Targaryen graph. Click on the image to enlarge it and browse and investigate the results for yourself.</figcaption></figure><ol><li>Degree Centrality identified the people who had one degree of separation from many people, which can be useful in a social network setting but given the timeline implied on this family graph, these numbers do not indicate much as they did not occur at the same time.</li><li>Betweenness Centrality: the way this figure is shown also shows a time aspect, so I wanted to draw attention to the fact that nodes with the highest betweenness centrality happened to be somewhere in the middle of this timeline. This is very similar to when we considered a transportation network in the US.</li><li>Eigenvector Centrality identified the top 10 to be from the same family. In fact the only reason not all siblings are circled on the third line is because the last sibling’s rank was 11 (with the same eigenvector centrality value as their unmarried siblings). Recall that eigenvector centrality can be understood as “<em>a node is as important as its neighboring nodes</em>”. Interestingly, the identified family was the largest family (or clique) in our graph, and thus every node kept <em>feeding</em> its neighbor nodes “score”, but was also being fed from the same neighbors.</li><li>Katz Centrality is almost identical to the eigenvector centrality with the only exception of two characters. But if we look at the next three spots in this centrality measure they all belong to the rest of the family started by <em>King Jaehaerys I </em>and <em>Queen Alysanne.</em></li><li>PageRank identified the highest number of “figure” characters, i.e. characters who have been highlighted in GoT or HotD.</li></ol><p>So now… to answer the question, who is the most important character? While making big claims about House Targaryen is a tricky matter, I’d like to answer this question with PageRank’s results — notice that out of the four identified characters that were not kings or queens, three of them have appeared on one of the shows and had key roles to play.</p><pre>Prince Rhaegar<br>Prince Aegon (Aegon the Unlikely King Aegon V)<br>Princess Alysanne (Queen Alysanne)<br>Prince Jaehaerys (King Jaehaerys I)<br>Prince Maekar (King Maekar)<br>Prince Daemon<br>Prince Aegon(King Aegon III)<br>Prince Viserys (King Viserys)<br>Princess Rhaenyra Targaryen<br>Prince Aemon</pre><p>Thank you for reading! If you have more thoughts on how to analyze these results, I’d love to hear them — please share them below or on Twitter. Finally, I referenced future blogposts multiple times, so stay tuned, the PageRank blogpost is coming up next.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de67d522304d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>