<?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 John K. Hancock on Medium]]></title>
        <description><![CDATA[Stories by John K. Hancock on Medium]]></description>
        <link>https://medium.com/@jkhancock?source=rss-1182b68fa2fc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5v4nrwLifQFMiQFoXhG75w.jpeg</url>
            <title>Stories by John K. Hancock on Medium</title>
            <link>https://medium.com/@jkhancock?source=rss-1182b68fa2fc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 22:52:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jkhancock/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[Part 3.3: Demonstration of Retrieval-Augmented Generation (RAG) Search — Creating an Index &…]]></title>
            <link>https://medium.com/@jkhancock/part-3-3-demonstration-of-retrieval-augmented-generation-rag-search-creating-an-index-5a0e4246e8e4?source=rss-1182b68fa2fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a0e4246e8e4</guid>
            <dc:creator><![CDATA[John K. Hancock]]></dc:creator>
            <pubDate>Mon, 02 Jun 2025 16:07:24 GMT</pubDate>
            <atom:updated>2025-06-02T16:07:24.201Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 3.3: Demonstration of Retrieval-Augmented Generation (RAG) Search — Creating an Index &amp; Prompt Flow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F9QTBGp-DbBq1ku8.png" /></figure><h3>Welcome back!</h3><p>To recap the previous articles (Parts 3.1 and 3.2) in this series on Retrieval-Augmented Generation (RAG) search, we have</p><ul><li>Prepared email data from the Enron dataset</li><li>Created resources in Azure AI Hub</li><li>Explored the Azure Foundry Studio</li><li>Selected a large language model (LLM) from the <strong>Model Catalog</strong></li><li>Secured the model using the using a custom security filter</li></ul><p>In this article, we’ll focus on the next phase: creating an index for the email collection. This index will enhance the search capabilities of our selected LLM by enabling more relevant and contextual responses. We’ll then build a prompt flow-a visual interface that defines the structure of the search application, from user input to the final output.</p><h3>Creating an Index for the Email Collection</h3><p>In a Retrieval-Augmented Generation (RAG) search system, the index plays a critical role by serving as the structured representation of the external knowledge base-in this case, the processed email collection. Instead of relying solely on the language model’s built-in knowledge, RAG uses the index to retrieve the most relevant pieces of information (or “documents”) in response to a user query. These retrieved results are then fed into the language model as contextual input, allowing it to generate more accurate, specific, and up-to-date responses. By organizing the data into an efficient format for semantic search, the index enables fast, relevant retrieval and acts as the bridge between raw data and intelligent output.</p><p><strong>Upload Files</strong></p><p>In our Hub project, go the Data + Indexes tab in the left navigation blade. Next, select the Indexes tab. Here, you will create a New index for the 100 Enron emails that was collected earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L1XIi3rDEnEb1NpxKO7nQQ.png" /></figure><p>After clicking, a new dialog box opens where you can create a vector index. A vector index is a specialized data structure used to enable fast and accurate similarity search in high-dimensional spaces. It stores vector representations-also known as embeddings-of text chunks, such as sentences or documents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fkXma1JcMtmFRQr2wg7b3g.png" /></figure><p>These embeddings are generated by transforming raw text into numerical vectors using a machine learning model, often one trained for natural language understanding. When a user submits a query, it is also converted into a vector, and the vector index is used to efficiently find the most similar vectors (and their associated text) based on measures like cosine similarity. This approach allows the system to retrieve semantically relevant information, even if the query doesn’t match the original text exactly.</p><p>Using the drop down arrow in the Data Source selection box, choose Upload files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*RiVe7VsMnuQQibll7t_k8A.png" /></figure><p>An Upload button appears. Click the down arrow to Upload files. Navigate to where your files are located on your system, select them, and then upload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*Eitbe6bhiiYqgD-4q6Gorg.png" /></figure><p>Once all of the files are uploaded, click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*fQ1Qiic_3tso5yin5ycNJQ.png" /></figure><h4>Index Configuration</h4><p>We will need to create a new Azure AI search service resource in order to index the emails. Once we create the service, we will need to connect the service to the project, and finally, select it in the dialog box below.</p><p>First, click the blue highlighted Create a new Azure AI Search resource link which takes you back into the main Azure portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*ca04H8-LF-L3a-oyDGc1dA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*CfMihJgNt446LegUK-9zXQ.png" /></figure><p>Enter a Service name for the index (“enronemails” for this demo) and hit Review + create and then create.</p><p>We then return to the Hub. Click the down arrow under Select Azure AI Search service. Click Connect other Azure AI Search resource.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*NeFVFNyKlSk2UDEkP8Z29A.png" /></figure><p>You should see the enronemails search index. Hit the Add connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*VHFWDNFrUOGd-Zv5S26jkw.png" /></figure><p>You are now taken to the screen where you can select the AI search service, enronemails, for your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*ROmZustNwSjLl_zZv7aBHQ.png" /></figure><p>We will leave the rest as defaults and click Next. Click Next again to accept the default settings. Finally, click Next for Review and Finish. At the final screen, click Create vector index.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*9EqXf3OZdIgdhjMBAy7-Jw.png" /></figure><p>The vector index is now complete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHbTv0eer926ooKN1myZnw.png" /></figure><h3>Prompt Flow</h3><p>A <strong>Prompt Flow</strong> is a modular, visual, and code-first framework used to design, test, and deploy end-to-end AI solutions that center around prompt engineering with large language models (LLMs). It allows users to create workflows by chaining together components such as LLM prompts, Python code functions, data inputs, and evaluation steps in a directed graph structure. This enables seamless integration of AI model calls with custom logic and external tools. Prompt flows are particularly useful for building and iterating on natural language processing tasks like summarization, classification, question answering, and data extraction. They also support evaluation and debugging features, allowing users to assess the performance of prompts using test data and metrics before deployment. Once finalized, prompt flows can be published as APIs or integrated into broader applications, making them a powerful tool for operationalizing AI in real-world scenarios.</p><p>In our project overview, select Prompt Flow in the left navigation blade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/219/1*4wUXF1xu86yZH3XCj2V8CQ.png" /></figure><p>Here you can Create, iterate, and debug your orchestration flows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*yAWsu-xrCr93J9CmC1SpDA.png" /></figure><p>An orchestration flow is a structured sequence of interconnected steps designed to automate and coordinate complex processes across different components, services, or tools. For this project, the orchestration flow manages the execution order and data flow between tasks like calling a large language model, executing Python functions, retrieving data, and evaluating outputs. Each step in the flow performs a specific function, and the system ensures that inputs, outputs, and dependencies are handled correctly across the workflow.</p><p>Click Create which opens a dialog box where you can select a new flow. There are several options to choose from. We will use <strong>Multi-Round Q&amp;A on your data</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KWyZbyYDzuhGRzYc79hUMg.png" /></figure><p><strong>Multi-Round Q&amp;A on your data </strong>utilizes indexed files from Azure Machine Learning to provide grounded answers. You can ask a wide range of questions related to Azure Machine Learning and receive responses. The process involves embedding the raw query, using vector search to find most relevant context in user data, and then using GPT to chat with you with the documents. Click “Clone” to proceed. The code flow files are stored in a file on your workspace. Click “Clone” again to accept the default name and proceed.</p><h4>Setting Up the Prompt Flow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WuJOL4smWFTZ61eL3pYnYg.png" /></figure><p>Click the blue Start compute session in the right panel to start a basic compute session for testing. In production, we will assign a more robust compute instance for faster results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*elQMaS5pdYVPLsgvGzWQjQ.png" /></figure><p>The Prompt flow workflow is designed to use a low-code, no-code approach. In the right panel, the <strong>Graph </strong>is a visualization of a series of nodes representing the inputs to outputs. Each node in the graph has a corresponding dialog box in the right panel where you can refine and customize each node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*1DM8X29oXhPkNvuEtmGTdQ.png" /></figure><p>The <strong>Inputs</strong> node captures user inputs that is used throughout the flow. It sets up the variables your flow needs to run, much like input parameters in a function.</p><p>The <strong>Modify Query with History </strong>node enhances the quality and contextual relevance of user queries in a multi-turn conversation. Its main function is to take the current user query and combine it with previous interactions (chat history) to produce a contextually enriched version of the query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eqn2h4INQMS4atLU1mnGYQ.png" /></figure><p>In this dialog box, the Connection drop down is set to our project’s connection, the deployment_name is set to our choice of gpt-4o, and the response_format is set to “type”:”text”.</p><p><strong>Lookup</strong> refers to how the system retrieves relevant information from connected data sources-such as documents, websites, or databases-to support the large language model (LLM) in answering a user’s query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TEl9LucsI-7kb_9UE6a1VA.png" /></figure><p>In the mlindex_content dialog box, select the Registered_Index and the name of our index, coral-pear-rbnzmqxs95.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*aMK5hkLoXLYOOPLsoKi1ww.png" /></figure><p>Select the query_type as Semantic. The final lookup dialog box should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dxq5TYcYihmHXtlUCCLRZA.png" /></figure><p><strong>Chat with context</strong> refers to the ability of a conversational AI system to maintain and use prior messages in a dialogue to generate accurate, coherent, and contextually relevant responses from a large language model (LLM). This feature is essential for creating multi-turn conversations where the meaning of a user’s input often depends on earlier exchanges.</p><p>Similar to the <strong>Modify Query with History</strong> step earlier, select the project name option from the drop down to establish a connection, choose gpt-4o as the deployment name, and choose “type”:”text” as the response format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pg2vJN6cA4AqXgvBmt-iEw.png" /></figure><p>For the remaining nodes below, we won’t make any adjustments in this demo, but I will provide a description of each for your reference.</p><p><strong>Generate Prompt Context</strong> refers to the process of preparing and structuring relevant background information-often retrieved from external data sources-to be inserted into an LLM prompt. The most relevant pieces of content-such as paragraphs, document snippets, or records-are selected and compiled. These are structured into a clean, readable format that can be inserted into the LLM prompt. Hence, the model can generate a grounded and accurate response.</p><p><strong>Prompt variants</strong> are different versions of a prompt template used to experiment with or compare multiple ways of instructing a large language model (LLM) to perform a task. This feature helps users optimize prompt wording, structure, or examples to improve the quality, accuracy, or consistency of the model’s responses.</p><p>Click Save in the top panel to save the flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*elQMaS5pdYVPLsgvGzWQjQ.png" /></figure><h3>Testing the Prompt Flow for our RAG Solution</h3><p>For this portion of the demo, we’ve created an index for the Enron emails and used that index to augment data retrieved from the gpt-4o LLM. With the Prompt flow in place, we can test out the work flow from user input to output.</p><p>To test the efficacy of this RAG search, start by asking the base ChatGPT 4o model a question:</p><p><em>Did Ken Lay, CEO of Enron, ever meet with Republican Congressman, Tom DeLay?</em></p><p>The answer that the base model gives is ambiguous:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fYAUMzuYcRRr2KoDnTpuQg.png" /></figure><p>When asked about a specific meeting, no details are provided.</p><p>Now, in our Prompt flow Chat dialog, we’ll ask the same question:</p><p><em>Did Ken Lay, CEO of Enron, ever meet with Republican Congressman, Tom DeLay?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*n5bHBIXuf0QlYc2-EIXIww.png" /></figure><p>The response that we get is augmented with data from our index which was built on using Enron email data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*fKUBPG72Up0ybyAQsaxN2g.png" /></figure><p>Not only is the response is unambiguously clear that the two did indeed meet, but it also supplements a response with a citation to the source email. We can ask follow up questions:</p><p><em>Who sent and received the email about the meeting?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*m8dO8lPFsJjWs8yFryNijA.png" /></figure><p>What date was the meeting between Ken Lay and Tom DeLay set for?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*DMcNpQ5ozuDwUewnAGG1bQ.png" /></figure><p>We can confirm that these results are accurate by opening the email cited in the responses, LAY_000024.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*fKUBPG72Up0ybyAQsaxN2g.png" /></figure><p>In this part of the demo, we created a search index and used it to enhance the capabilities of the LLM selected in a previous session. We then built a prompt flow workflow, demonstrating the power of Retrieval-Augmented Generation (RAG) search. By asking a question, we were able to retrieve an accurate response directly from an email-highlighting the effectiveness of this approach.</p><p>In the final article of this series, we’ll deploy the model and show how it can be integrated into an application. See you there!</p><p><em>Originally published at </em><a href="https://johnkhancock.substack.com/p/part-33-demonstration-of-retrieval"><em>https://johnkhancock.substack.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a0e4246e8e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 3.2: Demonstration of Retrieval-Augmented Generation (RAG) Search — Selecting an LLM, Safety…]]></title>
            <link>https://medium.com/@jkhancock/part-3-2-demonstration-of-retrieval-augmented-generation-rag-search-selecting-an-llm-safety-95e0f71159f3?source=rss-1182b68fa2fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/95e0f71159f3</guid>
            <dc:creator><![CDATA[John K. Hancock]]></dc:creator>
            <pubDate>Mon, 02 Jun 2025 14:11:36 GMT</pubDate>
            <atom:updated>2025-06-02T14:11:36.528Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 3.2: Demonstration of Retrieval-Augmented Generation (RAG) Search — Selecting an LLM, Safety + security</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qf7wtK_Ef6uK2EKi.png" /></figure><p><strong>Welcome back!</strong> In my previous article (3.1), I explained what a Retrieval-Augmented Generation (RAG) search is, prepared email data from the Enron dataset, created resources in Azure AI Hub, and explored the Azure Foundry Studio. Now that the core components are in place, we’ll move on to selecting a large language model (LLM) from the <strong>Model Catalog</strong> and securing it using the <strong>Safety + Security</strong> features.</p><p>In this article, we’ll cover:</p><ul><li>The role of the LLM in a RAG search</li><li>The Model Catalog in Azure AI Foundry</li><li>ChatGPT’s LLM: <em>gpt-4o</em></li><li>Testing the model</li><li>Safety + Security features</li><li>Creating a Custom Content Filter</li></ul><h3>The Role of the LLM in a RAG Search</h3><p>In a RAG architecture, the <strong>Retriever</strong> locates and returns relevant documents or content chunks from a knowledge base — in this case, an index of Enron emails. The <strong>LLM</strong> acts as the <strong>Generator</strong>, synthesizing a coherent, natural-language response based on the retrieved data.</p><p>Here’s how the LLM fits into the process:</p><ul><li>It reads the user’s query</li><li>Receives the top-k most relevant documents (based on semantic similarity)</li><li>Interprets and integrates the retrieved content</li><li>Generates a fluent response grounded in the source material (without direct quoting unless prompted)</li><li>Fills gaps, summarizes, and enhances clarity as needed</li></ul><p>The LLM adds reasoning, language fluency, and contextual understanding. It helps interpret ambiguous queries, rephrase technical details, and deliver responses that are both informative and easy to understand.</p><h3>The Model Catalog</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lup51aPS-JJFCRxMb6sGBg.png" /></figure><p>The <strong>Model Catalog</strong> is a curated repository of machine learning models within Azure AI Foundry. It supports:</p><ul><li>Model registration and version control</li><li>Easy discovery and comparison of models</li><li>Governance features for responsible AI development</li><li>Collaboration across teams and workflows</li></ul><p>It streamlines the ML lifecycle and helps teams efficiently manage and deploy models within their AI applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ombp0f-SwPlmw0GSx14vSQ.png" /></figure><p>You can filter your selection using a number of categories, e.g. <strong>collections, capabilities, deployment options, inference tasks, fine-tuning tasks, and licenses</strong>. You can even filter out those models for specific <strong>industries</strong> like Financial Services and Health.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*LNM5R4AfqkeiS-1nqNDhJQ.png" /></figure><p>Click the down arrow for Deployment options. There are two options:</p><p>- <strong>Managed compute</strong><br>- <strong>Serverless API</strong></p><p><strong>Managed compute</strong> uses a persistent Azure Kubernetes Service (AKS) or Azure Machine Learning compute cluster that you manage for inferencing. You pay for the compute whether or not it’s being used.</p><p><strong>Serverless API</strong> is a fully managed, on-demand environment where Azure automatically provisions, scales, and deallocates compute resources to serve your model. You’re charged based on the number of requests and the compute time used. Filtering on Serverless API creates a list of LLMs that we can use without incurring charges. Select <strong>Serverless API </strong>to filter the catalog.</p><h4>ChatGPT’s LLM gpt-4o</h4><p>For this demonstration, we’ll choose ChatGPT’s gpt-4o. Released in May 2024, the gpt-4o (“o” stands for omni) is a multimodal model which means that it can be used to handle text, audio, images, and video. Hit the Deploy button to deploy the model to your project assets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xqxgwa6Ga-3HNNOjzJgU8A.png" /></figure><p>Hit Deploy again</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*WcM_JlmdcdfRSDffUICgNQ.png" /></figure><p>The model has now been added to the project’s assets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*r9ZsSeewKapF6XlSCY3tNQ.png" /></figure><h4>Testing the Model</h4><p>To test the LLM model, click Open in playground. The Chat playground interface is open. The Chat Playground in Azure AI Foundry is a user-friendly interface that allows you to experiment with and customize AI-powered chatbots or assistants using Azure OpenAI models (like GPT-4 or GPT-3.5). It’s designed to help you prototype and refine conversational experiences quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvR3AWVJTqiZ6yZ7NOB2Vw.png" /></figure><p>The middle panel is split between “ <strong>Setup</strong>” and “ <strong>Chat history</strong>”. In the Setup section, take note of the prompt. The <strong>Setup</strong> section of the panel in the <strong>Chat Playground</strong> within <strong>Azure AI Foundry</strong> is where you <strong>configure the core behavior and capabilities</strong> of your chat assistant. Think of it as setting the rules and structure for how your assistant will behave and interact.</p><p>The <strong>Chat History</strong> section in the <strong>Chat Playground</strong> of <strong>Azure AI Foundry</strong> is where you can view, manage, and interact with previous conversations you’ve had with your assistant. It’s like a <strong>log of your chat sessions</strong>, making it easy to revisit or continue past work.</p><p>To test our chosen LLM model, gpt-4o, we want our assistant to help people find information. At this point in our project, our LLM does not have any data from us. In the Chat history section, type in the following query:</p><p>“ <em>Did Ken Lay, CEO of Enron ever meet with Republican Congressman Tom DeLay?</em> “</p><p>Here is the answer that the LLM alone returns:</p><p><em>Yes, Ken Lay, the former CEO of Enron, did have interactions with prominent politicians, including Republican Congressman Tom DeLay. Both men were influential figures in their respective fields-Lay in business and DeLay in politics-and were part of the political and corporate network that existed during the late 1990s and early 2000s.</em></p><p><em>Ken Lay was known for his significant political connections and contributions to both Republican and Democratic politicians, though he leaned more heavily toward Republicans. Congressman Tom DeLay, who served as House Majority Leader, was one of the most powerful Republicans in Congress during that period. There is evidence that Lay and DeLay crossed paths through fundraising events and political engagements, as Lay was an active donor and fundraiser for Republican causes.</em></p><p><strong><em>While direct, detailed accounts of specific meetings between the two may not be widely documented, their association is often cited in discussions of the close ties between Enron and political leaders. </em></strong><em>Lay’s political connections were scrutinized during the fallout of the Enron scandal, and DeLay himself faced legal and ethical controversies during his career.</em></p><p>Keep this answer in mind as we move through the project. Now, we’ll move on to Safety + security.</p><h4>Safety + security</h4><p>The Safety + Security feature in Azure AI Foundry ensures that AI applications are developed and deployed responsibly and securely. It includes built-in protections aligned with Microsoft’s Responsible AI principles, such as content filtering, groundedness checks, and safeguards against prompt injection. When building a Retrieval-Augmented Generation (RAG) search using Azure AI Foundry, incorporating a content filter is essential to ensure the safety, relevance, and appropriateness of the generated responses. Since RAG systems combine retrieved content from potentially vast and diverse data sources with generative AI, there is a risk of exposing users to harmful, sensitive, or off-topic information. A content filter helps mitigate this risk by screening both the retrieved documents and the generated outputs for issues like profanity, biased language, confidential data, or policy violations. This not only safeguards users but also upholds compliance with organizational standards and responsible AI principles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FcGA3vunGDP5kZbOU6WhoQ.png" /></figure><h4>Content Filtering</h4><p>Back in the project, click the “Safety + security” tab in the left navigational blade and then choose the “Content filters” tab in the middle panel. Click “Create content filter” to move to the next panel. Here, we’ll use the default name and click the down arrow to select the connection to the hub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*XEV3aZuDvChFjbQoLHfZIQ.png" /></figure><p>Click Next to go to the Input filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jTBqJYkzVfsc9vAJgSrD7Q.png" /></figure><h4>The Input Filter</h4><p>The Input Filter settings in Azure AI Foundry control how incoming user prompts are evaluated before being processed by the model. These settings typically allow you to enable or disable filters for specific content categories such as hate speech, violence, sexual content, self-harm, and profanity. By adjusting the sensitivity or strictness levels for each category, you can customize the filter to either block, flag, or allow certain types of input based on your application’s safety requirements. This helps prevent inappropriate or harmful queries from influencing the AI model’s responses.</p><p>The main content filter categories include Violence, Hate, Sexual, Self-Harm, Jailbreaks, and Indirect Attacks. For the first four categories, you can configure a threshold level to control how strictly content is filtered. The <strong>Low</strong> threshold is the most strict, blocking content detected at low, medium, and high severity levels. The <strong>Medium</strong> threshold is moderately strict, filtering only content at medium and high severity, while allowing low-severity content. The <strong>High</strong> threshold is the most lenient, filtering only content identified as high severity. Although it may seem counterintuitive, a “Low” threshold applies the most aggressive filtering, while “High” applies the least.</p><p>Given to the nature of the project. we will put each setting at Low. None of these categories are subjects of this particular demonstration.</p><p>The Prompt Shield in Azure AI Foundry is designed to detect and prevent advanced prompt-based threats such as jailbreaks and indirect attacks. Jailbreaks occur when users craft inputs specifically intended to bypass content filters or manipulate the model into producing unsafe or restricted outputs. Indirect attacks, on the other hand, use subtle or disguised language to coerce the model into generating harmful content without triggering traditional filters. The Prompt Shield analyzes incoming prompts for these kinds of adversarial tactics and blocks or flags them before they reach the model. This proactive layer of defense helps ensure the integrity and safety of the system, especially in public-facing or high-risk applications.</p><p>For this project, we will use the setting Annotate and block, and we will use the same settings for the Outputs as well.</p><h4>Deploying the Filter to the Model</h4><p>We can deploy the filter to the model. Check the box next to the LLM that we have deployed and then click next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10SgQ_v4YDW9yVrW3sTSxw.png" /></figure><p>You will get a popup asking you to replace the existing filters. Click Replace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TXW1oCxmIVj9ccxGFexUzw.png" /></figure><p>The final screen prompts you to review all of your choices. If satisfied, click Create filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3nhnuD5mBFNAUT4JpEXG7A.png" /></figure><p>Your custom filter has now been added to your LLM model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*yc-1ZSfrak8RM7JbOizHSg.png" /></figure><h4>Summary</h4><p>Here’s a quick recap of what we covered in this section:</p><ul><li>Explained the role of a large language model (LLM) in a RAG (Retrieval-Augmented Generation) search</li><li>Selected ChatGPT’s GPT-4o from over 1,900 models in the Azure Model Catalog</li><li>Deployed the chosen model to our project</li><li>Tested the model’s performance</li><li>Created and deployed a customized content filter tailored to our project</li></ul><p>The project is progressing well. In the next article (3.3), we’ll focus on creating an index for the emails and designing a prompt flow. Once those are in place, we’ll be ready to test the RAG search using the previously processed Enron emails.</p><p>You can let me know if you have any questions or need clarification by clicking the button to leave a comment.</p><p>Until next time!</p><p><em>Originally published at </em><a href="https://johnkhancock.substack.com/p/part-32-demonstration-of-retrieval"><em>https://johnkhancock.substack.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95e0f71159f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 3.1: Demonstration of Retrieval Augmented Generation (“RAG”) Search using Azure AI Foundry]]></title>
            <link>https://medium.com/@jkhancock/part-3-1-demonstration-of-retrieval-augmented-generation-rag-search-using-azure-ai-foundry-af9217e418b8?source=rss-1182b68fa2fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/af9217e418b8</guid>
            <dc:creator><![CDATA[John K. Hancock]]></dc:creator>
            <pubDate>Fri, 23 May 2025 15:48:30 GMT</pubDate>
            <atom:updated>2025-06-02T16:23:17.098Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/801/0*ytlSLAnFNts7hJ0o.png" /></figure><p>In the first two parts of this series, I provided a broad overview of AI, Machine Learning, and an introduction to Azure AI services. In this third installment, I will demonstrate Retrieval-Augmented Generation (RAG) search-an increasingly valuable AI application in eDiscovery-through a series of articles.</p><p>Part 3.1 begins by explaining what a RAG search is, exploring the Enron dataset as the foundation for our project, and setting up an Azure AI Hub and project using Azure AI’s Foundry. Foundry is a unified platform designed to empower developers, AI engineers, and IT professionals to build, customize, test, deploy, and manage generative AI applications. With its comprehensive suite of tools and services, it streamlines AI development and management, driving innovation and efficiency across industries.</p><h4>What is a RAG search</h4><p>An Azure Retrieval-Augmented Generation (RAG) search leverages Azure AI services, such as Azure OpenAI and Azure AI Search, to enhance large language model (LLM) responses with domain-specific knowledge. Rather than relying solely on pre-trained data, RAG dynamically retrieves relevant documents from a vectorized index before generating answers. This approach improves accuracy, minimizes hallucinations, and ensures responses are grounded in up-to-date, contextually relevant information.</p><p>Azure AI Search efficiently indexes and retrieves data, while Azure OpenAI processes and synthesizes responses, making RAG a powerful solution for legal, financial, and enterprise applications that demand precise, knowledge-based AI interactions.</p><p>Today, eDiscovery service providers offer a range of off-the-shelf RAG search solutions. However, there is no universal, one-size-fits-all approach. As this demonstration will show, building a custom solution requires making key decisions-each of which can impact the quality of the final product. My goal is to guide eDiscovery practitioners through the process of creating their own tailored RAG solution using Azure AI. At the very least, this will equip them with the knowledge to ask the right questions when evaluating third-party service providers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*ocU05iTsJ3vuFqQj_KpOKg.png" /></figure><p>In the above diagram, the user’s query is sent to an LLM which augments the response by data stored in files and databases. By adding an information retrieval system, the user gains control over grounding data used by an LLM when it formulates a response. For an enterprise solution, RAG architecture means that you can constrain generative AI to <em>your enterprise content</em> sourced from vectorized documents and images, and other data formats if you have embedding models for that content.</p><h4>The Enron Email Dataset — Sourcing the Data</h4><p>I’ll start with emails which are the most common form of data for Ediscovery projects, and the Enron email data set is the most used for testing. The dataset consists of 500,000 emails from 150 Enron employees. The dataset was made public during the investigation of Enron in 2001, and it’s been used for machine learning, natural language processing, and AI.</p><p>The dataset was downloaded from <a href="https://www.cs.cmu.edu/~enron/?utm_source=chatgpt.com">Carnegie Mellon University (CMU)</a>. For this project, I culled 100 emails (~424 KBs) from custodian, Ken Lay, CEO of Enron. Each file contains extracted text from his emails. I re-named each file with the prefix “LAY_” and a six-digit numbering scheme.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*dted_UkPm_2vkgUgGis5Xw.png" /></figure><p>Now that we have the data, let’s move onto creating the Azure AI Foundry hub and project.</p><h4>Azure AI Foundry</h4><p>In the Azure portal, search for Azure AI Foundry. Click on it and you’re taken to the AI Foundry page. Click the Create down arrow in the top left menu bar. You have the choice between creating a Project or a Hub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*rGV_hQiHqCRw9E3_g5eiRw.png" /></figure><p>Click on Hub. The AI Hub is a high-level organizational structure that acts as a central workspace for managing AI-related assets and resources. It allows teams to share resources, manage permissions, and work together on AI initiatives, unifies different AI tools, services, and models under a single hub. It also helps to enforce security policies and compliance standards across AI applications.</p><p>Fill out the requisite information about your project, e.g. resource group, region, etc. Notice that a connection to Azure AI resources is made for you. Also notice when you click Next:Storage, a storage account is also made for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*O-iyf7FaTW9tWt4LArk9ww.png" /></figure><p>Click Review and Create to create the hub. Once the AI Hub resource is created, click on the Deployment Details arrow to see all of the resource that you created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BxvBYCPzuMCrE3M98ezliQ.png" /></figure><p>Click “Go to resource” which take you to the AI foundry page in the main Azure portal. This is your Foundry Hub resource. From here you will launch the Foundry portal which is a sub-portal of the main portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*phVXE08ykj5Owsjgt8QhfQ.png" /></figure><p>Click “Launch Azure AI Foundry” to take into the AI Foundry sub-portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*glafYjpiXaFoMoMIuwVCTA.png" /></figure><p>You are now in the Overview page of your Hub in AI Foundry. Looking at the left navigational blade, you can see all of the All hubs + projects, Quota, Users, Models +Endpoints, Connected, and Compute resources. In future articles, I will go into details about these choices. For now, let’s create a New Project by clicking the “New project” button in the middle panel.</p><p>Give your project a unique name and click Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*nyfEfz9rSNboOpaI6vw5pA.png" /></figure><p>You are now in the Overview of your project. Here, we’ll build our RAG search solution for Enron emails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sc6K2JZ61SQd19LJGwn3tw.png" /></figure><p>The center panels show details about your project, e.g. endpoint and keys. The left blade provides most of your navigational needs. To keep things simple for this article, I will highlight items that are most pertinent to this project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/1*2geOk47Nv6lx5pUavTOcaw.png" /></figure><p>The “ <strong>Model catalog</strong> “ is where you can get detailed information, compare, evaluate, and select an LLM from among 1800 choices including the most updated versions of ChatGPT and DeepSeek.</p><p>“ <strong>Playgrounds</strong> “ is where you can experiment with AI model without writing any code. It’s designed for rapid prototyping, testing, and refining AI-powered applications.</p><p>“ <strong>Prompt flow</strong> “ is a powerful low-code tool for building, evaluating, and deploying AI-powered workflows. This tool allows you to build the entire pipeline of a RAG project from the user input to the output.</p><p>“ <strong>Evaluation</strong>” is designed to help you <strong>assess </strong>the quality and performance of your AI flows or prompts.</p><p>“ <strong>Safety + security</strong> “ is focused on ensuring that your AI applications-especially those using large language models (LLMs)-operate in a responsible, secure, and compliant manner.</p><p>Finally, there is “ <strong>My assets</strong> “ which is where you will find your deployed model, your data, and your index.</p><p>As I continue building the RAG demo, I’ll begin by exploring the “ <strong>Model catalog</strong>” and “ <strong>Safety + security</strong>” features. In the next article, <em>Part 3.2: Demonstration of Retrieval-Augmented Generation (RAG) Search — Selecting an LLM</em>, I’ll walk through the process of choosing a suitable large language model (LLM), testing its capabilities, and ensuring content safety throughout. See you in the next article!</p><p><em>John K. Hancock, Master of Science Data Science, Azure AI Engineer Associate, MBA, PMP. He may be reached at </em>jkhancock@gmail.com</p><p><em>Originally published at </em><a href="https://johnkhancock.substack.com/p/part-31-demonstration-of-retrieval"><em>https://johnkhancock.substack.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af9217e418b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Disrupting eDiscovery: A Practitioner’s Guide to Microsoft’s Azure AI Services]]></title>
            <link>https://medium.com/@jkhancock/disrupting-ediscovery-a-practitioners-guide-to-microsoft-s-azure-ai-services-39652609452c?source=rss-1182b68fa2fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/39652609452c</guid>
            <category><![CDATA[ediscovery]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-ai-services]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[John K. Hancock]]></dc:creator>
            <pubDate>Tue, 03 Dec 2024 00:25:46 GMT</pubDate>
            <atom:updated>2024-12-03T00:25:46.792Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*DUOUSZ-zyvOPeQHgxN5pNQ.png" /><figcaption>Microsoft Azure</figcaption></figure><p>This the second of a series of articles on how Artificial Intelligence (“AI”) is disrupting the field of eDiscovery. In my first article, I wrote about very broad definitions of terms from a high level. (<a href="https://medium.com/@jkhancock/disrupting-ediscovery-an-exploration-of-ais-transformation-of-industry-standards-and-practices-8ef95c2a5dd3">LINK</a>) (Note: <em>When you see “LINK”, hover over it and click on the hyperlink in the popup window.</em>) In this article, I delve into using AI on more practical terms by taking a look into Microsoft’s Azure AI services on their cloud computing platform.</p><p>For most practitioners, there’s a high probability that your experience with AI will probably be through Azure’s AI services. As an example, Relativity’s AI service, aiR, uses Azure’s OpenAI service. In the diagram below, Relativity’s workspace connects through aiR which then uses Azure AI’s OpenAI (Application Programming Interfaces) APIs to connect to OpenAI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*2qhNSKJXlto-lthTozk8xw.png" /><figcaption>aiR RelativityOne</figcaption></figure><p>The outline for this article is as follows:</p><p><strong>I. What is Azure Cloud Computing?<br>II. Azure AI Services<br>III. Azure AI Costs<br>IV. Azure AI Services Security<br>V. Summary</strong></p><p>To start, I will discuss Microsoft’s Azure cloud computing. Cloud computing platforms will become more common as the amount of data grows exponentially and traditional eDiscovery practices will become insufficient. Next, I will describe Azure’s suite of AI services and how they may be utilized on an ediscovery project. I will conclude by discussing costs and security.</p><p>Before I proceed, I just want to drop a quick note about this article. This article is not a tutorial on Azure AI services. This is only an introduction to these services. The audience for this article is eDiscovery practitioners looking for information about how AI will transform their industry and where to start to prepare for this transformation. If you’re looking for more detailed information, I will provide links throughout the article and at the end of this article.</p><p>Cloud computing is a public service that delivers on-demand, global compute services over the internet. Core services include storage, compute, networking, databases, as well as a number of other specialized services such as AI. These services can be scaled up or down depending on enterprise needs obviating the need for massive upfront investments in servers. For most transactions, you pay just for the services that you need when you need them. Enterprises are not locked into long term contract which allows them to convert capital expenses to operating expenses.</p><p>Azure is Microsoft’s cloud computing service offering. Azure services fall into four broad categories:</p><ul><li>Infrastructure as a service (<strong><em>IaaS</em></strong>) where the client rents the virtual machines, storage space, servers, networks, databases on a pay as you go basis</li><li>Platform as a service (<strong><em>PaaS</em></strong>) refers to cloud computing services that supply an on-demand environment for developing, testing, delivering, and managing software applications.</li><li>Serverless focuses on building app functionality without spending time continually managing the servers and infrastructure required to do so. The cloud provider handles the setup, capacity planning, and server management for you.</li><li>Software as a service (<strong><em>SaaS</em></strong>) provides software applications over the internet, on demand and typically on a subscription basis. Relativity One is an example of such a service</li></ul><p>Azure’s services are delivered through datacenters that reside in over 60 regions across the globe spanning the Americas, Europe, Asia (including China), Africa, Australia, and the Middle East. Geographical compliance with regulations such as GDPR becomes simpler as data and all other compute services can be done within a region without the data ever leaving that region.</p><p>Microsoft assumes the responsibility for security at each datacenter. Each datacenter features stringent physical security controls, such as biometric access, security personnel, surveillance, and disaster recovery systems.<br>Azure meets or exceeds many global, regional, and industry-specific compliance standards, such as:</p><p>• <strong>Global Standards</strong>: ISO/IEC 27001, ISO/IEC 27017 (cloud security), and ISO/IEC 27018 (cloud privacy)<br>•<strong> US Standards</strong>: FedRAMP, NIST 800–171, CJIS for law enforcement, and HIPAA for healthcare.<br>• <strong>Regional Regulations</strong>: GDPR (EU), CCPA (California), IRAP (Australia), and many others.<br>• <strong>Financial Standards</strong>: PCI DSS for payment card data security</p><p>The overall benefits of Azure cloud computing to the practice of eDiscovery cannot be overstated. Often, the size and scale of eDiscovery projects are not known at the outset and projects have been known to scale up without the time to plan out resource allocation. Having the ability to quickly and securely scale up and scale down compute needs on a global scale to meet the ever-changing demands of any given project makes cloud computing perfectly suited to the practice of eDiscovery services.</p><h3>II. Azure AI Services</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*f1M0EDwqvQ_OMAGrosWfbA.png" /><figcaption>Azure AI Services</figcaption></figure><p>Given the exponential growth and the various types of data, the eDiscovery practitioner needs to be up-to-speed on AI in order to meet client demands for more time and cost challenges. Understanding Azure AI services gives the practitioner a strong background in AI which can be used to evaluate AI offerings from different service providers.</p><p>In this section, I will start with a discussion about how AI services work and then present a few common scenarios and discuss the solutions that Azure AI services provide.</p><p>Azure AI services are developed by Microsoft to provide scalable, accessible, and integrated artificial intelligence tools for a wide range of applications. These services leverage cutting-edge advancements in AI, including deep learning, machine learning, and natural language processing, built upon Azure’s cloud infrastructure. Engineers and data scientists at Microsoft design these services to be modular and flexible, enabling developers to use prebuilt AI models or create custom models tailored to their specific needs. Each service is trained using large datasets, ensuring robust and reliable performance, and is made accessible through APIs, Software Development Kits (“SDKs”), and Azure’s integrated development environment.</p><p>Engineers design the API endpoints and SDK libraries to provide comprehensive yet intuitive access to Azure features, adhering to RESTful standards for APIs and idiomatic design principles for SDKs in various programming languages like Python, C#, Java, and JavaScript.</p><p>The APIs and SDKs are implemented using modern software development practices, including version control, modular architecture, and rigorous testing frameworks. This ensures compatibility, maintainability, and reliability. Azure APIs often rely on HTTP protocols and standardized authentication mechanisms, like OAuth2 or Azure Active Directory, to secure access. SDKs wrap these APIs, offering higher-level abstractions and easier integration with developer tools.</p><p>Azure AI services fall into five broad categories:</p><p> Natural language processing<br> Knowledge mining and document intelligence<br> Computer vision<br> Decision support<br> Generative AI</p><p>For each service listed above, you can create a resource in the Azure portal where the underlying virtual machine and virtual network are managed for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ThlniVTHWpt_DKHP0UVebw.png" /></figure><p>Developers access these services through private REST endpoints and access keys that are embedded into an AI application. For some scenarios, like Vision, Language, and OpenAI, you can also use a studio to access your resource.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44dgyL7u_Fya_wUchcpzMQ.png" /><figcaption>AI Vision Studio</figcaption></figure><p>Within each category, there are several Azure AI services that a developer can use in an application. This article cannot cover each resource in detail. For the sake of brevity, I will highlight those services that an eDiscovery practitioner can find particularly useful.</p><h3>Natural Language Processing</h3><p>Natural language processing (NLP) solutions use large language models to interpret the semantic meaning of written or spoken language. You may be familiar with some of these services in other eDiscovery applications, e.g. Optical Character Recognition (“OCR”), detection of foreign languages, text extraction from images, extraction of key phrases, analyze sentiment, extraction of known entities such as the name of people, corporations, and locations.</p><p>Some of the more notable resources are:<br><strong>Azure AI</strong> <strong>Custom Question and Answering</strong><br><strong>Azure A</strong>I <strong>Custom text classification<br></strong> <strong>Azure AI</strong> <strong>Summarize Text<br>Azure AI Knowledge Mining and Document Intelligence</strong></p><p><strong>Azure AI Custom Question and Answering (</strong><a href="https://language.cognitive.azure.com/"><strong>Link</strong></a><strong>)<br></strong><em>Scenario: An end-user wants to ask straight forward questions about key documentation, e.g. “how many documents did we collect for a certain custodian?”</em></p><p>This resource allows you to build a knowledge base layer over your data. It is used to find appropriate answers from static customer input or from a project. Custom question answering is commonly used to build conversational client applications. An eDiscovery practitioner could build a Custom Q&amp;A service to track key information about a project such as collection and production history.</p><p><strong>Azure A</strong>I <strong>Custom text classification(</strong><a href="https://language.cognitive.azure.com/home"><strong>Link</strong></a><strong>)<br></strong><em>Scenario: You have a relatively small number of documents that you need to classify as Responsive</em></p><p>This service enables you to create machine learning models tailored to your specific text classification needs. It allows you to assign predefined categories or labels to text data, such as emails, support tickets, social media posts, or documents, based on your business requirements.</p><p><strong>Azure AI</strong> <strong>Summarize Text(</strong><a href="https://language.cognitive.azure.com/home"><strong>Link</strong></a><strong>)<br></strong><em>Scenario: You need a quick summary of a set of documents</em></p><p>Azure AI Text Summarization is a service that uses advanced natural language processing (NLP) to generate concise and coherent summaries of long text documents or articles. This service is designed to help users quickly grasp the key points and main ideas from extensive content. It supports extractive summarization, where the most relevant sentences are selected directly from the input text, and abstractive summarization, where new, succinct sentences are generated to encapsulate the meaning.</p><p><strong>Azure AI Knowledge Mining and Document Intelligence(Link)<br></strong><em>Scenario: You have a collection of a large volume of forms. You need to extract data from the forms and load the data into a database.</em></p><p>Azure Knowledge Mining and Document Intelligence services are solutions designed to unlock insights from vast amounts of data, making it more accessible and actionable. Knowledge Mining. The service combines AI capabilities like natural language processing, image recognition, and custom machine learning models to extract, enrich, and explore structured and unstructured data from multiple sources. Document Intelligence, which includes Azure Form Recognizer, specializes in extracting and analyzing information from various document types such as forms, invoices, and contracts using AI to automate data extraction, reduce manual processing, and enhance operational efficiency. Together, these services empower businesses to transform raw data into meaningful insights that drive decision-making and innovation.</p><h3>Computer Vision</h3><p><strong>Azure AI Video Analyzer<br>Azure AI Face Detection</strong></p><p><strong>Azure AI Video Analyzer (</strong><a href="https://azure.microsoft.com/en-us/products/ai-video-indexer/?msockid=34b30626324d6bdc308f156033c76a22"><strong>Link</strong></a><strong>)</strong></p><p><em>Scenario: Your project has several Zoom conference video files. You need to search and index these files to find participants and relevant information.</em></p><p>Azure AI Video Analyzer is a cloud-based service that enables developers to extract insights and perform video analytics from live video streams or recorded content. It combines AI-powered capabilities such as object detection, motion analysis, scene segmentation, and facial recognition to derive meaningful metadata, automate workflows, and support intelligent decision-making. A practitioner can use the insights extracted from the video to enhance the search experience across a video library. For example, indexing spoken words and faces can enable the search experience of finding moments in a video where a person spoke certain words or when two people were seen together.</p><p><strong>Azure AI Face Detection</strong> (<a href="https://portal.vision.cognitive.azure.com/gallery/face">Link</a>)</p><p><em>Scenario: You have several images that you need to detect if a key custodian is in the image.</em></p><p>Azure AI Computer Vision’s Face Detection is a powerful capability designed to identify and analyze human faces within images and videos. It can detect faces, estimate attributes like age, gender, and emotion, and locate facial landmarks such as eyes, nose, and mouth. This feature is valuable for applications like identity verification, sentiment analysis, and personalized user experiences. Face Detection integrates seamlessly with Azure Cognitive Services, offering developers a secure and scalable way to build AI-powered solutions while adhering to data privacy and compliance standards. It supports real-time processing and batch analysis, making it suitable for industries such as retail, security, and entertainment</p><p><strong>Azure AI Dense Captions (</strong><a href="https://portal.vision.cognitive.azure.com/demo/dense-captioning"><strong>Link</strong></a><strong>)<br></strong><em>Scenario: You have several images to analyze in an intellectual property dispute. You need to show that a retailer is selling counterfeit goods.</em></p><p>Azure AI Computer Vision’s Dense Captioning capability leverages advanced deep learning models to analyze images and generate detailed descriptions of multiple objects, their relationships, and surrounding contexts within a single image. Unlike standard image captioning, which provides a single overall description, dense captioning focuses on granular insights, offering captions for multiple regions of interest in the image. This makes it an excellent tool for extracting rich metadata and understanding visual content in complex scenarios. Dense Captioning supports applications requiring precise visual comprehension, such as digital asset management, automated image labeling, or content moderation.</p><h3>Decision Support</h3><p><em>Scenario: You have a large collection of legal research and opinions that you want made available for searches by clients and colleagues.</em></p><p><strong>Azure AI Retrieval Augmented Generation (“RAG”) Search (</strong><a href="https://azure.microsoft.com/en-us/products/ai-services/ai-search/?msockid=34b30626324d6bdc308f156033c76a22#Usecases"><strong>Link</strong></a><strong>)</strong></p><p>Azure AI Retrieval Augmented Generation (RAG) Search is an advanced solution that combines the power of LLMs with intelligent retrieval techniques to provide highly relevant, context-aware responses from vast datasets. Unlike traditional search methods, RAG Search uses a two-step approach: first, it retrieves relevant documents or information from a structured or unstructured knowledge base; then, it applies a language model to synthesize and generate a concise and coherent answer. This hybrid technique ensures that responses are not only accurate but also contextually enriched, making it ideal for applications requiring precise information retrieval, such as customer support, legal research, and technical documentation.</p><p>A common use case for Azure AI RAG Search is in the legal field, where professionals often need to extract insights from large volumes of case law, statutes, and legal opinions. By integrating RAG Search into their workflows, lawyers can quickly query their legal database to find specific precedents or statutes relevant to a case and receive an AI-generated summary or explanation. This streamlines research, enhances decision-making, and saves significant time compared to manual document review. The system can also be tailored to maintain compliance and privacy standards, ensuring sensitive data is securely processed while delivering actionable insights.</p><h3>Azure Generative AI (OpenAI) (<a href="https://azure.microsoft.com/en-us/products/ai-services/openai-service">Link</a>)</h3><p><em>Scenario: You’ve built an AI Search Index and you want to use it to train an OpenAI generative model.</em></p><p>Azure Generative AI services leverage advanced AI models to create content, generate insights, and enhance user interactions. These services include Azure OpenAI, which provides access to powerful large language models like GPT, enabling natural language understanding, content generation, and conversational AI. They integrate seamlessly with Azure’s ecosystem, allowing businesses to build innovative applications such as chatbots, personalized recommendations, and creative tools. Azure’s generative AI also supports fine-tuning models to align with specific industries and use cases, ensuring that organizations can efficiently scale and customize AI solutions while maintaining data security and compliance.</p><h3>III. Azure AI Costs</h3><p>As stated earlier, Azure cloud computing operates on a pay-as-you-go scheme. You also have the ability to lock in terms over specific time periods. For all cloud services, including AI services, Azure provides an interactive pricing calculator where you can estimate your costs. <br>Clicking Azure AI Services adds a drop down menu to your calculator. Here, you can add specifications to your service like which API, Custom Vision, Language, Speech, the region where the service will reside, the support level, and the licensing program.</p><p>Not all Azure AI services are available on the pricing calculator. For example, pricing for the AI Search and AI OpenAI services are on separate websites. Each site provides an extremely detailed pricing model.</p><p>Azure Generative AI services leverage advanced AI models to create content, generate insights, and enhance user interactions. These services include Azure OpenAI, which provides access to powerful large language models like GPT, enabling natural language understanding, content generation, and conversational AI. They integrate seamlessly with Azure’s ecosystem, allowing businesses to build innovative applications such as chatbots, personalized recommendations, and creative tools. Azure’s generative AI also supports fine-tuning models to align with specific industries and use cases, ensuring that organizations can efficiently scale and customize AI solutions while maintaining data security and compliance.</p><h3>IV. Azure AI Services Security</h3><p>Azure AI services are secured through a multi-layered approach, leveraging Azure’s enterprise-grade security infrastructure. These services integrate with Azure Entra ID for identity and access management, enabling role-based access control (RBAC), and secure authentication. Data in transit is protected using encryption protocols like TLS, while data at rest is safeguarded with Azure-managed keys or customer-managed keys through Azure Key Vault.</p><p>Network security is enhanced with private endpoints and virtual network integration, ensuring services are not exposed to public internet. Azure also adheres to strict compliance certifications, including GDPR, ISO 27001, and HIPAA, providing assurance of robust security practices. Logging and monitoring through Azure Monitor and Defender for Cloud enable real-time threat detection and response.</p><p>An eDiscovery practitioner needs to be well educated about the cybersecurity of any cloud computing service. A good practice would be to work with a cybersecurity expert to understand any potential vulnerability and the steps that need to be taken to mitigate these vulnerabilities. Further, consult directly with a Microsoft representative to be aware of the differences between Microsoft’s responsibilities and the practitioner’s responsibility.</p><h3>V. Summary</h3><p>The intention of this article is to introduce the eDiscovery practitioner to Microsoft’s Azure cloud computing and a sampling of the many Azure AI services. Obviously, one article alone cannot fully capture the full complement of Azure cloud computing or Azure AI’s service offerings. There is so much more that the eDiscovery practitioner will need to know in order to keep pace with the new disruptions that AI brings, but this article is a good start. For eDiscovery service providers being able to offer applications based on Azure AI service could be a lucrative service differential.</p><p>My advice is to visit the links posted throughout this article. Explore the topics that I covered as well as topics that I did not, e.g. all of the services under AI Vision. Reach out to experts in the field for advice about pricing, security, and problem solving. When meeting with vendors selling AI products, ask them about the AI service or model on the back end of the application. How was it built? Is it using Azure AI services? If not, then what cloud computing or other service is it using? If it’s not a cloud computing solution, then what model is it using? How was the model trained and on what data?</p><p>In sum, the AI disruption of eDiscovery is in full bloom. Mastery of AI will soon become an essential requirement. Mastery of Azure AI is a great first step.</p><p>For more information:</p><p><strong>Microsoft Azure Cloud Platform (</strong><a href="https://azure.microsoft.com/en-us/"><strong><em>Link</em></strong></a><strong>)<br>Microsoft Learn (</strong><a href="https://learn.microsoft.com/en-us/credentials/certifications/azure-fundamentals/?practice-assessment-type=certification"><strong><em>Link</em></strong></a><strong>)<br>Microsoft Documentation (</strong><a href="https://learn.microsoft.com/en-us/azure/ai-services/"><strong><em>Link</em></strong></a><strong>)</strong></p><p><em>About the Author: John K. Hancock, MS Data Science, MBA, PMP<br>Microsoft Certified: Azure AI Engineer Associate<br>Microsoft Certified: Azure Fundamentals<br>Microsoft Certified: Azure AI Fundamentals</em></p><p>Email: jkhancock@gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39652609452c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Disrupting eDiscovery: An Exploration of AI’s Transformation of Industry Standards and Practices]]></title>
            <link>https://medium.com/@jkhancock/disrupting-ediscovery-an-exploration-of-ais-transformation-of-industry-standards-and-practices-8ef95c2a5dd3?source=rss-1182b68fa2fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ef95c2a5dd3</guid>
            <dc:creator><![CDATA[John K. Hancock]]></dc:creator>
            <pubDate>Mon, 24 Jul 2023 01:57:37 GMT</pubDate>
            <atom:updated>2023-07-24T01:57:37.030Z</atom:updated>
            <content:encoded><![CDATA[<p>(Part One — Definitions)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Rhx2s13CMI3XDpXuNQyDQ.jpeg" /></figure><h3><strong>Introduction</strong></h3><p>Since its debut in November 2023, OpenAI’s Chat Generative Pre-Trained Transformer (“ChatGPT”), has propelled Artificial Intelligence (“AI”) into mainstream consciousness. This pivotal moment is akin to the release of the Netscape Navigator browser in the fall of 1994. That release brought the internet into the mainstream public consciousness. And, just as the internet revolutionized business processes in immeasurable ways, AI has the potential to bring about even greater transformational changes to how we work.</p><p>We’re already seeing transformational change in Information Technology. Using ChatGPT, a user can construct a search query using basic human text without needing any expertise or training in SQL. In eDiscovery, AI is used to categorize documents as responsive and non-responsive. For practitioners, this is commonly referred to as Technology Assisted Review (“TAR”). Soon, we will see large language models trained from email collections enabling attorneys to construct prompts to discover information pertaining to their matters.</p><p>Service providers and eDiscovery professionals need to be prepared. This article, the first of many in this series, seeks to provide guidance in helping the eDiscovery industry adapt to this transformation. Specifically, this article provides clear definitions and common understanding of essential terms that are crucial for comprehending AI nomenclature.</p><p>In a future article, I will delve into the profound impact of AI on both the project management and technical dimensions of the Electronic Discovery Reference Model (“EDRM”). In the next article, I will explore some of the challenges involved with building out the technical infrastructure for AI enabled processing. In the final article, I discuss potential new business models for AI.</p><p>Although it has tremendous potential, AI is still in its initial stages. Change can and will happen at a rapid pace. New investments in the AI space are driving the markets higher, and there will be new products, new research, new advancements. Recall, the Netscape Navigator browser was soon followed by Microsoft’s Internet Explorer, and now neither browser is available today.</p><h3><strong>Definitions</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oIu5wDQ9VaVnUcCWErhlLg.png" /></figure><p><strong>eDiscovery</strong></p><p>The audience for this article is eDiscovery practitioners and service providers. The term, eDiscovery, is an anacronym for Electronic Discovery which is the process of identifying, collecting, and producing Electronically Stored Information (ESI) for the purpose of discovery during legal proceedings, such as litigation, investigations, or regulatory audits.</p><p>In today’s digital age, information relevant to legal matters can be found in structured and unstructured data sources such as emails, documents from office productivity applications, text messages, video of online zoom or webex meetings, audio files, databases, social media content, and more. Whatever data a business or an individual generates can be collected, processed, reviewed, and categorized as relevant or not relevant or privileged.</p><p>Given the sheer volume of data that needs to classified and used during discovery, the use of Artificial Intelligence (“AI”) to identify patterns in documents, classify relevance, search, and cull information from this corpus of data is inevitable given that it will have the improve productivity by greatly reducing time and costs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dpEjlO_vaOJv4iSyVLus_A.jpeg" /></figure><p><strong>Artificial Intelligence (AI)</strong></p><p>AI is a domain of computer science, a field of research dealing with computation, information, and automation. Other computer science domains include hardware architectures, programming languages, operating systems, algorithms, and data structures. AI is the science of building machines that learn to mimic reasoning, decision-making, and in general human-like intelligence to solve a problem.</p><p>There have been three distinct eras in AI.</p><p>I. <strong>The Symbolic era (1950s to 1980s)</strong> During this period, researchers were focused on symbolic or rule-based approaches to AI to represent knowledge and logical reasoning to solve problems. The central idea behind the symbolic approach was to use formal logic and symbolic representation of knowledge to mimic human reasoning and problem-solving capabilities.</p><p><strong>II. The Statistical era (1980s to 2010)</strong> This period relied on statistical machine models like logistic regression and naive bayes. It was marked by significant advancements in statistical modeling and machine learning techniques that have greatly influenced the field of AI. Researchers shifted their focus towards developing algorithms and models that could learn patterns and make predictions based on large amounts of data.</p><p>eDiscovery practitioners using TAR applications such as Reveal Brainspace or Relativity’s Assisted Review have experience with using statistical supervised machine learning tools to classify documents.</p><p><strong>III. The Neural Network era (2010 to present) </strong>Neural Networks (“NNs”), a sub-domain of Machine Learning (“ML”), are models patterned after the structure and functioning of the human brain. NNs consists of interconnected artificial neurons, also known as nodes or units, organized into layers. These layers typically include an input layer, one or more hidden layers, and an output layer.</p><p>Each neuron receives input data, performs computations on it, and produces an output that contributes to the final prediction or decision made by the neural network. Because of computer power and data availability, NNs provide improved performance over current statistical models. They could generalize more effectively and deal with outliers. ChatGPT is powered by a special NN called Transformers which revolutionized Natural Language Processing (“NLP”) and other sequence-to-sequence tasks by using self-attention mechanisms, allowing it to process input sequences more efficiently and effectively than traditional NNs.</p><p><strong>Domains of Artificial Intelligence (AI)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TURvrYWSTRQLGF6sJ025gw.png" /></figure><p>AI is a vast, diverse, and growing field of research consisting of several domains. To name just a few, computer vision, robotics, and speech recognition. Over the next sections, I focus on those domains that are most relevant to eDiscovery:</p><ul><li>Natural Language Processing (“NLP”)</li><li>Machine Learning (“ML”)</li><li>Deep Learning (“DL”<strong>)</strong></li></ul><p><strong>Natural Language Processing (“NLP”)</strong></p><p>NLP<strong> </strong>focuses on enabling computers to understand, interpret, and generate human language. eDiscovery practitioners working with applications such as Reveal Brainspace’s clustering tool are well aware of NLP.</p><p>Below is list of some of the more important areas that NLP encompasses:</p><ul><li><strong>Text Cleaning and Normalization</strong> Before processing the text, various preprocessing steps are applied, such as removing punctuation, converting all characters to lowercase, and handling contractions to ensure uniformity in the text data.</li><li><strong>Tokenization</strong> In this stage,the text is broken down into smaller units called tokens. These tokens can be individual words or even smaller units like characters or subwords. Tokens are then translated into numerical sequences.</li><li><strong>Part-of-Speech Tagging (POS</strong>) This process involves assigning parts of speech (e.g., nouns, verbs, adjectives) to each token in the text. POS tagging helps in understanding the grammatical structure of sentences.</li><li><strong>Question and Answering</strong> involves creating systems capable of understanding questions posed in natural language and providing accurate and relevant answers. The ultimate goal of QA is to bridge the gap between human language understanding and information retrieval, allowing users to interact with computers more naturally and effectively. Advances in pre-trained language models, such as BERT and GPT, have significantly improved the performance of QA systems by enabling them to better understand context and capture relationships between words and concepts.</li><li><strong>Parsing</strong> Parsing involves analyzing the grammatical structure of sentences to understand the relationship between words and their syntactic roles. Dependency parsing and constituency parsing are common techniques used in NLP.</li><li><strong>Named Entity Recognition (NER) </strong>NER is the process of identifying and classifying entities in text, such as names of people, organizations, locations, dates, etc. This is essential for understanding the context and extracting valuable information from the text.</li><li><strong>Word Embeddings</strong> Words are represented as numerical vectors called word embeddings, where each word is mapped to a high-dimensional vector in a semantic space. Word embeddings capture the semantic relationships between words, allowing NLP models to understand the meaning of words based on their context. This is crucial for deep learning neural networks.</li><li><strong>Sentiment analysis </strong>attempts to extract subjective qualities — attitudes, emotions, sarcasm, confusion, suspicion — from text.</li></ul><p><strong>Machine Learning (“ML”)</strong></p><p>ML<strong> </strong>refers to wide array of statistical based algorithms designed to allow computers to recognize patterns and make predictions without being explicitly programmed to do so.</p><p>The fundamental methodologies to ML include:</p><ul><li><strong>Supervised ML</strong> where the algorithm is trained on a labeled dataset, where each input data point is associated with a corresponding target or output label. The model learns to map inputs to outputs, making it capable of predicting labels for new, unseen data. Common statistical supervised learning models include linear regression, logistic regression, decision trees, support vector machines (SVMs), and neural networks.</li><li><strong>Unsupervised ML </strong>involves training the model on an unlabeled dataset, where the algorithm must find patterns and structures within the data on its own. Clustering and dimensionality reduction are common tasks in unsupervised learning. Common unsupervised ML algorithms include K-Means Clustering, Hierarchical Clustering, Gaussian Mixture Models, and Density-Based Spatial Clustering of Applications with Noise</li><li><strong>Semi-Supervised Learning</strong> This type of learning lies between supervised and unsupervised learning. It involves training the model on a combination of labeled and unlabeled data to improve performance.</li></ul><p>For many experienced eDiscovery practitioners who have worked with TAR and Continuous Active Learning (“CAL”), both of which are examples of Supervised ML, a statistical based approach where the algorithm is trained by humans on labeled data. Once the model is trained, it’s applied to documents that it hasn’t seen and categorizes these documents as Relevant/Not Relevant. The model’s performance is assessed on metrics such as precision, recall, accuracy, and F1 scores.</p><p><strong>Deep Learning (“DL”)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rh3E22XAJBHR22X9VM4K7w.jpeg" /></figure><p>DL is a sub domain of ML. The model for DL was inspired by how neutrons in the human brain work. DL uses neural networks with multiple layers. These networks are called “deep neural networks” because they consist of one or more hidden layers between the input layer and output layers. transforming it gradually to extract relevant features and patterns.Each neuron in a neural network receives input, adds weights and biases to the data, and produces an output that is passed to the next layer. Each layer in the network performs a series of mathematical operations on the data as it moves through the network.</p><p><strong>DL Architectures</strong></p><p>There are various architectures used in deep learning. The more prominent ones are:</p><p><strong>Artificial Neural Networks (ANNs)</strong> represent the most basic DL network. The network deploys the feed-forward process which is the simplest and most common type of neural network architecture. In a feed-forward neural network, the flow of information is unidirectional, meaning data moves from the input layer through the hidden layers (if present) to the output layer without any feedback loops.</p><p>The input layer is the starting point of the network. It receives the raw data or features of the input that you want to process. Each node (neuron) in the input layer represents a feature of the input data. The input values are fed into the input neurons, and the information is passed to the next layer.</p><p>Each connection between the neurons in adjacent layers is associated with a weight. The weights represent the strength of the connections between neurons. Initially, the weights are assigned random values and are then updated during the training process to optimize the network’s performance. Additionally, each neuron in a hidden layer and the output layer typically has an associated bias term, which allows the network to learn constant terms or offsets.</p><p>In feed-forward neural networks, there may be one or more hidden layers between the input and output layers. These hidden layers contain neurons that process the input data using the weights and biases associated with their connections. The hidden layers serve as intermediaries and can learn complex patterns and representations from the input data.</p><p>After calculating the weighted sum of inputs and adding the bias, each neuron applies an activation function to introduce non-linearity into the network. The activation function determines whether a neuron should be activated (i.e., “fire”) or not based on the computed value. Common activation functions include sigmoid, ReLU (Rectified Linear Unit), tanh, and others.</p><p>The output layer represents the final stage of the neural network’s computation. It produces the model’s predicted output based on the information passed through the hidden layers. The number of neurons in the output layer depends on the specific task the neural network is designed for. For example, in a binary classification problem, there might be one neuron with an activation function like sigmoid, while for a multi-class classification problem, there would be multiple neurons, typically using softmax activation.</p><p>Slightly more complex DL models deploy a process called backpropagation. As the data moves through the layers, the model adjusts its parameters (weights and biases) based on the error or loss it makes in predicting the correct output. This iterative process helps the model improve its predictions over time.</p><p><strong>Convolutional Neural Networks (CNNs)</strong> are a more complex form of an ANN. They are commonly used to process and analyze visual data, such as images and videos. They are the most effective for tasks like image classification, object detection, image segmentation, and more. The key building blocks of CNNs are the convolutional layers. These layers consist of small filters (also known as kernels) that slide over the input image to perform element-wise multiplications and summations. The purpose of these filters is to detect specific features in the input, such as edges, textures, or other patterns.</p><p><strong>Recurrent Neural Networks (RNNs)</strong> are used for sequential data like text and speech. Unlike traditional feedforward neural networks like ANNs, RNNs have loops within their architecture, allowing information to be persistently passed from one step to the next. This makes RNNs particularly well-suited for tasks that involve time series data, speech recognition, machine translation, and most importantly, NLP since understanding the context of a word in a sentence is more important than just the word itself.</p><p>RNNs experience problems with capturing long-term dependencies due to the vanishing gradient problem. When an RNN processes sequential data, such as natural language sentences or time series data, it needs to remember information from earlier time steps to make accurate predictions at later time steps. However, as the gradient is propagated backward through time during backpropagation, it can undergo repeated multiplication with the weight matrices of the RNN layers. If these weight matrices have elements that are less than 1, the gradient can diminish significantly as it propagates backward through many time steps. As a result, the network may fail to effectively learn dependencies that span long periods of time.</p><p>To address this issue, various advanced RNN architectures have been proposed, including Long Short-Term Memory (LSTM) networks and Gated Recurrent Units (GRUs). These architectures use gating mechanisms to better control the flow of information and mitigate the vanishing gradient problem.</p><p><strong>Transformers</strong> Unlike traditional recurrent neural networks (RNNs) or convolutional neural networks (CNNs), transformers rely on self-attention mechanisms to process sequences of data in parallel, allowing for highly efficient and effective learning.</p><p>Transformers can process the input sequence in parallel, making them much faster than RNNs, which process sequentially. Parallel processing require GPUs. Transformers can capture long-range dependencies in the data due to their self-attention mechanism, making them more effective for tasks that require modeling long sequences. Transformers can handle variable-length input sequences without the need for padding, making them more memory-efficient.</p><p>Transformers have been applied to various natural language processing tasks, such as machine translation, text generation, sentiment analysis, question-answering, and language understanding, achieving state-of-the-art performance on many benchmarks. They have also been adapted to other sequence-to-sequence tasks beyond language processing.</p><p><strong>Transformers Large Language Models</strong>, also known as large language models (<strong>“LLMs”</strong>) or giant language models, refer to a class of deep learning models that are based on the transformer architecture and trained on a massive amount of text data. These models have significantly more parameters and computational capacity compared to their smaller counterparts, allowing them to capture intricate patterns and relationships in language. <strong>LLMs</strong> are pre-trained on a massive amount of text data in an unsupervised manner. By training on a large corpus of text, the model learns to generate coherent and contextually relevant text given a prompt or partial input.</p><h3>Conclusion</h3><p>I will end the first article in this series at this point. To re-state, the purpose of this article was to give a broad audience a not overly technical list of definitions necessary to begin to understand AI. As new AI products, and upgrades to existing products become available, it’s important for eDiscovery practitioners to understand basic AI terms in order to evaluate these new offerings. Also, practitioners will be asked to help attorneys with AI enabled products and services. If you’re curious and want a more in-depth definitions, please let me know in the comments, and I will direct your attention to additional resources that will help in your understanding.</p><p>In my next article, I will explore how AI will directly affect the workflow approach of the eDiscovery practitioner both from the Project Manger and Technical Analyst perspective. Additionally, I will explore LLMs further as well. I will see you then.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ef95c2a5dd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Demonstration of Microsoft Business Intelligence Data Tools (“MSBI”)]]></title>
            <link>https://medium.com/@jkhancock/a-demonstration-of-microsoft-business-intelligence-data-tools-msbi-bf4cefb6e148?source=rss-1182b68fa2fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf4cefb6e148</guid>
            <category><![CDATA[ssi]]></category>
            <category><![CDATA[sms]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[ssrs]]></category>
            <category><![CDATA[ms-business-intelligence]]></category>
            <dc:creator><![CDATA[John K. Hancock]]></dc:creator>
            <pubDate>Mon, 12 Jun 2023 14:01:34 GMT</pubDate>
            <atom:updated>2023-06-12T14:01:34.705Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Part Three SQL Server Reporting Services (“SSRS”)</strong></h3><p>This is final part of a three of this blog post demonstrating Microsoft’s Business Intelligence suite of tools. So far, the project has extracted, transformed, and loaded 6 months of data collected from Washington DC’s capital bikeshare program. In Part Two, I used SQL Server Management Services (“SSMS”) to create user defined functions, stored procedures, and views. For this final part, I will be using SQL Server Reporting Services (“SSRS”) to create a high level summary report of the top ten stations per month.</p><p>As with the other earlier posts in this series, there may be details that I leave out of this demonstration. These posts are not tutorials. If you’re looking for more in depth explanations, I suggest searching for the numerous tutorials on SSRS.</p><p><strong>Visual Studio</strong></p><p>After launching Visual Studio and selecting the Report Server Project template, I created a new Solution called ReportDemo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*gaHo6SrX6KE-nOgAXpOYOg.png" /><figcaption>Figure 3.0</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*r2Wr7vsmtr9w3mATvj9tsg.png" /><figcaption>Figure 3.1</figcaption></figure><h4><strong>Connecting to a Shared Data Source and Shared Data Sets</strong></h4><p>After the creation of the project in VS, you will need to create a connection to the SQL Server database, Demonstration. This is the database that was loaded in Part One and where the functions, stored procedures, and views were created in Part Two.</p><p>In the Solution Explorer, right click the Shared Data Sources folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*W00zuCV-z22lug3w5dWdeA.png" /><figcaption>Figure 3.2</figcaption></figure><p>This will bring up a context menu where I selected Add then New Item. Next select Data Source then Add. In this dialog box, I built the connection string to the database and set the credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*eqx8OAZ0oGkqKz96wvJ5dg.png" /><figcaption>Figure 3.3</figcaption></figure><p>After the connection to the data source is complete, the next step is to create a connection to the actual data. As with Shared Data Sources, right clicking Shared Datasets (see Fig. 3.2) brings up a context menu where you add a New Item. This brings up the dialog box in Figure 3.4. Here I set the name of the data set to bikeDataSet link it to the shared data source from earlier, and finally, I used a SQL query to retrieve the data from the view, <strong>top_10_view</strong>, created in Part Two of this blog post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*6DQzme5lyGBx3o58sT1zAA.png" /><figcaption>Figure 3.4</figcaption></figure><p>With the shared data source and data set now set, I move onto creating the actual report.</p><p><strong>Creating the Report</strong></p><p>As with the Data Source and Data Set earlier, I right clicked on the Reports folder in the Solution Explorer to add a New Item.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/1*VbAiegg98CYwA4ZiEk5zSw.png" /><figcaption>Figure 3.5</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*MId3iAGEan65_tDhWu0rOQ.png" /><figcaption>Figure 3.6</figcaption></figure><p>This opens a dialog box where I entered the name of the report, rptBikeShare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ZqNDOr87-h8zKo5OStK9XA.png" /><figcaption>Figure 3.7</figcaption></figure><p>This opens a blank canvass which allows me to add elements to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L4GjgYconlLYP8bwnENh9Q.png" /><figcaption>Figure 3.8</figcaption></figure><p>In the left pane, right click the Data Source and Datasets to add the shared data source and dataset to the Report. In both instances, I used the project level shared data source and dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*gK6gylfj-dkq-yNaKIHEEg.png" /><figcaption>Figure 3.9</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*4RYpCbpkJMN5dX1fkiifkg.png" /><figcaption>Figure 3.10</figcaption></figure><p><strong>The Toolbox and Canvass</strong></p><p>Now that the data source and datasets have been added to the report, I turned my focus to the canvass and the toolbox where the tools are that will create the report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XFi6o9yzgBrDYzYztpgz3g.png" /><figcaption>Figure 3.11</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cAeouaAqTsHkX-7DdLXOog.png" /><figcaption>Figure 3.12</figcaption></figure><p>From the tool box, I dragged a text box for the title page of the report and a table onto the canvass.</p><p><strong>Row Group</strong></p><p>In the table, I populated it with the following fields from the dataset, <strong>bikeDataSet</strong>, “Month_of_the Year”, “ride_id”, “duration”, and “month”. Here, I wanted to group the data by “Month_of_the Year” then take a count of the “ride_id”, and the average “duration”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7j9DQCdfcZqL_Fm9Jet_2w.png" /><figcaption>Figure 3.13</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*lH4HxuP6rrRVisYTEWZnzA.png" /><figcaption>Figure 3.14</figcaption></figure><p>The layout of the table is below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xVvQnxElMkm8uPtCx8P9kA.png" /><figcaption>Figure 3.15</figcaption></figure><p>The end result of the table is below. It shows the five months</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dFg2b7Jtn1xXTp_BrpunkA.png" /><figcaption>Figure 3.16</figcaption></figure><p><strong>Visualizations</strong></p><p>Adding more context to the numbers, I created this visualization which shows a breakdown between casual and member riders. From the Toolbox, I dragged a Chart onto the canvass and selected the following chart type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*K8Gd4okVkK7EVALTsKeIpA.png" /><figcaption>Figure 3.17</figcaption></figure><p>The end result shows a table with a visualization. The top chart shows the total number of rides per month per member type and the bottom chart shows the average duration per month per member type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qFg-aKmT81ldpS0rLdg40Q.png" /><figcaption>Figure 3.18</figcaption></figure><p><strong>Deploying the Report</strong></p><p>The final step is deploying the report to the SSRS report server. Right click the Solution name in the Solution Explorer and click Deploy Project. The end result is below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vlaqjfkr0hAlPk7KjihTRQ.png" /><figcaption>Figure 3.19</figcaption></figure><p><strong>Conclusion</strong></p><p>This project was a very basic demonstration of just a few of the tools of Microsoft Business Intelligence suite. My goal was to show that even with a very small amount of data, you could fairly quickly and easily take raw data, transform, and display a key visual insight. In future demonstrations, I will explore other, newer Microsoft products in this space.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf4cefb6e148" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Demonstration of Microsoft Business Intelligence Data Tools (“MSBI”)]]></title>
            <link>https://medium.com/@jkhancock/a-demonstration-of-microsoft-business-intelligence-data-tools-msbi-56a3ee91353b?source=rss-1182b68fa2fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/56a3ee91353b</guid>
            <category><![CDATA[sms]]></category>
            <category><![CDATA[ssi]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[t-sql]]></category>
            <category><![CDATA[ssrs]]></category>
            <dc:creator><![CDATA[John K. Hancock]]></dc:creator>
            <pubDate>Mon, 12 Jun 2023 14:00:25 GMT</pubDate>
            <atom:updated>2023-06-12T14:00:25.789Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Part Two, SQL Server Management Studio (“SSMS”)</strong></h3><p>This is Part Two of three parts to this blog post demonstrating Microsoft’s Business Intelligence suite of tools. The project entails extracting, transforming, and loading 6 months of data collected from Washington DC’s capital bikeshare program. I began the project with extraction, transformation, and loading of data in a SQL Server database using SSIS.</p><p>For Part Two, I create user defined functions, stored procedures, and views using Transact SQL (T-SQL) in SQL Server Management Services (“SSMS”). This view will be used to create a report in SQL Server Reporting Services (“SSRS”) in the third part of this series.</p><p>As with Part One, I leave out some details for the sake of brevity. This is not a tutorial. If you want more in-depth explanations, I suggest seeking out an online tutorial on SSMS</p><h3><strong>SSMS</strong></h3><p>Figure 2.0 shows the connection to the Database Engine server using Windows Authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*Jy-UcZC8upZjzqi312aLEg.png" /><figcaption>Figure 2.0</figcaption></figure><p>After connecting, you can see the two tables, dbo.demo and dbo.load history. These databases were created in Part One of this blog post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*d16aBwyst63mKumMEnV5hA.png" /><figcaption>Figure 2.1</figcaption></figure><p>A count of the number of records in the demo table shows over 2.2 million records. In Part One, I transformed the dataset by creating a new column which extracts the month number from the start date that the ride commence. In figure 2.2, I used T-SQL to tally the number of rides per month using that month number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*9Ko3gi4OEqjg07zMWthPdQ.png" /><figcaption>Figure 2.2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*e55ph3EOSwU8PJqsVy1VVQ.png" /><figcaption>Figure 2.3</figcaption></figure><p><strong>User Defined Functions</strong></p><p>In Part One, I used the DATEPART function to create custom columns for day of the week that the ride started, the hour of the day, and the month of the year. The DATEPART function returned integer values. To get the name of the day and month and the hour of the day, I created three user defined functions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/1*tYN7wV82KWk3nWHXoU8KEg.png" /><figcaption>Figure 2.4</figcaption></figure><p><strong>dbo.ufnGetDayName</strong> is a scalar function that returns the day name of the week. The function accepts an integer as a parameter. Using a Case statement, returns the day name of the week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*jSyfky6UQCneFcuB5u9_-g.png" /><figcaption>Figure 2.5</figcaption></figure><p><strong>dbo.ufnGetHourOfTheDay</strong> is a scalar function that uses a Case statement that returns the hour of the day and whether it’s set for AM or PM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*1bOKm3s4DXCYY3NRzxWgSg.png" /><figcaption>Figure 2.6</figcaption></figure><p><strong>dbo.ufnGetMonthName</strong> is a scalar function that uses a case statement to return the month of the year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*rlS3ifIV49P-A19FDPPgFg.png" /><figcaption>Figure 2.7</figcaption></figure><p><strong>View</strong></p><p>Views allow you to present a customized representation of the data by selecting specific columns, applying filters, or joining multiple tables. In Figure 2.8, I created a view based on the columns from the dataset along with three user defined functions discussed earlier. Additionally, I eliminated those rows from the dataset that had null values. The end result is a view, named <strong>view_demo</strong>, that I can use as a table.</p><p>Views make it easier to write and maintain queries. Rather than repeatedly writing the same complex logic in multiple queries, you can create a view with the necessary joins and filters, and then query the view with a simple statement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*GaKzpSr1wUeDK1nIO4uyCg.png" /><figcaption>Figure 2.8</figcaption></figure><p><strong>Stored Procedure</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*hSl1M50GLj0xI2YNDTwnqw.png" /><figcaption>Figure 2.9</figcaption></figure><p>Stored procedures are database objects that encapsulates a set of operations or business logic and can be called and executed multiple times with different parameters. In Figure 2.9, I created a Stored Procedure that returns a table ranking the busiest starting stations with the ranking being a parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*XF0hEAV4G9wADy94zSlJjQ.png" /><figcaption>2.10</figcaption></figure><p>For example, if I want the top 25 busiest start stations, then I supply a parameter of 25 to the stored procedure, and get the results in Figure 2.10. In the next figure, I save these top 25 stations into its own table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*fWX7ln8APZoWEpS5dDQ4Bw.png" /><figcaption>Figure 2.11</figcaption></figure><p>For this project, I used this process but limited the results to the top 10 busiest starting stations and saved the results into a table, <strong>topTenStations</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*4nMLL51F0829jjSDFBpV4A.png" /><figcaption>Figure 2.12</figcaption></figure><p><strong>Final View</strong></p><p>The final view that will be used for reporting will be a join between the view, <strong>view_demo</strong>, and the table, <strong>topTenStations</strong>. This new view which will be called, <strong>top_10_view</strong>, will show all of the routes, times started, hour of the day, day of the week for the routes with a starting station among the top 10 busiest starting stations. The query for this view is below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*zbIEG0QOP937vAnVKiO_dA.png" /><figcaption>Figure 2.13</figcaption></figure><p>The results of the view are seen below. From over 2.2 million records to 200K records which show the routes for the top 10 busiest top ten starting stations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d8L8kZYVWEVaRBxnxw4vmw.png" /><figcaption>Figure 3.14</figcaption></figure><p>This ends Part Two. In Part Three, I switch to SQL Server Reporting Services (“SSRS”) to display <strong>top_10_view</strong> in a user friendly format.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56a3ee91353b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Demonstration of Microsoft Business Intelligence Data Tools (“MSBI”)]]></title>
            <link>https://medium.com/@jkhancock/a-demonstration-of-microsoft-business-intelligence-data-tools-msbi-e391b95172a5?source=rss-1182b68fa2fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/e391b95172a5</guid>
            <category><![CDATA[sms]]></category>
            <category><![CDATA[ssi]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[ssrs]]></category>
            <category><![CDATA[ms-business-information]]></category>
            <dc:creator><![CDATA[John K. Hancock]]></dc:creator>
            <pubDate>Mon, 12 Jun 2023 13:58:45 GMT</pubDate>
            <atom:updated>2023-06-12T14:54:35.114Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction — Part One</strong></h3><p>This blog post is a fairly straightforward and basic demonstration of some of the primary tools in Microsoft’s Business Intelligence Suite (“MSBI”). This blog will cover the following MSBI tools:</p><p>· Part One, <strong>SQL Server Integration Services (“SSIS”)</strong><br>· Part Two, <strong>SQL Server Management Studio (“SSMS”)</strong><br>· Part Three, <strong>SQL Server Reporting Services (“SSRS”)</strong></p><p>This demo entails extracting, transforming, and loading 6 months of data collected from Washington DC’s capital bikeshare program. I begin the project by building an SSIS package that will extract the datasets from encrypted zip files, transform the datasets , and finally load each csv file into a table in a SQL Server instance. After the data has been loaded, using SSMS , I create scalar user defined functions, stored procedures, and views. Finally, I create a report using SSRS to visualize and report key data.</p><p>This suite of tools are extremely robust and offer a large array of features. Covering all of these features would be too much for this post. Additionally, this blog will not provide in-depth explanations of every step. I left out a lot of details for the sake of brevity. This is only a demo. If you want more in detailed descriptions of these tools, I suggest viewing the many online tutorials which will provide much more details.</p><h4><strong>The Data</strong></h4><p>Six months of data was downloaded from Washington DC’s capital bike share program, <a href="https://capitalbikeshare.com/system-data">https://capitalbikeshare.com/system-data</a>. Data is maintained on a monthly basis in encrypted zip files and saved to an S3 bucket on AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*6ERviyvxao71Vae1jEKCDw.png" /><figcaption>Figure 1.0</figcaption></figure><p>Each dataset consists of the following fields:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*_Vw_uxu_alj1l3f21-Nb2Q.png" /><figcaption>Figure 1.1</figcaption></figure><p>In the next section, I detail how I created a SSIS package that extracted each file, added fields to the dataset and loaded it into a SQL Server table.</p><h3><strong>SSIS</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qSIT0_888l-d-HQQiG8yCw.png" /><figcaption>Figure 1.2</figcaption></figure><p>Microsoft’s SQL Server Integration Services (“SSIS”) is an enterprise wide data integration, data transformation, and data migration application. It’s most commonly used to integrate data from disparate sources into a data warehouse for analysis. The focus of this post is to build a SSIS package which will be a collection of tasks, transformations, and control flow elements designed to move and transform data from various sources to destinations. Figure 1.2 is the package that will do the following:</p><ul><li>Make a connection to a SQL Server database</li><li>Unzip and unencrypt the six zip files</li><li>Add new columns to the data</li><li>Load the data into a table in the SQL Server database</li><li>Update a table logging the data</li></ul><p><strong>The Database Connections</strong></p><p>Before creating the package, a connection to the database has to be made. In the Solution Explorer in the right pane, right-clicking Connection Managers opens the context menu where you can add a New Connection. Figure 1.3 shows the dialog box that I used to make an OLE DB connection to the SQL Server instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*OePzNAkjGKnDxKktXcW9Mg.png" /><figcaption>Figure 1.3</figcaption></figure><p><strong>The Control Flow Package</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8llFAvLfq45YTrBwGuTDPw.png" /><figcaption>Figure 1.4</figcaption></figure><p>Control Flow in SSIS is the logical flow of tasks and containers within a package. Figure 1.5 shows the elements of the Control Flow package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*gloFYBIaIPtwqzQDi3Wouw.png" /><figcaption>Figure 1.5</figcaption></figure><p>The first task is an Execute SQL Task labeled, “Ensure SQL Table is Empty”. This task executes a SQL statement that truncates existing data in the final destination table, Demo. The purpose of this statement is to ensure that duplicate data does not get loaded. The second task which is a File System task labeled, “Delete Directory Content” performs a similar function in that it ensures that the destination folder for the unzipped files is empty as well. These two tasks are necessary if loading new data was a repetitive task.</p><p><strong>Unzipping the Files</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*Oz-dG4DaLK7Iodzgnli0bw.png" /><figcaption>Figure 1.6</figcaption></figure><p>The next piece of the Control Flow package is the unzipping of a directory of password protected, zipped files. Unzipping multiple files is a common data task. For this project, there are only 6 zip files, but on other projects there could be hundreds or thousands of zip files. Here, I use a For Each Loop container. This container is a control flow element that allows you to iterate over a collection of items and perform tasks or processes on each item individually. It is designed to help you automate repetitive tasks or handle multiple data elements efficiently within an SSIS package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*AYKXWMmB-6I-KfJzBYbQHw.png" /><figcaption>Figure 1.7</figcaption></figure><p>Figure 1.7 shows the Collection tab of the container. The container will loop over each file in the Demo\password folder and will perform the same operation over all files with a .zip extension. The Execute Process task (labeled “<strong>Unzip Password Protected Files</strong>”) within the For Each Loop container will perform an execute the unzipping over each file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*6ZtKM13Db0nTHQZ3ONEQag.png" /><figcaption>Figure 1.8</figcaption></figure><p>The Execute Process task is used to execute an external process or command-line executable file within an SSIS package. It allows you to integrate and automate the execution of external programs. In Figure 1.8, I used it to extract zip files using 7-zip executable. The next step is to set the Arguments parameter which provides the command line arguments (“e” for extract and “-p Password123” for the password) to the 7-zip executable.</p><p>The end result of this portion of the package is a directory of unzipped data files that can be loaded into the SQL Server table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*MfKV-XGAQg4V7B-Hu_YUcQ.png" /><figcaption>Figure 1.9</figcaption></figure><p>The next For Each loop container in the package includes a Data Flow task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*GH_JUBrZOOUh2VhVrgyM6w.png" /><figcaption>Figure 1.10</figcaption></figure><p>The Data Flow task builds a pipeline from the unzipped files (Flat File Source) into the SQL Server table. Additionally, the task transforms the data prior to loading by adding additional fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*awLbStjh8W1J5bpNFtauvQ.png" /><figcaption>Figure 1.11</figcaption></figure><p>The pipeline begins by creating a new connection manager with a Flat File Source which is the location of the unzipped files. In the editor for the file connection manager, I set the field type for each column. These field types match the column types in the SQL Server table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CPik3SGvnwTWIblqBCF2_A.png" /><figcaption>Figure 1.12</figcaption></figure><p>The next step is the Derived Column. In Figure 1.13 below, I created six additional columns from the data source files which will be loaded into the final SQL Server table. Each new column provides more details about the date columns in the original source.</p><ul><li><strong>date_started_at </strong>and <strong>date_ended_a</strong>t were added as only date columns using the cast operator (DT_DBDATE)</li><li><strong>day_started</strong>, <strong>hour_started</strong>, and month use the function DATEPART to parse out that data from the started_at field.</li><li><strong>duration</strong> uses the DATEDIFF function to compute the duration of the ride in minutes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*N8XlNQ12Qw-b_M3kZAcE4A.png" /><figcaption>Figure 1.13</figcaption></figure><p>The last piece of the package is the OLE DB Destination table in the database. Recall that earlier, I created a connection to the SQL Server database. See Figure 1.3. Now, I will connect that connection to the overall data pipeline.</p><p>Figures 1.14 and 1.15 show the connection to the database as well as the mapping of the fields to the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*JRQmj9rOU0XSJDpFA6uzjA.png" /><figcaption>Figure 1.14</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*8AJgusBYJhYQCUKew-gdAQ.png" /><figcaption>Figure 1.15</figcaption></figure><p>The last step in the package is the logging of names of the load files into its own table. The Add Filename to Audit Table in Figure 1.16 executes a SQL statetement that Inserts the names of the dataset files names into a table along with the date of its insertion. The task uses a parameter to map to a User Defined variable which holds the name of each dataset file and updates with a new name every time through the For Each Loop container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*GH_JUBrZOOUh2VhVrgyM6w.png" /><figcaption>Figrure 1.16</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*ZAUTvtVgRqU0BO29DGqPRw.png" /><figcaption>Figure 1.17</figcaption></figure><p>The package is now complete. With one click, the capitalbikeshare data files will be extracted, transformed, and loaded into a table named, Demo, in the Demonstration SQL Server database. Figure 1.18 shows that the package was successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JrX3_kH7UlAbbEtHPDyIQw.png" /><figcaption>Figure 1.18</figcaption></figure><p>Opening up SQL Server Database, Demonstation, the load history table shows that all six datasets were loaded and over 2.2 million records were loaded into the main table, demo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*8oSBsI3UKcZNlYO-3ewMcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/174/1*nDywuASkogn1ZO6Xry6-aA.png" /><figcaption>Figure 1.19</figcaption></figure><p>This concludes Part One of this demonstration. In Part Two, I switch to SSMS to perform operations on the database.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e391b95172a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Identifying Top Tier Elite NBA Players using Unsupervised Machine Learning Algorithms]]></title>
            <link>https://medium.com/@jkhancock/identifying-top-tier-elite-nba-players-using-unsupervised-machine-learning-algorithms-48cde2649c4?source=rss-1182b68fa2fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/48cde2649c4</guid>
            <category><![CDATA[tableau]]></category>
            <category><![CDATA[agglomerative-clustering]]></category>
            <category><![CDATA[gaussian-mixture-model]]></category>
            <category><![CDATA[manifold-learning]]></category>
            <category><![CDATA[kmeans-clustering]]></category>
            <dc:creator><![CDATA[John K. Hancock]]></dc:creator>
            <pubDate>Wed, 19 Apr 2023 02:18:39 GMT</pubDate>
            <atom:updated>2023-04-19T02:18:39.785Z</atom:updated>
            <content:encoded><![CDATA[<h3>KMeans Clustering, Gaussian Mixture Models, Agglomerative Clustering</h3><p>by</p><p>John K. Hancock, MSDS (<em>jkhancock@gmail.com</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*DWEv-viGM2DCZLnC-BLUoA.png" /><figcaption>Giannis Antetokounmpo</figcaption></figure><p>Every year, NBA journalists vote on the best 15 players in the NBA. The NBA elite. The vote is spread across First, Second, and Third All-NBA teams. Each team must have 2 guards and forwards and a center. These are the historical and prototypical positions on a NBA team even though in the modern game player positions are more fluid.</p><p>All-NBA team votes are critical because they can impact how much a player can be paid. Players who make the All-NBA team can get higher maximum value contracts. Thus, the possibility of subjectiveness and biases may come into play. A voter may vote for one player over another if it means that the player would get a better contract. This subjectiveness leads to contentious debates where we argue which player deserves to be voted on the team. What if there was a better method to decide which players are elite. A method purely based on the statistical performance of the players no matter their position.</p><p>Unsupervised machine learning, an algorithm that find patterns in unlabeled data, may provide us with sucg a method. Clustering data into similar groups is the most common usage. Using this method, players would be partitioned into clusters based on how similar they are to each other within a cluster and dissimilar to other clusters. Ostensibly, creating clusters of NBA players should put elite players into their own cluster providing an unbiased selection of the best players.</p><p>There are several different types of Unsupervised Machine learning clustering algorithms. They can be grouped based on their clustering methodology. For this project, I focused on three primary types:</p><p><strong>1. Centroid based clustering: KMeans Clustering</strong><br><strong>2. Distribution based clustering: Gaussian Mixture Models</strong><br><strong>3. Hierarchical clustering: Agglomerative Hierarchial Clustering</strong></p><p><strong>Centroid based clustering</strong> <strong>(“KMeans Cluster”)</strong> groups data into clusters based on their closeness to central, representative data point called a centroid. The centroid is calculated as the average or mean of the data points within a cluster. One of the more prominent algorithms.</p><p><strong>Distribution based clustering (“GMM Cluster”) </strong>groups data into clusters based on the underlying distribution of the data. Data points within the same cluster are expected to have similar probability distributions whereas data points from different clusters are expected to have different distributions. GMM models the data points as a mixture of Gaussian distributions, where each Gaussian component represents a cluster. The algorithm estimates the parameters of the Gaussian components, such as the mean, covariance, and mixture weights, to identify the clusters in the data.</p><p><strong>Hierarchical clustering (“AGC Cluster”)</strong>groups data into clusters by building a hierarchy of clusters using a graphical diagram called a dendrogram. It recursively splits or merges clusters until a stopping criterion is met. Agglomerative hierarchical clustering uses a bottom-up clustering methodology. Each data point starts out as a separate cluster and iteratively merges clusters based on a similarity or dissimilarity measure until a stopping criterion is reached. The similarity or dissimilarity between clusters can be calculated using various distance metrics such as Euclidean distance, Manhattan distance, or cosine similarity.</p><h3><strong>Project Objective</strong></h3><p>The objective of this project is to see if the three unsupervised machine learning algorithms, KMeans Clustering, Gaussian Mixture Models, and Agglomerative Hierarchial clustering will be able to identify a cluster of NBA players whose statistics will indicate that they are the elite 5% of the NBA. Players in this elite cluster will be compared to players voted on the NBA All Pro Teams.</p><h3>Data Collection</h3><p>For this project, I will use NBA player statistics from the <strong>2021–22 regular season</strong>. The data was collected from the website <a href="https://www.nbastuffer.com/about-nbastuffer/">www.nbastuffer.com</a>. NBA Stuffer provides robust NBA player statistics that help more than 1 million people who want to analyze NBA. I excluded data from the NBA 2020–21 playoffs as that might bias the clusters to those players on those teams that made the playoffs. Also, players are voted to the All NBA teams prior to the playoffs.</p><h3><strong>Data Exploration and Cleaning</strong></h3><p>After importing the entirety of all NBA player regular season statistics for the 2021–22 season, there were 716 observations and 29 features with only three of the features being non-numeric. Descriptions of each feature are included in the name of the feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WSvXShuR1JBtP_ycoRlz7w.png" /><figcaption>Original Dataset</figcaption></figure><p>The RANK feature which is just an index was dropped, and the rest of the feature names were shortened. Below is a list of the shortened names and description of each feature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*5Ruc1wrKzXRXP6eXbirixg.png" /><figcaption>List of Features</figcaption></figure><p><strong>Duplicate Players</strong></p><p>Players who played for multiple teams during the season, either because of trades or just being released, are entered multiple times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/236/1*_TrPOCtuN5fUlqtBlsHRnA.png" /><figcaption>Multiple Players</figcaption></figure><p>These entries were de-duplicated by aggregating in-season stats for these duplicate players. This reduced the dataset to 605 players.</p><h3>Data Exploration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*8tgTyV-SbM2PATd41XOUCA.png" /></figure><p>A histogram for the number of Games Played (“GP”) reveals that a majority of players played less than 5 games:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*dk-GdjcYvq9j2tONVir01g.png" /><figcaption>Distribution of Games Played</figcaption></figure><p>Players who played less games than the bottom quartile (17 games) were removed from the dataset so as to not skew the results.</p><h4>Minutes per Game (“MPG”)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*3cl87jzNpgA-1qVcWlI9MQ.png" /><figcaption>Minutes per Game</figcaption></figure><p>The average number of minutes played per game was 21.67 minutes. The bottom 25% played less than 15 minutes per game. For example, Kai Jones played only 3 minutes per the 21 games that he played which makes his offensive and defensive ratings NaN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*lvShAkr0ewybUC-GOJzSwQ.png" /><figcaption>Kai Jones 21 Games Played, 3 Minutes per Game</figcaption></figure><p>Players in the bottom quartile of Minutes per Game (less than 15 MPG) were removed from the dataset. After removal, there are 344 players in the dataset.</p><p>(<em>For the sake of brevity for this article, please see my full report on Google colab: for further discussion on Data Exploration including a discussion on Multicollinearity.)</em></p><h3>Dimensionality Reduction Using PCA and Manifold Learning</h3><p>After removing the object features including the RANK feature and after scaling the features, the dataset now consists of 25 dimensions. Having a high number of dimensions can cause problems with clustering since clustering algorithms depend on measuring the distances between observations in order to identify the clusters. If the distances are all roughly equal, then all the observations appear equally alike (or equally different) and no meaningful clusters can be formed. High dimensionality means that space between each observation becomes equidistant. In this project, each player (or observation) represents a combination of the 25 dimensions. The statistical distances between each player become equally alike and no cluster with any meaningful information can be formed.</p><p>I tried two approaches to reduce dimensionality, Principal Component Analysis (“PCA”) and Manifold Learning. PCA provides a method to reduce the overall dimensionality of the features while still retaining the information of the larger feature set. Here, I reduce the number features need to retain 95% of the information in the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*8rVFGJofz8GRq6R198VYRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*Um0xidTP9PEqjacZV1vBzA.png" /></figure><p>PCA has its limitations. “[I]t it often fails in that it assumes that the data can be modelled linearly. PCA expressed new features as linear combinations of existing ones by multiplying each by a coefficient…Whereas PCA attempts to create several linear hyperplanes to represent dimensions, much like multiple regression constructs as an estimation of the data, <strong>Manifold learning</strong> attempts to learn manifolds, which are smooth, curved surfaces within the multidimensional space.”</p><p><a href="https://towardsdatascience.com/manifold-learning-t-sne-lle-isomap-made-easy-42cfd61f5183#:~:text=Whereas%20PCA%20attempts%20to%20create,surfaces%20within%20the%20multidimensional%20space%20.">Manifold Learning t-SNE, LLE, Isomap Made Easy</a>, by Andre Ye (08/12/2020) <a href="https://www.towardsdatascience.com/">Towards Data Science</a></p><p>Manifold learning generally refers to an unsupervised reduction, where the class is not presented to the algorithm (but may exist). Manifold learning attempts to learn manifolds, which are smooth, curved surfaces within the multidimensional space.</p><p>For this project, I used sklearn’s manifold library, <strong>Locally Linear Embedding</strong> or “LLE”. Seeks a lower-dimensional projection of the data which preserves distances within local neighborhoods. <em>It can be thought of as a series of local Principal Component Analyses which are globally compared to find the best non-linear embedding.</em></p><p>“In general, LLE is a more efficient algorithm as it eliminates the need to estimate pairwise distances between widely separated data points. Furthermore, it assumes that the manifold is linear when viewed locally. Thus it recovers the non-linear structure from locally linear fits”, <a href="https://towardsdatascience.com/lle-locally-linear-embedding-a-nifty-way-to-reduce-dimensionality-in-python-ab5c38336107">LLE: Locally Linear Embedding — A Nifty Way to Reduce Dimensionality in Python</a> by Saul Dobilas (10/10/2021) <a href="https://towardsdatascience.com/lle-locally-linear-embedding-a-nifty-way-to-reduce-dimensionality-in-python-ab5c38336107">TowardsDataScience.com</a></p><p>Using LLE, I reduced a 25 feature set down to just two features:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*bTjLFlySZknHIvwE4tTPwQ.png" /><figcaption>Manifold Learning</figcaption></figure><p>These two components were added to the main dataframe as well as saved off into their own numpy Series which will be used to fit the three clustering algorithsm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*RF0AdmnuhDkO-hRw_FP9-g.png" /></figure><h3>Application of Unsupervised Learning Algorithms</h3><p><strong>KMeans Clustering</strong></p><p>The algorithm works by grouping data together into a fixed number of clusters. This number of clusters is the “K” in KMeans clustering. Data points are assigned to clusters based on their distance from the centroid of the cluster. It then calculates the means of each cluster. It iterates this process by taking the variation of the cluster. “The quality of the cluster assignments is determined by computing the sum of the squared error (SSE) after the centroids converge, or match the previous iteration’s assignment. The SSE is defined as the sum of the squared Euclidean distances of each point to its closest centroid. Since this is a measure of error, the objective of k-means is to try to minimize this value.” <a href="https://realpython.com/k-means-clustering-python/">Kevin Arvai, <em>K-Means Clustering in Python: A Practical Guide</em>, RealPython.com(2021)</a></p><p>Finding the correct number of cluster is an iterative process. I fitted the algorithm on the two Manifold components, df_lle, from 1 to 25 clusters. The number of clusters is determined by plotting each cluster against the within cluster sum of squares (WCSS) sum of the squared deviations from each observation and the cluster centroid. When the graph levels out after steep declines shows us the number of clusters.</p><p>The optimal number of KMeans clusters is 5. All 344 players are assigned one of these clusters</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*qux84i4COTzFu7Ptl9ml1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*qeLeQDb5Jgfw6iaDmKpu3Q.png" /><figcaption>KMeans Clusters</figcaption></figure><p><strong>GMM Clusters</strong></p><p>Similar to the KMeans approach, to discover the correct number of components for the algorithm is a trial and error process. I created a list comprehension which applied the Gaussian Mixture algorithm for 25 components. The <strong>Akaike Information Criterion (“AIC”)</strong> and <strong>Bayesian Information Criteria (“BIC”)</strong> are used to find the optimal number of components. Output from the AIC and BIC are plotted.The optimal number of components is determined by choosing the model with the lowest AIC or BIC value.In the model below, the best GMM model for the data is with 4 components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*OkETKd2cZK5v84mi9OVpsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*BG5liroBkzaT3XJ-d_Axhw.png" /><figcaption>GMM Clusters</figcaption></figure><h4>Agglomerative Hierarchy clustering</h4><p>Agglomerative hierarchy clustering is bottom-up hierarchial clustering algorithm. It starts with each data point as a separate cluster and iteratively merge the closest pairs of clusters until a stopping criterion is met. This creates a hierarchy of clusters that can be visualized as a dendrogram. Common linkage methods for merging clusters include single linkage, complete linkage, and average linkage, among others.</p><p>The dendrogram shows that there are 4 AGC Clusters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OJJl-BDX5JMls4-exxb8-w.png" /><figcaption>AGC Dendogram</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*wVr9E8itjO57Q_K9a0Nk7Q.png" /></figure><p><strong>NBA MVPs</strong></p><p>Every year, the NBA names the Most Valuable Player (“MVP) of the league. The last 10 NBA MVPs are:</p><ul><li>LeBron James</li><li>Kevin Durant</li><li>Stephen Curry</li><li>Russell Westbrook</li><li>James Harden</li><li>Giannis Antetokounmpo</li><li>Nikola Jokic</li></ul><p>Using the last 10 NBA MVPs (some were repeat), we can see that they all belong to the same clusters for each algorithm, KMeans and GMM which are cluster 2 and AGC which is cluster one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*LAHC6tRHAIeMsCbYIshMwA.png" /></figure><p>Out of 344 players in the dataset, 45 fit into these clusters and can be deemed “elite”. Visually, we can see the difference between elite players and other players the features. For example, see how skewed the distributions are over Points and Assists per Game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*_XozL7HXXdlQH70vRD1R_Q.png" /><figcaption>Comparison of non-elite and elite players on PPG and APG</figcaption></figure><h4>Finding the Elite of the Elite</h4><p>At this point in the project, I have applied the three unsupervised machine learning algorithms which identified the initial elite clusters, KMeans Clusters = 2, GMM Clusters = 2, and AGC Clusters =1. There were 45 players out of 344 that were in all three clusters and could be called “Elite”. A sample of these players shown below includes recent MVP winners:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*N2vLRpu5cjAwATCuvcSk8w.png" /><figcaption>Sample of Players Identified as Elite</figcaption></figure><p>To find the elite of the elite or top tier elite, the entire process was re-run but this time just against the elite cluster which were filtered into its own dataframe, elite_df, and its LLE components put into their own Series.</p><p><strong>KMeans Elite Clusters</strong></p><p>The KMeans algorithm found three clusters within the elite cluster:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*ZvpjEwn5GZP6SbvQbZm92w.png" /><figcaption>KMeans Elite Clusters</figcaption></figure><p><strong>GMM Elite Clusters</strong></p><p>There are only two GMM Elite Clusters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*BTHznA-v8XwWu8WkZLvTmA.png" /></figure><p><strong>AGC Elite Clusters</strong></p><p>The Agglomerative Hierarchial cluster algorithm also only found two clusters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*Z6eKcbzxqx56a1upF88kXA.png" /></figure><p><strong>The MVP Test</strong></p><p>Using the previous and current MVPs as a test, the elite elite cluster is comprised of KMeans and GMM Elite Clusters equaling 0 and the AGC Elite Cluster equaling 1. Players who are in these three clusters are tagged as “top tier elite” while players not in these three clusters are tagged as “second tier elite”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*xPd248jc7zyONsPKsB50TQ.png" /><figcaption>Top Tier Elite Clusters</figcaption></figure><p><strong>The Top 5% — Top Tier Elite</strong></p><p>The algorithms have now identified the top 29 players (the top 5%)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*jxq63SJtE824KIQ36eysCQ.png" /></figure><p><strong>Characteristics of Top Tier Elite — Position</strong></p><p>Of the 29 top tier elite players, 14 of them purely play the Guard position. There are no hybrid Forward-Centers, and there is only pure center, Nikola Jokic, and one hybrid Center-Forward, Joel Embiid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*wrBfB6DjG6BvV0_OBzohiQ.png" /></figure><p><strong>Characteristics of Top Tier Elite — Age</strong></p><p>For the top tier elite, the age drop off is even more pronounced. There’s a significant drop off after age 27.5 compared to the more gradual drop off of other players. The average age is 29 with only 9 players are aged 27.5 or higher.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*w3f9Dl-2yiBAhs7g1jYubA.png" /><figcaption>Age Distribution of the Top Tier Elite</figcaption></figure><p><strong>Characteristics of Top Tier Elite Players — More Points, Rebounds, Assists, and Steals</strong></p><p>Across the production categories of Points, Assists, Rebounds, and Steals, the top tier elite well out-perform the non-elite players and only slightly out-perform the second tier elite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*NgRdyS2eZ7VH9fobbV_98w.png" /></figure><p><strong>Characteristics of Top Tier Elite Players — Versatility Inde</strong>x</p><p>The Versatility Index (“VI”) is a metric that measures a player’s ability to produce in points, assists, and rebounds. The average player will score around a five on the index while top players score above 10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*95O4z_R5QvS8xlR5flu65w.png" /><figcaption>VI Mean</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*IFhl7eB-rDp_CGYo7qsN7A.png" /></figure><h3>Top Tier Elite Players — The Top 5%</h3><p>Out of 605 total players, these 29 have been identified as the top tier elite:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*_uel2nCI1StZxICdYqTtHw.png" /></figure><p>All of the players identified by the three algorithms also made a 2021–22 All NBA teams with two exceptions:</p><p>Karl Anthony Towns who is a Center. All NBA teams have to vote by position. Towns, who is in the Second Tier Elite, is one of two Centers in that cluster. There are only 4 Centers in total in the Elite Clusters.</p><p>The other exception is Chris Paul which is a curious selection. There are 10 Guards ahead of him in the top tier. Paul is in the second tier elite, but that was cleary a sentimental, biased choice.</p><p><strong>Tableau Visualization</strong></p><p>For a Tableau Visualization of these players along with in-depth analysis, please visit this link: <a href="https://public.tableau.com/views/NBATopTierElite-ASegmentAnalysis/IdentifyingtheTop5ofNBAPlayersusingUnsupervisedMachineLearningAlgorithms?:language=en-US&amp;:display_count=n&amp;:origin=viz_share_link">Tableau Visualization</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*y4pgWVcl-hyH6noGL4ZZFQ.png" /></figure><p><strong>Google Colab Notebook</strong></p><p><a href="https://colab.research.google.com/drive/1TKIfMrK_gmrD9CHRLjFzIxGLnwIHmgti?usp=sharing">NBA Top Tier Segment Analysis — Google Colab Notebook</a></p><p><strong>Contact information</strong></p><p>John K. Hancock<br>Email: <em>jkhancock@gmail.com</em></p><p><strong>References</strong></p><p>Richard Bellman, Wikipedia Article, <a href="https://en.wikipedia.org/wiki/Richard_E._Bellman)">https://en.wikipedia.org/wiki/Richard_E._Bellman</a> (Last Updated April 9, 2023)</p><p>Andre Ye, Manifold Learning t-SNE, LLE, Isomap Made Easy, Towards Data Science, <a href="https://www.towardsdatascience.com/">https://www.towardsdatascience.com</a> (08/12/2020)</p><p>Saul Diblas, LLE: Locally Linear Embedding — A Nifty Way to Reduce Dimensionality in Python, Towards DataScience, <a href="https://medium.com/towards-data-science/lle-locally-linear-embedding-a-nifty-way-to-reduce-dimensionality-in-python-ab5c38336107">https://towardsdatascience.com</a> (10/10/2021)</p><p>Matt Brems, A One-Stop Shop for Principal Component Analysis, Towards Data Science, <a href="https://medium.com/towards-data-science/a-one-stop-shop-for-principal-component-analysis-5582fb7e0a9c">https://towardsdatascience.com</a> (April 17, 2017)</p><p>Kevin Arvai, K-Means Clustering in Python: A Practical Guide 2021 English Real Python, <a href="https://realpython.com/k-means-clustering-python/">https://realpython.com/k-means-clustering-python/</a></p><p>Chris Ding and Xiaofeng He, K-means Clustering via Principal Component Analysis, K-means Clustering via Principal Component Analysis, Proc. of Int’l Conf. Machine Learning, <a href="https://ranger.uta.edu/~chqding/papers/KmeansPCA1.pdf">https://ranger.uta.edu/~chqding/papers/KmeansPCA1.pdf</a> (2004)</p><p>Ajitesh Kumar, Gaussian Mixture Models: What are they &amp; when to use?, Data Analytics, <a href="https://vitalflux.com/gaussian-mixture-models-what-are-they-when-to-use/">https://vitalflux.com/gaussian-mixture-models-what-are-they-when-to-use/</a> (April 14, 2022)</p><p>Images courtesy of the website <a href="http://www.statsmuse.com/">www.statsmuse.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48cde2649c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Visualizing NYC Noise Complaints with MS PowerBI]]></title>
            <link>https://medium.com/@jkhancock/visualizing-nyc-noise-complaints-with-ms-powerbi-3c76fad52ebb?source=rss-1182b68fa2fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c76fad52ebb</guid>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[noise-complaints]]></category>
            <category><![CDATA[new-york-city]]></category>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[John K. Hancock]]></dc:creator>
            <pubDate>Fri, 03 Mar 2023 22:52:11 GMT</pubDate>
            <atom:updated>2023-03-03T22:52:11.301Z</atom:updated>
            <content:encoded><![CDATA[<p>Data visualization is a powerful tool that provides fast and easily accessible insights into large data collections. Key decision makers at all levels are able to identify important data points that provide assistance into making decisions. This rather simple project demonstrates the power of data visualization using PowerBI by Microsoft.</p><p>The objective of this project is to create an interactive visualization of noise complaints called into NY city’s 311 service. Such complaints are logged and maintained by NYC’s Open Data project. Complaints go as far back as 2010.</p><p>For this project, I discuss the following</p><p><strong>I. The Data Source<br> II. Data Importation<br>III. Data Preparation<br>IV. Data Modeling and Additional Measures<br> V. Exploring the Visualizations<br> VI. Summary</strong></p><p><strong>I. The Data Source — NYC 311 and Open Data</strong></p><p>New York city provides a non-emergency telephone number, 3–1–1, for municipal services. Operators are available 24/7. Residents use this number for information about government services like parks, recreation, events. In addition they may use this number to register complaints about pests like rodents, trash pickups, and noise.</p><p>For more information about NYC 311 please see this link:<br><a href="https://portal.311.nyc.gov/">https://portal.311.nyc.gov/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DIn9Y_1XRyG_tLWeyxvnwg.png" /></figure><p><strong>NYC Open Data</strong></p><p>New York city’s Open Data project maintains data that is produced and used by New York city. All noise complaints to the NYC’s 311 lines are logged into a database maintained by NYC Open Data project.</p><p><a href="https://opendata.cityofnewyork.us/overview/">NYC Open Data</a></p><p>Data is publicly available, free to use, and without any legal restrictions. The data is updated daily. Data can be linked directly at the site, but only the last 1000 records are available through this method. Since this project will be looking at data from 2022 and 2020, I had to export it from the site instead of reading it in directly.</p><p><strong>II. Data Importation</strong></p><p>The entire exported dataset consists of 5.7 million rows and 39 columns. Each row represents a noise complaint called into the 311 number dating back to 2010. There are no privacy issues with the data. All information about the data, including the metadata, can be found at this link: <a href="https://data.cityofnewyork.us/Social-Services/311-Noise-Complaints/p5f6-bkga">metadata</a></p><p><strong>III. Data Preparation</strong></p><p>I won’t discuss every decision that I made to prepare the data. For brevity, I am including only some of the more important steps. After importing the dataset into PowerBI, I changed the datatype of the CreatedDate column to Date/Time and then culled the data by date range keeping only complaints from 2020 and 2022.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/1*FlzGJ-iF5BZWl5eCKpDSxA.png" /></figure><p>Next, I removed most of the 39 columns and kept the most pertinent columns.</p><p>‘Unique Key’, ‘Created Date’, ‘Agency’, ‘Agency Name’, ‘Complaint Type’, ‘Descriptor’, ‘Location Type’, ‘Incident Zip’, ‘City’, ‘Borough’, ‘Latitude’, ‘Longitude’, and ‘Location’</p><p>I separated the Created Date/Time columns and removed the original column.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/233/1*F-K6ADVPOtmYAPAWT-XtoQ.png" /></figure><p>I created a new column, BoroughID which assigned a number to each borough 1–5 for the Bronx, Brooklyn, Manhattan, Queens, and Staten Island. NYC is divided into boroughs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*_5KlOlebAEH7mDb7963jMA.png" /></figure><p>I normalized the Descriptor column which provides the type of complaint</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/146/1*8ox0LwWuKD9jVRI2rM1XUQ.png" /></figure><p>Finally, I created new columns for the Day Name, Day of Week, Year, Hour of the Day, Month of Year, and Month</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*jpkXbWNVCXeiAtiovrxAKw.png" /></figure><p><strong>IV. Data Modeling and Additional Measures</strong></p><p>I created a star schema data model based on the original dataset. The model allows me to de-duplicate the data and to filter and aggregate data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*50HhvRhRp6aq7i64lNMv6w.png" /></figure><p>The tables, Dates, Times, Days, Boroughs, Complaint Categories, and Agencies are the unique values (Dimensions) of the namesake columns in the main (Fact) table.</p><p>Tables, Complaints by Zipcode 2022 and 2022 Complaints by Borough are created using DAX measures that aggregate the data. For example, Rank in the Complaints by Zipcode 2022 table shows the rank of each zip by the number of complaints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*umBsh5iQFqdBBZG0ICFBUw.png" /></figure><p><strong>V. Exploring the Visualizations</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uqfvjJgVavnozJzniJNXZA.png" /><figcaption>Summary</figcaption></figure><p>I created four main visualizations. The Summary visualization contains a card showing the total number of complaints. A bar chart shows the percentage of all complaints by type, and a donut chart shows the number of complaints by city borough. The visualization communicates that of the total number of complaints over 60% were for Loud Music/Party with the Bronx and Manhattan combining for the most number of complaints while Staten Island had the fewest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xaon6YyVvhByUcwxhQ5eIQ.png" /><figcaption>Boroughs</figcaption></figure><p>The next visualization, Boroughs, is the first interactive visualization. Here, the end user can select a borough which then filters a bar chart visualization on the number of complaints and an area chart showing the number of complaints per month.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVNwM5U3tkbzSXKw8zEepQ.png" /><figcaption>Interactive Search by Zip Code</figcaption></figure><p>The next interactive visualization provides more details about the complaints. The end user looking for a quieter neighborhood can use this visualization to compare and contrast different zip codes. Using use a drop down list to locate a zip code of interest, a map of complaints (using the Longitude and Latitude columns), shows the exact location of each complaint, the number of complaints per day of the week and the time of the day, the ranking of each zip code in comparison to other zip codes, and where that zip code ranks among the percentiles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vglc3U4wxv7X_FmFQT4Ygw.png" /><figcaption>2020 vs 2022</figcaption></figure><p>The final visualization is a comparison of noise complaints between 2020 and 2022. This visualization is primarily informational. It shows that there were more complaints during the pandemic restrictions compared to today where those restrictions have been lifted.</p><p><strong>VI. Summary</strong></p><p>This was a fairly simple, straightforward project demonstrating the power of data visualization. Key insights, such as complaints per borough, Zipcode, month of the year, day of the week, can be accessed and interacted with by the end user. Power BI is one of the best tools for this kind of project.</p><p>For the full project, please click on the link below:</p><p><a href="https://tinyurl.com/NYNoise2022">Power BI Report</a></p><p><em>This report was created by John K. Hancock using Microsoft PowerBI. <br>You may reach him at </em><strong><em>jkhancock@gmail.com</em></strong><em>. <br>Data Source: </em><a href="https://opendata.cityofnewyork.us/"><em>https://opendata.cityofnewyork.us/</em></a></p><p><em>Comments and questions are welcome.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c76fad52ebb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>