<?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 Iswarya Murali on Medium]]></title>
        <description><![CDATA[Stories by Iswarya Murali on Medium]]></description>
        <link>https://medium.com/@iswaryam?source=rss-e3d334424cdf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*P3RO4TpU-8Sb--ZhNixjKA.png</url>
            <title>Stories by Iswarya Murali on Medium</title>
            <link>https://medium.com/@iswaryam?source=rss-e3d334424cdf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:07:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iswaryam/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[Trustworthiness of Generative AI: Reducing hallucinations and increasing transparency]]></title>
            <link>https://medium.com/data-science-at-microsoft/trustworthiness-of-generative-ai-reducing-hallucinations-and-increasing-transparency-a53dfe190ee1?source=rss-e3d334424cdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/a53dfe190ee1</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[responsible-ai]]></category>
            <dc:creator><![CDATA[Iswarya Murali]]></dc:creator>
            <pubDate>Tue, 30 Apr 2024 07:17:27 GMT</pubDate>
            <atom:updated>2024-04-30T23:45:18.516Z</atom:updated>
            <content:encoded><![CDATA[<p><em>“I knew I had just seen the most important advance in technology since the graphical user interface.”</em> — <a href="https://www.gatesnotes.com/The-Age-of-AI-Has-Begun"><em>Bill Gates, about ChatGPT acing an AP-level biology test</em></a></p><p>Generative AI’s surge in popularity has opened up new and innovative possibilities, transforming the way we live and work. According to a study conducted by PwC, <a href="https://www.pwc.com/gx/en/issues/data-and-analytics/publications/artificial-intelligence-study.html">AI could contribute up to $15.7 trillion to the global economy in 2030</a>. A Forbes Advisor report shows that a staggering <a href="https://www.forbes.com/advisor/business/software/ai-in-business/">97 percent of business owners believe ChatGPT will help their business</a>. These are exciting times for <a href="https://news.crunchbase.com/ai/new-ai-unicorns-2023-list-llm-platforms-cohere/">new startups specializing in Generative AI</a>.</p><p>However, there is a dichotomy in how end users feel about the Generative AI revolution. For instance, <a href="https://www.pewresearch.org/science/2023/02/15/public-awareness-of-artificial-intelligence-in-everyday-activities/">46 percent of Americans are equally concerned and excited about</a> AI (Artificial Intelligence). This type of user mistrust and skepticism has the potential to encumber AI adoption. What are some ways to mitigate inaccurate or misleading content generated by Large Language Models? How can companies build products that users not only love, but trust?</p><h3><strong>Hallucinations</strong></h3><p>Large Language Models (LLMs) have been labeled <a href="https://dl.acm.org/doi/pdf/10.1145/3442188.3445922">stochastic parrots</a> — a fitting metaphor for entities that regurgitate convincingly plausible answers without really understanding the meaning behind them. As Stephen Wolfram put it, a model like ChatGPT is simply <a href="https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/">adding one word at a time.</a> LLMs are trained on massive amounts of data from various sources but aren’t by themselves doing any lookups or referring to external sources of information. This means that an LLM can make misleading claims or factual errors — while sounding fairly confident about the mistake. These counterfactual statements are, <a href="https://www.bloomberg.com/news/newsletters/2023-04-03/chatgpt-bing-and-bard-don-t-hallucinate-they-fabricate">somewhat anthropomorphically</a>, nicknamed <em>hallucinations</em>.</p><p>To some extent, LLMs are <em>meant</em> to hallucinate. It’s Generative AI’s version of “it’s not a bug — it’s by design.” The same capability that makes LLMs hallucinate is also what makes them powerful. On the flip side, there are situations when hallucinations are not desirable, and where it is critical to get truthful and factual responses. As part of the team working on <a href="https://techcommunity.microsoft.com/t5/microsoft-intune-blog/microsoft-introduces-a-preview-of-copilot-in-intune/ba-p/4083276">Copilot in Intune</a> (now in public preview!), I have found that working around the non-determinism of GenAI products to be a persistent challenge. But there are ways to ensure that we can still maintain user trust, while harnessing all the creativity and potential behind the AI.</p><h3><strong>Adding a grounding source of truth</strong></h3><figure><img alt="A computer in a library full of old books with sunlight peeking through the window" src="https://cdn-images-1.medium.com/max/619/1*8nbaUIadaE9mAUB7whmEoQ.png" /><figcaption>Figure 1: Image generated by DALL·E.</figcaption></figure><p>One way to mitigate hallucinations is to augment the knowledge an LLM possesses with a grounding source of truth. Imagine you’re making someone take a test on a complex, previously unseen topic. This person is a fluent English speaker, but they know next to nothing about the topic they’re being tested on. Now, they could simply fabricate answers for all the questions. Or, you can give them an open textbook about the topic they’re being tested on, so they have reference material from which they can answer. This example is a simplified explanation of what grounding represents in the context of LLMs.</p><p>Grounding is table stakes while creating any kind of custom LLM application, especially for internal data (such as customer service chatbots that rely on non–public-facing knowledge bases) or applications that rely on a corpus to retrieve answers (a.k.a., search engines).</p><p>As far as implementation goes, <a href="https://learn.microsoft.com/en-us/azure/search/retrieval-augmented-generation-overview">Retrieval Augmented Generation</a> is probably the most ubiquitous pattern currently used for grounding LLMs. There are numerous out-of-the-box RAG solutions in the market that take in a custom corpus to do retrieval and generation. <a href="https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/use-your-data">Azure Open AI on your own data</a> is one such example, where users can upload a dataset or document from blob storage and “chat” with it. The feature also offers up citations to the source text, along with the response. Making an LLM cite an authoritative source as the reason behind a particular answer automatically increases transparency and adds credibility.</p><p>Grounding can also help with evaluation and validation of response quality, a key component to testing Generative AI applications before making them production worthy for public release. In the absence of a grounding dataset, there is no way to “compare” the responses of an LLM to see if they are based in truth or not. So, choosing the right implementation of RAG and the right grounding dataset is critical for improving factualness of the GenAI application.</p><h3><strong>Increasing explainability</strong></h3><p>Surveys have shown that people think <a href="https://www.bcg.com/press/2november2021-global-executives-using-ai-75-report-it-improves-team-culture">providing too little context on AI decisions can erode trust</a>. Deep Learning models are trained to get accurate and fast predictions, but the end users are often clueless as to <em>why</em> the model generated a particular response. A famous example of this black box behavior occurs in my favorite work of fiction, Douglas Adams’ brilliant <em>Hitchhiker’s Guide to Galaxy</em>.</p><figure><img alt="An image of Douglas Adams’ The Hitchhiker’s Guide to the Galaxy" src="https://cdn-images-1.medium.com/max/886/1*H3Rk-EWB31K8rFPzshiDmA.png" /><figcaption>Figure 2: Photo taken by the author</figcaption></figure><p>In the book, the supercomputer Deep Thought is tasked with working out the Answer to The Ultimate Question of Life, the Universe, and Everything. After 7.5 million years, Deep Thought responds that the answer is 42. The scientists are puzzled, but Deep Thought is quite confident about the answer: “I think the problem, to be quite honest with you, is that you’ve never actually known what the question was.” In order to then calculate the Ultimate Question, a special computer is built, and hilarities ensue — but I won’t spoil the book any further.</p><p>Decades after the book was written, we now have ways to peek behind the curtain, to understand why an AI generated a particular response. While traditional Machine Learning (ML) models use techniques like LIME and SHAP for explainability, Chain-of-Thought (CoT) prompting is a popular technique to add more transparency to Generative AI’s reasoning process. In essence, CoT consists of meta-prompts asking the AI to explain itself or interpret why it arrived at a particular output. In fact, researchers have noted that just adding a phrase like “<a href="https://arxiv.org/abs/2205.11916">Let’s think step by step</a>” also increases the accuracy of generated responses, even in zero-shot scenarios.</p><h3><strong>Employing guardrails</strong></h3><p>Apart from grounding, there are also various other techniques to reduce hallucinations including advanced prompt engineering with CoVE (chain of thought verification), feedback loops with iterative improvements (or “humans in the loop”), using a combination of fine-tuned models with RAG, asking an LLM to self-critique its own output, as well as playing around with the “creativity” and “temperature” of LLM APIs. However, none of these methods are infallible since an LLM is essentially non-deterministic and unpredictable. There could be grave ethical as well as practical implications from Artificial Intelligence making decisions without any oversight. Incorrect predictions could lead to potentially life-threatening implications in fields like medical sciences, pharmacology, autonomous vehicle design, law enforcement, or disaster management. In the end, the safest option is for humans to have the final say in accepting or rejecting any AI-driven predictions. Having the end user in charge of vetting AI decisions also serves as a great feedback loop for developers to learn from and iterate continuously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*69UARIDMScwxy6rlYm4m9Q.png" /><figcaption>Figure 3: Image generated by DALL·E.</figcaption></figure><p>Efforts to reduce hallucinations by improving factualness and transparency will increase user confidence in AI products. In addition, accountability is a key <a href="https://www.microsoft.com/en-us/ai/principles-and-approach/">Responsible AI principle</a> that must be at the center of all AI design. AI can be an amazing tool to revolutionize the way we all live and work — but ultimately, not to replace human judgment.</p><p><em>Iswarya Murali is on </em><a href="https://www.linkedin.com/in/iswarya/"><em>LinkedIn</em></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a53dfe190ee1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-at-microsoft/trustworthiness-of-generative-ai-reducing-hallucinations-and-increasing-transparency-a53dfe190ee1">Trustworthiness of Generative AI: Reducing hallucinations and increasing transparency</a> was originally published in <a href="https://medium.com/data-science-at-microsoft">Data Science + AI at Microsoft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network graphs analysis (Part 2 of 2): Visualizing the characters of Hamilton as a social network]]></title>
            <link>https://medium.com/data-science-at-microsoft/network-graphs-analysis-part-2-of-2-visualizing-the-characters-of-hamilton-as-a-social-network-ed61699df319?source=rss-e3d334424cdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed61699df319</guid>
            <category><![CDATA[hamilton]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[graph-analysis]]></category>
            <category><![CDATA[network-graph]]></category>
            <dc:creator><![CDATA[Iswarya Murali]]></dc:creator>
            <pubDate>Tue, 20 Apr 2021 13:03:42 GMT</pubDate>
            <atom:updated>2021-04-20T17:06:00.028Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the second of a two-part article series on network graphs (please check out Part 1 <a href="https://medium.com/data-science-at-microsoft/network-graphs-analysis-part-1-of-2-introduction-123058657c71?source=friends_link&amp;sk=5eff9a13ae6ac045c59beccb00b5f518">here</a>). In this article, I demonstrate how to visualize a network graph using the lyrics from <a href="https://hamiltonmusical.com/new-york/home/"><em>Hamilton</em></a>, as well as analyze it using graph centrality measures.</p><h3><strong>Getting the data</strong></h3><p><em>“In data science, 80 percent of time spent is preparing data, 20 percent of time is spent complaining about the need to prepare data.”</em></p><p>Data scientists may not agree on everything — but we agree that the most difficult part of any project is getting the data. Lucky for us, that part is behind us for the purposes of this article. There is a nice clean <a href="https://www.kaggle.com/lbalter/hamilton-lyrics?select=ham_lyrics.csv">dataset of <em>Hamilton</em> lyrics readily available on Kaggle</a> that you can simply download and start graphing.</p><h3><strong>Exploratory analysis</strong></h3><p>This is what the <em>Hamilton</em> dataset looks like. There is one line of record per character/per song/per line of lyric.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*OHY95Xl15Re2-raEN6mZTw.png" /></figure><ul><li><strong>Title</strong> refers to the name of the song.</li><li><strong>Speaker</strong> refers to the character who is singing a given line.</li><li><strong>Lines</strong> refers to the particular line of lyric within the song.</li></ul><p>I use <a href="https://powerbi.microsoft.com/en-us/">Microsoft Power BI</a> for my exploratory data analysis (<a href="https://en.wikipedia.org/wiki/Exploratory_data_analysis">EDA</a>). With just a few drag-and-drop clicks I’m able to quickly explore the dataset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-u6pNkwTgx1D7cA0T9hChw.png" /></figure><p>No surprises here: The titular Hamilton and his nemesis Burr have the highest number of lines in the musical.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uC5wT8d9jWts72TDjTKIqA.png" /></figure><p>The fast-paced song “The Room Where It Happens” has the highest number of lines of all the songs — followed by, somewhat fittingly, “Non-Stop.”</p><p>So what else can we do beyond creating static bar charts? Power BI has an interactive visual called a <a href="https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-decomposition-tree">decomposition tree</a> to drill down into <strong>count(lines)</strong> by both song <em>and </em>speaker. This is a nifty feature that can be used to analyze an aggregate measure across multiple dimensions.</p><p>For example, I can click on the song “Satisfied” and look at which speakers have the highest number of lines <em>within </em>the song (and if you’re a <em>Hamilton</em> fan, you already know the answer!) — and look at <em>which</em> lines they have sung as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dk2l6A4fPql1CQ6wd1gyeQ.png" /><figcaption>Decomposition tree for relationships between songs/characters</figcaption></figure><p>Even this screenshot doesn’t do it justice — really, the decomposition tree is one of my favorite Power BI visuals. It can be used for any kind of root cause analysis, such as for projects involving visualizing sales and adoption by country and industry, and so on.</p><h3><strong>Building an adjacency matrix</strong></h3><p>In order to build a network graph of all the <em>Hamilton</em> speakers, the following must be defined:</p><ul><li>Nodes (list of speakers)</li><li>Edges (to connect each pair of speakers)</li><li>Incidence function to map each pair of vertices to an edge (with an optional weight)</li></ul><p>The incidence function I’ve chosen is the <strong>Number of songs each pair of speakers appears in together</strong>. My assumption is that the more songs two characters appear together in, the stronger their relationship.</p><pre><strong>Weight</strong> {speaker,x, speaker,y} = #songs that feature both speaker,x and speaker,y</pre><p>Using R’s dplyr, I am able able to transform my original dataset into an <strong>{src, dest, weight}</strong> entity, and then convert that into an adjacency matrix. I can then use graph.adjacency in <a href="https://www.rdocumentation.org/packages/igraph/versions/1.2.6/topics/graph_from_adjacency_matrix">R’s igraph package</a> to create a “graph object” from this adjacency matrix, which I can then use for plotting and other analyses.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/80cb98cf40ca1c13d86855405de36f07/href">https://medium.com/media/80cb98cf40ca1c13d86855405de36f07/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*B6VrHu0lGnYHHkoitHP6mw.png" /><figcaption>Flat data file transformed into a weighted adjacency matrix</figcaption></figure><h3><strong>Visualizing the network plot</strong></h3><p>The graph_obj can be visualized using the <a href="https://igraph.org/r/doc/plot.igraph.html">plot.igraph</a> function. Because this function has many custom layouts to choose from, I start by rendering the same graph using the “star” layout.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d62ce8f6de06d6498fcbf51e122fed4/href">https://medium.com/media/2d62ce8f6de06d6498fcbf51e122fed4/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*SrIs1xbVjqxZhSgQ5V_6Aw.png" /></figure><p>The result is technically a network plot. But is it possible to do even better? The chart above seems to suggest that all vertices and edges have equal importance — but that undermines the whole point of visualizing a social network. Some characters are indeed more “significant,” and some speakers have stronger relationships relative to others. How can this graph reflect that?</p><p>This is where <strong>edge weight </strong>and <strong>vertex </strong><a href="https://en.wikipedia.org/wiki/Degree_(graph_theory)"><strong>degree</strong></a><strong> </strong>come into play. I start by playing around with the parameters of the plot.igraph function to make edge.width (i.e., the thickness of the edge in the plot) relative to the weight, and vertex.label.cex (i.e., the font size of the vertices) relative to degree.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec4a193beb1fc941d668fe7fe267d783/href">https://medium.com/media/ec4a193beb1fc941d668fe7fe267d783/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*Smzp-OySbubDCIHciA4sPw.png" /></figure><p>Much better! Characters with a higher degree are visually larger, and the distinction between strong and weak relationships is also apparent from the darkness of the lines. This iteration is much more intuitive and lets the viewer immediately grasp the relationships among characters.</p><p>What else is possible? While plot.igraph is great, its use is restricted to static graphs. So, I used the <a href="http://datastorm-open.github.io/visNetwork/">visNetwork</a> library in R to make an <em>interactive</em> network graph. The library makes it possible to zoom in and out of multiple parts of the graph (especially useful with a particularly large graph), and has support for Shiny.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/35a1f0a7e43647581954cd5f49a2f457/href">https://medium.com/media/35a1f0a7e43647581954cd5f49a2f457/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*5EGKW-VMo_Z1IeTOM8b0ZQ.png" /></figure><h3><strong>Centrality measures</strong></h3><p>In Part 1, I briefly discussed various <a href="https://en.wikipedia.org/wiki/Centrality">centrality</a> measures used to <strong>quantify</strong> the relative significance of the nodes. I can use igraph’s degree(), betweenness(), and eigen_centrality() functions to get these results:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/74e8d23697522870eec0433239890826/href">https://medium.com/media/74e8d23697522870eec0433239890826/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*NdgDzsyJcZJ9VThk4__xCg.png" /></figure><p>It looks like Aaron Burr has the highest <a href="https://en.wikipedia.org/wiki/Centrality#Betweenness_centrality">betweenness centrality</a> (the “bridge”) in our graph, while Hamilton has the highest <a href="https://en.wikipedia.org/wiki/Centrality#Betweenness_centrality">eigenvector centrality</a> (the “influencer”). Make what you will of that.</p><h3><strong>Conclusion</strong></h3><p>In this series of articles, I have explored the usefulness of network graphs in visualizing relationships among entities, and I’ve shared an example of building a network graph from a flat dataset. It’s important to note, however, that network graphs are not without drawbacks. For example, they can be resource intensive. As is the case with any matrix operations, scalability and performance sometimes take a hit. There is also a “cold start” problem — if your dataset is too sparse or there aren’t really many relationships among entities, a network graph is not an effective solution. Used correctly and in the right context, however, they can be valuable to business.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*7S93P4KsR0WtWiwI_rHsew.png" /></figure><h3><strong>Code</strong></h3><p>• <a href="https://github.com/iswaryam/hamilton/">https://github.com/iswaryam/hamilton/</a><br>• Dataset credit: <a href="https://www.kaggle.com/lbalter/hamilton-lyrics">https://www.kaggle.com/lbalter/hamilton-lyrics#</a></p><h3><strong>Resources</strong></h3><p>• <a href="https://www.rdocumentation.org/">https://www.rdocumentation.org/</a><br>• <a href="https://docs.microsoft.com/en-us/power-bi/">https://docs.microsoft.com/en-us/power-bi/</a><br>• <a href="https://igraph.org/r/">https://igraph.org/r/</a><br>• <a href="https://en.wikipedia.org/wiki/Network_theory">https://en.wikipedia.org/wiki/Network_theory</a><br>• <a href="https://gephi.org/">https://gephi.org/</a><br>• <a href="http://datastorm-open.github.io/visNetwork/">http://datastorm-open.github.io/visNetwork/</a></p><h3><strong>Writer bio</strong></h3><p><a href="https://www.linkedin.com/in/iswarya/">https://www.linkedin.com/in/iswarya/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed61699df319" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-at-microsoft/network-graphs-analysis-part-2-of-2-visualizing-the-characters-of-hamilton-as-a-social-network-ed61699df319">Network graphs analysis (Part 2 of 2): Visualizing the characters of Hamilton as a social network</a> was originally published in <a href="https://medium.com/data-science-at-microsoft">Data Science + AI at Microsoft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network graphs analysis (Part 1 of 2): Introduction]]></title>
            <link>https://medium.com/data-science-at-microsoft/network-graphs-analysis-part-1-of-2-introduction-123058657c71?source=rss-e3d334424cdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/123058657c71</guid>
            <category><![CDATA[hamilton]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[network-graph]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[graph-analysis]]></category>
            <dc:creator><![CDATA[Iswarya Murali]]></dc:creator>
            <pubDate>Tue, 06 Apr 2021 13:02:59 GMT</pubDate>
            <atom:updated>2021-05-03T16:43:22.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*YVDKfNYBKpuaQQCCGeKpNA.png" /></figure><p>A few years ago, I was binge reading the <a href="https://georgerrmartin.com/grrm_book/a-game-of-thrones-a-song-of-ice-and-fire-book-one/"><em>Game of Thrones</em></a> books and found myself having a hard time keeping track of all the characters in my head. (This is not surprising — there are more than 150 named characters in the series!) I was going back and forth between chapters or constantly looking up the wiki <a href="https://iceandfire.fandom.com/wiki/A_Song_of_Ice_and_Fire_Wiki"><em>A Song of Ice and Fire</em></a> to remember plotlines. I needed a mental map — surely there was a better way to <em>visualize </em>these characters? And behold: The Internet rewarded me with this incredible <a href="https://qz.com/650796/mathematicians-mapped-out-every-game-of-thrones-relationship-to-find-the-main-character/">Network of Thrones</a> analysis, published by Andrew Beveridge and Jie Shan. Thus started my fascination with <strong>network graphs</strong> — I was intrigued by the possibility of visualizing complex relationships among fictional characters as interconnected networks.</p><p>Even outside of pop culture and literature, network graphs can be a powerful — albeit sometimes underrated — tool within data science to analyze datasets. In the first of this two-part series of articles, I discuss the basics of network graphs and some real-world applications. In the <a href="https://medium.com/data-science-at-microsoft/network-graphs-analysis-part-2-of-2-visualizing-the-characters-of-hamilton-as-a-social-network-ed61699df319?source=friends_link&amp;sk=70d96f5b6f947ea2bca2576215069aee">second article</a>, I walk through a step-by-step example of how you can build your own “social network” using <em>Hamilton</em> characters as an example <a href="https://hamiltonmusical.com/new-york/cast/">(yes, that <em>Hamilton</em>)</a> with R’s igraph library.</p><p>But first, what are network graphs?</p><h3><strong>Diving into the basics</strong></h3><p>Pictured here is <a href="https://en.wikipedia.org/wiki/File:Wikipedia_multilingual_network_graph_July_2013.svg">a sample network graph from Wikipedia</a> that illustrates contributions of Wikipedia editors to different languages. Using this example, here are some basics (or a quick refresher, if you’re already familiar) of graph theory concepts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DaoOwrOVb8Tk91a7JY30jw.png" /></figure><ul><li>Circles representing the languages in which articles were written are the “vertices” of the graph (interchangeably, the “nodes”).</li><li>The “edges” are the lines connecting each pair of vertices. Each edge in the graph is determined through an incidence function that maps a pair of vertices to an edge.</li></ul><p>In this example, each edge represents (by line weight, or thickness) the number of editors who have contributed to <em>both </em>the languages that the line connects.</p><p>This is what we call an undirected simple graph — “undirected” meaning {en--&gt; fr} and {fr --&gt; en} are identical, and “simple” meaning no more than one edge connects each pair of vertices. The graph is also “weighted,” meaning that the thickness of the edges is relative to the <em>strength </em>of relationship between the vertices. In this example the weighted incidence function could look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*Ai5P7cL_rkg92OQ747ubFQ.png" /></figure><p>While the visual representation of graphs in this way is an intuitive approach to quickly show relationships so that they are easy to comprehend, there are even richer insights we can derive from representing a dataset as a graph object. <a href="https://en.wikipedia.org/wiki/Centrality">Centrality</a> is a key concept in graph theory to identify the significance of nodes:</p><ul><li><strong>Degree centrality</strong>: This is a measure of the number of edges connected to each node.</li><li><strong>Eigen centrality</strong>: This represents a measure of how “well connected” a node is, how many links connections share, and so on through the network. It identifies nodes with influence over the whole network, not just those directly connected to it.</li><li><strong>Betweenness centrality: </strong>This is literally how much a given node is <em>between </em>other nodes and acts as a “bridge” among various clusters of networks. It’s a measure of the “influence” of each of the vertices on the rest of the network.</li></ul><h3><strong>Applications of network graphs</strong></h3><p>Business applications of network graphs are numerous:</p><ul><li>Social networking sites make use of network graphs to create communities of similar users and offer targeted recommendations. A rudimentary implementation of the algorithm behind a “suggested friends” feature could look something like this: “Nine out of ten of Alice’s immediate friends are also friends with Bob -&gt; recommend Bob as a potential friend for Alice.”</li><li>Applications that map the shortest distance from place X to place Y (such as maps, ride-sharing services, supply chain and logistics for delivery trucks, and so on) likely use variants of “shortest path” algorithms, popularly known in computer science as the <a href="https://en.wikipedia.org/wiki/Traveling_salesman_problem">traveling salesman problem</a>.</li><li>Network theory is a crucial component of lexical and semantic processing within natural language processing (NLP), in turn used among chatbots and virtual assistants like Alexa, Cortana, Siri, and even IBM’s <a href="https://en.wikipedia.org/wiki/Watson_(computer)#Jeopardy!"><em>Watson winning Jeopardy!</em></a>, a game of puns and wordplay that is far from straightforward.</li><li>Name-dropping party games like <a href="https://en.wikipedia.org/wiki/Six_Degrees_of_Kevin_Bacon"><em>Six Degrees of Kevin Bacon</em></a> that use network graphs.</li><li>In epidemiology, centrality measures may be used in identifying origins of pandemics or “super spreader” events.</li><li>If you think about it, the Internet is simply one gargantuan network of different websites. Search engines make use of <a href="https://en.wikipedia.org/wiki/Knowledge_graph">knowledge graph</a> measures to return the most relevant pages for a particular search query.</li></ul><h3><strong>A business example: Grouping similar features using a network graph</strong></h3><p>Within the <a href="https://docs.microsoft.com/en-us/mem/endpoint-manager-overview">Microsoft Endpoint Manager</a> data science team we have experimented with network graphs to make sense of certain complex datasets. Here’s an example:</p><h4><strong>Problem statement</strong></h4><p>Our dataset was a “wish list” of new features requested by existing customers. Each of the requested features had been manually entered into a CRM system by product managers working directly with customers. As is the case with any unstructured text data, the dataset was subjective and highly contextual and super tricky to parse. Different product managers talking to different customers may have entered their own description of a feature, but the desired outcome was ultimately the same. From a planning perspective, it was important to understand which features needed to be prioritized for engineering investment, as well as identify duplicate and related items to make sure development effort was not duplicated.</p><h4><strong>Implementation</strong></h4><p>First, we built an <em>n</em>X<em>n</em> sparse-weighted adjacency matrix for the number of features (<em>n</em> being the total number of requested features). A similarity index (SI) is defined for each pair in the matrix, based on how many similar customers had requested the same two features. We can hypothesize that the higher the SI number, the more related are the two features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*ZDBVYUwSk4mEleUGirCjrA.png" /></figure><p>We then constructed a graph object from the adjacency matrix and plotted it. (I dive into this in more detail in Part 2, but I’ve included a few notes immediately below.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ADxzDiT-HENuEO3YDGIOA.png" /></figure><p>Each circle represents the features (F1, F2, F3).The thickness of each edge is relative to the SI.</p><p>When we presented this graph, our stakeholders were able to quickly discern features that are strongly correlated. It is intuitive and easily interpretable — and prompted an immediate discussion on where it made sense to synchronize product development efforts.</p><h3>Summary</h3><p>I hope this article underlines the value that network graphs can provide in helping you understand your customer. In the forthcoming Part 2, I go into more detail, demonstrating how to transform a flat dataset of <em>Hamilton</em> lyrics into a social network graph of the characters.</p><p><a href="https://www.linkedin.com/in/iswarya/"><em>Iswarya Murali</em></a><em> is on LinkedIn</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=123058657c71" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-at-microsoft/network-graphs-analysis-part-1-of-2-introduction-123058657c71">Network graphs analysis (Part 1 of 2): Introduction</a> was originally published in <a href="https://medium.com/data-science-at-microsoft">Data Science + AI at Microsoft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>