<?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 Hafsa Farooq on Medium]]></title>
        <description><![CDATA[Stories by Hafsa Farooq on Medium]]></description>
        <link>https://medium.com/@hafsafarooq125?source=rss-7e43c0deda9c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OPjAK4MU0Yq9SxaueciiNg.jpeg</url>
            <title>Stories by Hafsa Farooq on Medium</title>
            <link>https://medium.com/@hafsafarooq125?source=rss-7e43c0deda9c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 04:42:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hafsafarooq125/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[Google’s Gemini — A multimodal model pushing the boundaries of AI]]></title>
            <link>https://pub.aimind.so/googles-gemini-3e4f562e727f?source=rss-7e43c0deda9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e4f562e727f</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Hafsa Farooq]]></dc:creator>
            <pubDate>Thu, 07 Dec 2023 20:37:28 GMT</pubDate>
            <atom:updated>2023-12-08T06:12:37.175Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BEDHdWc43oHOHucmNApztg.png" /><figcaption>Image from Google’s DeepMind</figcaption></figure><p>Before starting, let us have a look at this video released by Google —</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUIZAiXYceBI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUIZAiXYceBI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUIZAiXYceBI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/edac35561c8495167cf31def0cc5e161/href">https://medium.com/media/edac35561c8495167cf31def0cc5e161/href</a></iframe><p>As Google’s DeepMind introduces its much awaited AI by saying “<em>Welcome to the Gemini era</em>”, the tech industry finds itself captivated by the released trailer videos. Demis Hassabis, CEO at DeepMind, used the phrases “<em>the first step towards a truly universal AI model</em>”, emphasising its significance in advancing towards the world’s actual inaugural multimodal AI model.</p><h4>Multimodal AI</h4><blockquote>Multimodal AI models are those models that can process information from diverse sources or modalities, such as text, images, audio, and video, to enhance overall understanding and decision-making.</blockquote><p>Till date, multimodal AI was created by stacking together “<em>text-only, vision-only and audio-only models in a suboptimal way in a secondary stage</em>”. <em>Google Translate</em> is one such example that “integrated” image and text models to enhance its capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4342dsMfjenln9cVZAYN1A.png" /><figcaption>Types of inputs Gemini understands</figcaption></figure><p>This time it is a little different — Introduced as a “ground-up or natively multimodal AI”, Gemini can “<em>seamlessly have conversations across modalities</em>”. Representing the largest and most capable AI model developed by Google, it asserts the capability to comprehend the world as we do and assimilate any type of input — a significant claim put forth by the creators of Gemini.</p><h4>Model Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rXWNXU8vRTc-iOv6OmRzug.png" /><figcaption>Source: <a href="https://storage.googleapis.com/deepmind-media/gemini/gemini_1_report.pdf">Technical report</a></figcaption></figure><p>Foundation:</p><ul><li>Gemini models leverage Transformer decoders as their foundation, further enhanced with architectural improvements and optimization techniques. These enhancements facilitate stable training on large datasets and efficient inference on Google’s in-house Tensor Processing Units (TPUs).</li></ul><p>Features:</p><ul><li>Context Window: Supports 32k context lengths(for all variants) with efficient attention mechanisms like multi-query attention.</li><li>Smaller than Claude 2 (200K) and GPT-4 Turbo (128K).</li><li>Effective utilization of context length reported.</li><li>Accepts interleaved textual, audio, and visual inputs.</li><li>Produces both text and image outputs.</li><li>Encodes video as a sequence of frames within a large context window.</li><li>Handles variable input resolution.</li><li>Ingests audio signals at 16kHz from Universal Speech Model features.</li></ul><p>Inspiration and Encoding:</p><ul><li>Draws inspiration from Flamingo, CoCa, and PaLI for multimodal capabilities.</li></ul><p>Training and Optimization:</p><ul><li>Employs innovative training algorithms, datasets, and infrastructure.</li><li>Pro model: pretrains in weeks with significantly fewer resources than Ultra.</li><li>Nano series: leverages distillation and training advancements to create best-in-class small LLMs for on-device tasks like summarization and reading comprehension.</li></ul><p>Additional notes:</p><ul><li>Datasets and architecture not publicly disclosed.</li><li>Data is multimodal and multilingual.</li><li>Data used is web documents, books, and code, and includes image, audio, and video data.</li><li>Gemini models were trained using TPUv5e and TPUv4, with Gemini Ultra utilizing a large fleet of TPUv4 accelerators across multiple datacenters.</li><li>The SentencePiece tokenizer is employed, and training it on a large sample of the entire corpus enhances vocabulary and subsequently improves model performance.</li></ul><h4>Gemini Model Variants</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgU59M9pSUbyNh4UIyCe2g.png" /><figcaption>Image from Google&#39;s DeepMind</figcaption></figure><p>Sizes:</p><ul><li>Ultra: Achieves SOTA benchmarking; most capable and largest model in the family for highly complex tasks; surpasses GPT-4.</li><li>Pro: Optimised for cost and latency.</li><li>Nano: Device-targeted; 4-bit quantized for deployment; divided into Nano 1 (1.8B) and Nano 2 (3.25B) for low- and high-memory devices.</li></ul><p>Availability:</p><ul><li>Ultra: Early 2024 on Bard Advanced.</li><li>Pro: Available now on Bard (170 countries, English).</li><li>Nano: Built-in on Pixel 8 Pro, future integration in other products and services (details not specified).</li></ul><h4>Superior Performance</h4><p>Demis used the phrases that Gemini is “<em>so good at so many things</em>”, “<em>better than any other model out there</em>” on important benchmarks. Based on the blog <a href="https://archive.ph/s5yJo#selection-4555.0-4555.74">post</a>:</p><p><em>Gemini Ultra exceeds human expert performance by scoring 90% on Massive Multitask Language Understanding (MMLU). It demonstrates robust multimodal reasoning by achieving a score of 59.4% on the new Multimodal Multitask Understanding (MMMU) benchmark. With the image benchmarks tested, Gemini Ultra outperformed previous state-of-the-art models, without assistance from object character recognition (OCR) systems that extract text from images for further processing.</em></p><p>The table below compares the performance of GPT-4 and Gemini Ultra across various benchmarks measuring different <em>cognitive abilities</em>. Gemini Ultra consistently outperforms GPT-4 in most categories, highlighting its superior capabilities in natural language processing and AI tasks. While improving these systems appears challenging based on the numbers, the overall performance is commendable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZXwxQuaKLgRgtiGYIZC3Q.png" /><figcaption>Image from Google’s DeepMind</figcaption></figure><p>Another comparison on multimodal tasks shows that Gemini surpasses the previous state-of-the-art (SOTA) model on most multimodal tasks. This means that Gemini is able to perform the tasks more accurately and efficiently than any other model currently available.</p><ul><li>Image understanding: 59.4% (SOTA: 56.8%)</li><li>Natural image content: 77.8% (SOTA: 77.2%)</li><li>VQA on natural images: 82.3% (SOTA: 78.0%)</li><li>VQA on documents: 90.9% (SOTA: 88.4%)</li><li>VQA on infographics: 80.3% (SOTA: 75.1%)</li><li>Math reasoning with visuals: 53.0% (SOTA: 49.9%)</li><li>Video captioning: 62.7 (SOTA: 56.0)</li><li>Video comprehension: 54.7% (SOTA: 46.3%)</li><li>Speech translation: 40.1 (SOTA: 29.1%)</li><li>Speech recognition: 7.6% (SOTA: 17.6%)</li></ul><p>Overall, the results in the table show that Gemini is a significant advancement in multimodal AI technology. It is the first model to outperform human experts on a variety of multimodal tasks, and it is likely to have a major impact on the development of new and innovative AI applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0DUPblRFDQHWvRU7UPj8dw.png" /><figcaption>Image from Google’s DeepMind</figcaption></figure><p>The model was tested across ~50 diverse subject areas, consistently surpassing other models and demonstrating performance on par with the expertise of the best human practitioners in those fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-JgqFT0mP0sONBVjoVxlA.png" /><figcaption>Image from Google’s DeepMind</figcaption></figure><h4>Conclusion</h4><p>Google’s Gemini marks a significant leap forward in the field of artificial intelligence, particularly within the realm of multimodal processing. Its ability to seamlessly handle various information sources positions it as a powerful tool with the potential to revolutionize diverse fields ranging from education and healthcare to creative industries and scientific research.</p><p>The difficulty of improving such systems is evident, yet Gemini has demonstrated a measurable leap forward,surpassing OpenAI’s GPT-4. Based on the trailer video, the model looks promising. This underscores the importance of techniques like multi-query attention, SentencePiece tokenizer, multimodal concepts, and optimal context lengths, based on the information available.</p><p>As the technology evolves and becomes more accessible, the ethical implications surrounding its use will need careful consideration and ongoing discussion. Nonetheless, Gemini’s emergence suggests a future where intelligent systems can interact and understand the world like never before, paving the way for exciting advancements and possibilities.</p><p>Happy learning:)</p><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e4f562e727f" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/googles-gemini-3e4f562e727f">Google’s Gemini — A multimodal model pushing the boundaries of AI</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SpaCy KeyError: [E022]]]></title>
            <link>https://pub.aimind.so/spacy-keyerror-e022-9a5c61e46212?source=rss-7e43c0deda9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a5c61e46212</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[spacy-ner-train-python]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[ml-training]]></category>
            <dc:creator><![CDATA[Hafsa Farooq]]></dc:creator>
            <pubDate>Sun, 03 Dec 2023 04:48:03 GMT</pubDate>
            <atom:updated>2023-12-06T17:26:40.236Z</atom:updated>
            <content:encoded><![CDATA[<h4>Transition Name Not Found in NER Model</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M7rKozY4SO28dcRb" /><figcaption>Photo by <a href="https://unsplash.com/@brett_jordan?utm_source=medium&amp;utm_medium=referral">Brett Jordan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Debugging is a form of art, and troubleshooting errors provides a deeper understanding of technical nuances than any tutorial ever could. Yet, at times, the error resolution process can be both exhaustive and seemingly endless.</p><p>During the training of a spaCy blank model (<em>spacy.blank(&quot;en&quot;)</em>), I encountered an error message as follows:</p><pre>---------------------------------------------------------------------------<br>KeyError                                  Traceback (most recent call last)<br>Cell In[135], line 34, in train_model_with_epochs(num_epochs, output_dir)<br>     30 #optimizer = nlp.begin_training()<br>     31 optimizer = nlp.create_optimizer()<br>     32     examples.append(example)<br>     33 print(examples)<br>---&gt; 34 nlp.update(examples, sgd=optimizer, losses=losses)<br>     35 timestamp = time.strftime(&quot;%Y-%m-%d %H:%M:%S&quot;)<br>     36 file.write(&quot;{} - Iteration : {} - Losses: {}\n&quot;.format(timestamp,_, losses))<br><br>KeyError: &quot;[E022] Could not find a transition with the name &#39;O&#39; in the NER model.&quot;</pre><p>In the process of comprehending and resolving this error, I encountered diverse explanations for what could lead to such issues. However, none of these solutions were consolidated, making the troubleshooting process time-consuming. This blog aims to consolidate all potential reasons and their respective resolutions for the benefit of others facing similar challenge.</p><p>This is an illustration of an example and the corresponding labels list used for training:</p><pre>example = {<br>    &#39;doc_annotation&#39;: {<br>        &#39;cats&#39;: {},<br>        &#39;entities&#39;: [&#39;O&#39;, &#39;O&#39;, &#39;O&#39;, &#39;B-org&#39;, &#39;L-org&#39;, &#39;O&#39;, &#39;O&#39;, &#39;O&#39;],<br>        &#39;spans&#39;: {},<br>        &#39;links&#39;: {}<br>    },<br>    &#39;token_annotation&#39;: {<br>        &#39;ORTH&#39;: [&#39;A&#39;, &#39;N&#39;, &#39;NUM&#39;, &#39;Kashmir&#39;, &#39;University&#39;, &#39;counter&#39;, &#39;near&#39;, &#39;NUM&#39;],<br>        &#39;SPACY&#39;: [True, True, True, True, True, True, True, False],<br>        &#39;TAG&#39;: [&#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;],<br>        &#39;LEMMA&#39;: [&#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;],<br>        &#39;POS&#39;: [&#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;],<br>        &#39;MORPH&#39;: [&#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;],<br>        &#39;HEAD&#39;: [0, 1, 2, 3, 4, 5, 6, 7],<br>        &#39;DEP&#39;: [&#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;],<br>        &#39;SENT_START&#39;: [1, 0, 0, 0, 0, 0, 0, 0]<br>    }<br>}<br>labels = [&#39;O&#39;, &#39;org&#39;]</pre><ol><li>Disparity in labels: Inconsistencies in labels can arise due to issues in the labels list, such as missing commas or discrepancies between label names and NER annotations. For instance: If NER annotation has ‘Aircraft_type’ but labels list contains ‘Aircraft type’.</li></ol><pre>labels=[&#39;Aircraft type&#39;, &#39;Temperature&#39;,&#39;Wind&#39;,<br>        &#39;Sky Cover&#39;, &#39;Overcast Sky Cover&#39; #missing comma<br>       &#39;Haze Flight visibility&#39;<br>        ]</pre><p>2. Version incompatibility: The spaCy version you are utilizing may introduce a specific tagging framework that your code anticipates. Currently, we have BIO, BIOES, and BILOU schemas.</p><pre>BILOU Method/Schema<br><br> | ------|--------------------|<br> | BEGIN | The first token    |<br> | ------|--------------------| <br> | IN    | An inner token     |<br> | ------|--------------------|<br> | LAST  | The final token    |<br> | ------|--------------------|<br> | Unit  | A single-token     |<br> | ------|--------------------|<br> | Out   | A non-entity token |<br> | ------|--------------------|<br><br>BIOES - Begin, Inside, Outside, End, Single<br><br>BIO - Begin, Inside and Outside. Words tagged with O are outside of named entities</pre><p>In certain scenarios, errors may arise when your code expects ‘None’ in place of non-entities during annotation, but encounters an ‘O’ instead, leading to confusion and processing difficulties.</p><p>3. Label Definition: If the error message indicates, “Transition with a name ‘B-AnyLabelName’ could not be found in the NER model,” it is advisable to inspect your labels list. To confirm the presence of ‘<em>AnyLabelName</em>,’ consider printing the labels list. If it is absent, utilize the following code to add it to your list.</p><pre>ner = nlp.get_pipe(&quot;ner&quot;)<br>ner.add_label(&quot;AnyLabelName&quot;)</pre><p>4. Training Data Headers: When converting a pandas data frame into spaCy-specific training data, it’s possible that the data frame headers persist in the training data as an example. As a consequence, when searching for annotations, errors may occur because no annotations are present in the initial entry (headers). It is recommended to inspect and address this issue in such cases.</p><p>5. Optimizer initialisation: Appropriate optimizer initialization is crucial and contingent on the type of model employed — whether it is pre-trained or blank.</p><pre># Inititalizing optimizer<br>if model is None:<br>    optimizer = nlp.begin_training()<br>else:<br>    optimizer = nlp.entity.create_optimizer()</pre><p>What do these mean?</p><p>In the event that the model is None, the code employs nlp.begin_training() to initiate the optimizer. This implies that you are commencing with a blank model and intend to train it from the ground up. The begin_training() function is commonly utilized in spaCy for model training purposes. Conversely, if the model is not None, indicating it has already undergone pre-training or initialization, the code utilizes nlp.entity.create_optimizer() to set up the optimizer. This suggests that the model is equipped with named entity recognition (NER) components, and you aim to establish an optimizer specifically tailored for fine-tuning or training the entity recognition segment.</p><p>These were some typical error scenarios we’ve encountered along with their respective solutions. Apart from these instances, errors may also emerge from other issues within the code. Please feel free to share your personal experiences in this regard. We hope this information proves valuable.</p><p>Happy learning:)</p><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a5c61e46212" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/spacy-keyerror-e022-9a5c61e46212">SpaCy KeyError: [E022]</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Lament for Humanity]]></title>
            <link>https://medium.com/@hafsafarooq125/a-lament-for-humanity-5af1b35f8371?source=rss-7e43c0deda9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5af1b35f8371</guid>
            <category><![CDATA[human-rights]]></category>
            <category><![CDATA[anti-colonialism]]></category>
            <category><![CDATA[palestine]]></category>
            <category><![CDATA[humanity]]></category>
            <category><![CDATA[politics]]></category>
            <dc:creator><![CDATA[Hafsa Farooq]]></dc:creator>
            <pubDate>Mon, 27 Nov 2023 18:07:07 GMT</pubDate>
            <atom:updated>2023-11-27T18:07:07.135Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kAQdWymr9h8825E9" /><figcaption>Photo by <a href="https://unsplash.com/@mockupgraphics?utm_source=medium&amp;utm_medium=referral">Mockup Graphics</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I looked up to see a man in boots, holding a machine gun towards me.</p><p>They killed some, saying they were too black to live,</p><p>And some were too much Arab.</p><p>Some they said were dangerously opinionated,</p><p>A few died exposing the system,</p><p>Others were a little too religious for them</p><p>Who didn&#39;t worship the banks they made.</p><p>Now, laying on the sand too hot,</p><p>Battered to near death, I had no fight left in me.</p><p>I waited for him to pull the trigger and bring an end to the misery.</p><p>As I closed my eyes, hoping it would be a bit easier that way</p><p>I recalled the face of a young boy from long ago,</p><p>pleading for the world to wake up to the genocide.</p><p>I remained apolitical and closed my eyes once,</p><p>then twice, and then thrice</p><p>Until it became a habit.</p><p>You might think of me as incapable of humanity,</p><p>But no!</p><p>I used to raise my voice when a puppy was mistreated in my society.</p><p>I wept for animal rights,</p><p>I also expressed my dismay when any celeb committed suicide</p><p>I had opinions on complex matters; after all, I was not naive!</p><p>But children dying in a genocide was some internal matter and too complicated for me,</p><p>And now when my turn has arrived</p><p>I wonder what justification will they offer to the world for my demise.</p><p>After all, I am neither black nor an Arab</p><p>Neither religious nor an opponent of their systems.</p><p>Perhaps the world no longer seeks a reason.</p><p>Like me, I guess it too has chosen silence,</p><p>than to cry for its fate</p><p>Instead indulge in shallowness</p><p>Until their turn arrives!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5af1b35f8371" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decoding BLEU: Evaluating Machine Translation with Precision and Pitfalls]]></title>
            <link>https://aiadvances.org/decoding-bleu-evaluating-machine-translation-with-precision-and-pitfalls-f678af392d8c?source=rss-7e43c0deda9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f678af392d8c</guid>
            <category><![CDATA[translation]]></category>
            <category><![CDATA[evaluation-metric]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[bleu]]></category>
            <dc:creator><![CDATA[Hafsa Farooq]]></dc:creator>
            <pubDate>Sun, 26 Nov 2023 09:00:38 GMT</pubDate>
            <atom:updated>2023-12-02T17:26:42.100Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KCIaB5ikdwCKvIam" /><figcaption>Photo by <a href="https://unsplash.com/@amandagraphc?utm_source=medium&amp;utm_medium=referral">Amanda Jones</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As Albert Einstein wisely said, ‘Do not judge a fish by its ability to climb a tree’, it becomes evident that diverse tasks and situations cannot be subjected to a uniform evaluation technique, at least not presently. Our previous blog post, <a href="https://medium.com/@hafsafarooq125/unveiling-the-metrics-magic-demystifying-rouge-scores-for-impactful-model-evaluation-3a4ab7c0a7af">Unveiling the Metrics Magic: Demystifying ROUGE Scores for Impactful Model Evaluation</a>, discussed the effectiveness of ROUGE scores in evaluating summarization models. Similarly, BLEU scores play a crucial role in assessing translation tasks.</p><p>The BLEU score checks how much a machine-translated text matches reference translations. The evaluation is computationally inexpensive and ranges between [0,1]. Research indicates a strong correlation between BLEU scores and human assessments of translation quality. It’s essential to recognise that even skilled human translators may not attain a flawless score of 1.</p><p>Let us discuss the technical aspects of the BLEU assessment method.</p><p><strong><em>Bilingual evaluation understudy — with examples</em></strong></p><p>BLEU, primarily used for translation evaluation, is a <em>precision-oriented </em>metric, emphasising correct <em>n-grams</em> in machine translations.</p><p>Precision is prioritised in machine translation quality assessment, aligning with user concerns about correctness rather than exhaustive information which in simple words means that precision aligns better with user concerns about the accuracy of translations rather than their completeness. For example, if a machine translation system consistently produces outputs that are half the length of the reference translations, this will have a significant impact on its recall score, but it will have little impact on its precision score.</p><p>The BLEU score is calculated as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qtWJwkVtSceJzFtqLjFF9Q.png" /><figcaption>Source: Google</figcaption></figure><p>In short, BLEU = Brevity penalty* n-gram overlap</p><p>The<strong> brevity penalty</strong> comes into play to address shorter generated translations compared to the closest reference length, applying an exponential decay. It serves to compensate for BLEU’s lack of a recall term. The brevity penalty, denoted as P, adjusts the score for translations shorter than the reference. It’s calculated as min(1, exp(1 - reference_length / translated_length)), considering reference_length as the total words in reference translations and translated_length as the total words in the output translation.</p><p><strong>Precision</strong> is gauged by the matching n-grams between the output translation and the reference translation, divided by the total n-grams in the output translation. The precision score, expressed as n_gram_matches / n_grams_in_output, considers the overlap of unigrams, bigrams, trigrams, and four-grams (i=1,…,4) with their counterparts in the reference translations.</p><p>Example —</p><p>Consider reference sentence<strong> “</strong><em>the cat is on the mat</em>” and output sentence “<em>the the the cat mat</em>” (candidate).</p><p>Count the occurrences of each unigram(n=1) in the reference and the candidate and the minimum:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0S3HuQZadzMO-Qd8Tf_Lng.png" /></figure><p>Hence <em>precision</em>(n-gram=1) here is (2 + 1 + 1)/5 = <strong>0.8</strong></p><p>To calculate bigram(n=2) precision, the tokens are: ‘the cat’, ‘cat is’, ‘is on’, ‘on the’ and ‘the mat’. Since only one bigram (‘the cat’) is present in the predicted sentence, the <em>precision</em>(n-gram=2) = 1/5 = <strong>0.2</strong></p><p>For trigram(n=3) precision, tokens are: ‘the cat is’, ‘cat is on’, ‘is on the’ and ‘on the mat’. Hence <em>precisio</em>n(n-gram=3) = 0/5 = <strong>0</strong></p><p>For (n=4) precision, tokens are: ‘the cat is on’, ‘cat is on the’, ‘is on the mat’. Thereby <em>precision</em>(n-gram=4) = 0/5 = <strong>0</strong></p><p><em>Geometric Average Precision = </em>(precision(<em>n=1</em>))^(1/4).(precision(<em>n=2</em>))^(1/4).(precision(<em>n=3</em>))^(1/4).(precision(<em>n=4</em>))^(1/4) = [(0.8)^(1/4)].[(0.2)^(1/4)].[(0)^(1/4)].[(0)^(1/4)] = 0.946*0.669*0*0 = <strong>0</strong></p><p><em>Brevity penalty = </em>min(1, exp(1 - reference_length/ translated_length)) = min(1, exp(1 — 6/5)) = min(1, 0.818) = <strong>0.82</strong></p><p>BLEU score = <em>Geometric Average Precision*Brevity penalty = </em>0*0.82 =<strong> 0</strong></p><p>This indicates a very poor translation score.</p><p>In conclusion, while BLEU is a widely used metric for evaluating machine translation, it has its limitations. The <em>corpus-based nature</em> of BLEU may not capture the nuances of individual sentences accurately, and its <em>treatment of all words equally, regardless of grammatical role</em>, can lead to oversights. For instance, if a function word like “a” is omitted, it incurs the same penalty as replacing the significant name “cat” with the incorrect “att”. Additionally, the focus on <em>n-gram matching</em> may not be foolproof, potentially <em>missing long-range dependencies</em> and changes in meaning. The influence of normalization and tokenisation choices further adds variability to BLEU scores.</p><p>Recognising the strengths and limitations of established methods is crucial for a nuanced understanding of the evaluation process and encourages researchers to explore complementary metrics for a more comprehensive assessment of translation quality.</p><p>Happy learning:)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9p04Yl7Oze3L6Wc0kIAOCw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f678af392d8c" width="1" height="1" alt=""><hr><p><a href="https://aiadvances.org/decoding-bleu-evaluating-machine-translation-with-precision-and-pitfalls-f678af392d8c">Decoding BLEU: Evaluating Machine Translation with Precision and Pitfalls</a> was originally published in <a href="https://aiadvances.org/">AI Advances</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling the Metrics Magic: Demystifying ROUGE Scores for Impactful Model Evaluation]]></title>
            <link>https://aiadvances.org/unveiling-the-metrics-magic-demystifying-rouge-scores-for-impactful-model-evaluation-3a4ab7c0a7af?source=rss-7e43c0deda9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a4ab7c0a7af</guid>
            <category><![CDATA[rouge]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[evaluation-metric]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Hafsa Farooq]]></dc:creator>
            <pubDate>Sat, 18 Nov 2023 18:17:44 GMT</pubDate>
            <atom:updated>2023-12-02T17:26:16.043Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TOg-_Qte_lqD_sih" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In an era defined by a passionate workforce, transforming the mundane into the magical through the enchanting realm of artificial intelligence, the pivotal question arises: how do we evaluate these remarkable creations and gauge the outcomes? The ‘magic’ produced should, at the very least, match human capabilities, if not surpass them. And if it cannot achieve human-like nuances, it must be unfailingly accurate.</p><p>With the dawn of ‘Generative AI,’ the complexity of this question has intensified, leaning toward abstractive setups gaining prominence over extractive setups. We quantify accuracy by assessing the ratio of correct predictions to the total predictions. However, in the realm of large language models, this output tends to be non-deterministic.</p><p>As an illustration, how would you go about comparing “<em>OpenAI did a tremendous job in good faith</em>” with “<em>OpenAI performed admirably with a strong sense of goodwill</em>”? The sentences have nuanced differences in expression, yet both convey a positive assessment of OpenAI’s efforts. Contrastingly, when examining the two opposing sentences with a mere one-word difference — “<em>I like tea</em>” and “<em>I don’t like tea</em>” — the subtle alteration transforms the entire sentiment.</p><p>To measure the likeness and, consequently, the accuracy of text, we turn to specific metrics, including notable ones such as ROUGE and Bleu. In this write-up, let’s delve into the ROUGE metric, unraveling its intricacies in detail.</p><p><strong><em>Recall Oriented Understudy For Gisting Evaluation — with examples</em></strong></p><p>Consider an LLM designed to infer summaries of given documents. To boost the trustability in the model, we will need to compare the human generated (reference) summaries with the LLM generated ones to conclude upon the <em>quality</em> of the model. The ROUGE metric employs the principles of n-grams and recall to formally assess this alignment. While it considers both recall and precision, its design prioritizes recall ensuring that generated summaries capture crucial details from reference summaries (recall) over avoiding unnecessary information. This emphasis on recall underscores its “recall-oriented” nature. We will illustrate everthing mathematically -</p><blockquote><strong>ROUGE-N mechanism —</strong></blockquote><blockquote>Recall = n-gram matches/n-grams in reference</blockquote><blockquote>Precision = n-gram matches/n-grams in output</blockquote><p>Example: Reference sentence-<em>It is cold outside</em>. Generated output-<em>It is very cold outside</em>.</p><p>Rouge-1 recall = count[It, is, cold, outside]/count(reference) = 4/4 = 1 || Rouge-1 precision= count[It, is, cold, outside]/count(generated) = 4/5 = 0.8 || Rouge-1 F1-score= 0.89</p><p>If observed, Rouge-1 doesn’t consider the order.</p><p>Rouge-2 recall = count[It is, cold outside]/count(It is, is cold, cold outside) = 2/3 = .67 || Rouge-2 precision= count[It is, cold outside]/count(It is, is very, very cold, cold outside) = 2/4= 0.5 || Rouge-2 F1-score= 0.57</p><blockquote><strong>ROUGE-L mechanism —</strong></blockquote><blockquote>Recall = Longest common subsequence/unigram in reference</blockquote><blockquote>Precision = Longest common subsequence/unigram in generated output</blockquote><p>Rouge-L recall = max(<em>len(It is)</em>, <em>len(cold outside)</em>)/count(It, is, cold, outside) = 2/4 = .5 || Rouge-L precision= max(<em>len(It is)</em>, <em>len(cold outside)</em>)/count(It, is, very, cold, outside) = 2/5= 0.4 || Rouge-L F1-score= 0.44</p><p>In addition to these, we have a Rouge-S (Skip-bigram overlap) to handle situations like ‘is cold’ and ‘is very cold’. It is worth noticing that ROUGE score ranges from [0,1].</p><p>Limitations of ROUGE:</p><ol><li>ROUGE falls short in handling synonyms, leaning more towards syntactical matches rather than semantic nuances.</li></ol><p>2. While not exclusive to ROUGE-1, consider the example, if the reference is — ‘<em>It is cold outside</em>’ and the generated output is — ‘<em>cold cold cold cold</em>’, the score will be high due to an error match. This is known as ROUGE hacking.</p><blockquote><strong>ROUGE hacking </strong>is a type of hacking that takes advantage of the way ROUGE-N is calculated to generate a false positive match between a reference sentence and a generated output. This is done by repeating the same word multiple times in the generated output, which will cause the ROUGE-N score to be inflated.</blockquote><p>To counteract this, a clipping method is employed, limiting the number of unigram matches to the maximum count for that unigram in the reference, providing a more accurate evaluation of content overlap.</p><p>Clipped Precision = Count of unigram matches (clipped) / Count of unigrams in output.</p><p>It is crucial to acknowledge that no singular technique is universally accurate, particularly in the realm of generative AI tasks. These techniques offer a quantitative assessment of the similarity between machine-generated output and reference translations or summaries, enabling researchers and practitioners to objectively evaluate the quality of their models. Benchmarks such as GLUE (2018), SuperGLUE, HELM, etc., have been established as standards for evaluation. In the upcoming blog, <a href="https://medium.com/@hafsafarooq125/decoding-bleu-evaluating-machine-translation-with-precision-and-pitfalls-f678af392d8c?source=your_stories_page-------------------------------------">Decoding BLEU: Evaluating Machine Translation with Precision and Pitfalls</a> we will delve into BLEU scores and explore their implementation.</p><p>Happy learning:)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9p04Yl7Oze3L6Wc0kIAOCw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a4ab7c0a7af" width="1" height="1" alt=""><hr><p><a href="https://aiadvances.org/unveiling-the-metrics-magic-demystifying-rouge-scores-for-impactful-model-evaluation-3a4ab7c0a7af">Unveiling the Metrics Magic: Demystifying ROUGE Scores for Impactful Model Evaluation</a> was originally published in <a href="https://aiadvances.org/">AI Advances</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parameter efficient fine-tuning: Efficient Fine-Tuning for Large Language Models]]></title>
            <link>https://aiadvances.org/parameter-efficient-fine-tuning-2be62385c831?source=rss-7e43c0deda9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2be62385c831</guid>
            <category><![CDATA[peft]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computationalefficiency]]></category>
            <category><![CDATA[fine-tuning]]></category>
            <dc:creator><![CDATA[Hafsa Farooq]]></dc:creator>
            <pubDate>Fri, 20 Oct 2023 21:29:34 GMT</pubDate>
            <atom:updated>2023-12-02T17:25:45.894Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tZkF0KaEdYsJX-1y2BMrkg.png" /></figure><p>The term ‘large’ in the large language models refers to the extensive number of parameters or neural network weights that these models contain. These transformer based models often have hundreds of millions, or even billions of parameters, which enable them to learn intricate patterns and nuances of language. To leverage these linguistic giants for downstream applications, advanced techniques such as prompt engineering, with the added finesse of zero-shot and few-shot methodologies, are employed. Fine-tuning becomes essential when prompt engineering alone proves insufficient for achieving the desired performance and when a more profound level of model customisation is required.</p><p>Typically, when we mention fine-tuning, it implies adjusting the model’s parameters based on a supervised dataset. In full fine-tuning, all model parameters are updated which includes not only the trainable weights but the optimiser states, gradients, etc., as well, which is a computationally intensive process and often impractical!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*1e3lcNah0plsbnzhZg8O0A.png" /></figure><p>Parameter-efficient fine-tuning, often referred to as PEFT, is a valuable approach when the objective is to retain the original model weights or a substantial portion of them. This practice, commonly known as ‘freezing’ model weights, plays a crucial role in mitigating challenges like ‘<strong>catastrophic forgetting</strong>’ in large language models (LLMs).</p><blockquote>Catastrophic forgetting is a phenomenon where a pre-trained model forgets previously learned information when it is trained on new information.</blockquote><p>If the model’s weights remain <em>almost</em> unchanged, a fundamental question arises: how do we conduct the fine-tuning process? PEFT offers two primary strategies to address this challenge. The first strategy involves freezing the majority of the pre-trained model’s weights while updating only a specific subset of layers or components. The training time also gets reduced because only ~15%–20% of pre-trained weights are updated. The second strategy avoids any modifications to the original model itself and instead introduces new parameters and layers, which are then fine-tuned to adapt to the target task.</p><p>Another advantage of PEFT is efficient disk space usage. Imagine having an unaltered, large LLM (in the order of GBs) and adding PEFT layers for tasks like QnA (in the order of MBs), summarization (in the order of MBs), and classification (in the order of MBs). Instead of storing three enormous models, the pre-trained base model remains consistent for various downstream tasks. When well-programmed, this approach optimizes the utilisation of resources efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mMscUm16_xW4fsz60syObg.png" /></figure><p>There are various PEFT methods, each with trade-offs on parameter-efficiency, memory-efficiency, training speed, model performance, or inference cost. Broadly speaking, the three main techniques are as follows-</p><ol><li>Selective methods: As the name suggests only a subset of original LLM parameters (top-layers) are fine-tuned selectively.</li><li>Reparametrization methods: Using the effectiveness of fine-tuning within low-rank subspaces, in this technique the LLM parameters are kept as it is. The number of parameters in training are reduced by creating new low-rank transformations. Example of this technique is LoRA. We will discuss this technique in detail.</li><li>Additive Methods: This approach involves preserving the original components while introducing new ones. It can be further divided into two sub-categories: <strong>Adapters</strong> and <strong>Soft Prompts</strong>.</li></ol><ul><li>Adapter methods introduce new components (adapters) in the encoder or decoder after the feed-forward layers. The remaining model parameters are kept frozen, allowing the adapters to be fine-tuned.</li><li>In soft prompting, the model’s architecture remains frozen, and vectors are incorporated into an <em>input sequence</em>. Subsequently, these vectors are fine-tuned while the rest of the pre-trained model’s components remain unchanged. The soft prompt tokens can take any value within the continuous embedding vector space. The trained tokens don’t correspond to any known token, word, or phrase in the vocabulary of the LLM. However, studies have shown that the soft prompt tokens tend to form tight semantic clusters, which suggests that they are learning to represent the concepts that are relevant to the task at hand. Typically, soft prompting can be achieved by either adding trainable parameters to the prompt embeddings or by keeping the input fixed and retraining the embedding weights.</li></ul><p>LoRA, short for Low-rank Adaptation, is a reparametrization technique that introduces two rank decomposition matrices alongside the existing model weights. The dimensions of these two matrices, denoted as RDM1 and RDM2, are configured in such a way that their product (RDM1 * RDM2) results in a matrix with the same dimensions as the weights they are modifying. Consequently, the original weights remain fixed, while these smaller matrices are subject to training.</p><p>Let’s illustrate it with an example to make it simpler to understand:</p><p>Consider a transformer model with self-attention weights having dimensions (d*k) as <em>512*64</em>. This means that the model has 32768 trainable parameters. In order to apply a low-rank adaptation technique on the given model, we need to come up with RDM1 * RDM2. The first step will be deciding the dimensions of these two rank decomposition matrices. Since the matrix multiplication product of these two matrices has to be added to the weights, the product has to have the same dimensionality i.e. d*k. For this, the dimensions of RDM1 should be d*r and that of RDM2 should be r*k, where r is known as the LoRA rank. If we take <em>r=8</em>, RDM1 will have <em>512*8=4096</em> parameters and RDM2 will have <em>8*64=512</em> parameters. This means the total number of parameters in RDM1 and RDM2 are 5608 which is a 82% decrease in trainable parameters!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*3a53wNviQXbBJfTO_D3OYg.png" /></figure><p>This model can be easily trained on a single GPU. The point to note about LoRA rank is that lower the rank, less are compute resources needed. Choosing LoRA rank is still an active area of research. Usually, based on research, it has been noted that adding LoRA to self-attention layers is enough to improve the performance but you can apply it to other components of the transformer architecture like feed-forward neural networks.</p><p>A few additional comments:</p><ul><li>PEFT is a relatively new field of research, and there is no single “best” PEFT technique. The best technique to use will depend on the specific task and dataset.</li><li>PEFT techniques can be used to fine-tune LLMs on a wide range of tasks, including text classification, question answering, summarization, and machine translation.</li><li>PEFT has the potential to make LLMs more accessible to researchers and practitioners who do not have access to large computing resources.</li></ul><p>Stay tuned. Happy learning:)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9p04Yl7Oze3L6Wc0kIAOCw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2be62385c831" width="1" height="1" alt=""><hr><p><a href="https://aiadvances.org/parameter-efficient-fine-tuning-2be62385c831">Parameter efficient fine-tuning: Efficient Fine-Tuning for Large Language Models</a> was originally published in <a href="https://aiadvances.org/">AI Advances</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data is the new fuel]]></title>
            <link>https://medium.com/devtorq/data-is-the-new-fuel-4891b2b43735?source=rss-7e43c0deda9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4891b2b43735</guid>
            <category><![CDATA[data-is-the-new-oil]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-privacy]]></category>
            <category><![CDATA[covid-19-data]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Hafsa Farooq]]></dc:creator>
            <pubDate>Fri, 18 Sep 2020 07:08:01 GMT</pubDate>
            <atom:updated>2020-09-18T07:08:01.043Z</atom:updated>
            <content:encoded><![CDATA[<p>With the buzz words like ‘Artificial Intelligence’, ‘Machine learning’, ‘Big data’, and ‘Robotics’ creating an uproar and excitement in the digital market today, one should essentially ponder over what is so cool about data! Antonio Neri, President of Hewlett Packard Enterprise was famously quoted as saying-</p><blockquote>“We live in an incredible time — every business has been disrupted by the digital transformation. The core of that transformation is the explosion of the data we are creating. <em>We call data as the new currency</em>.”</blockquote><p>Data has been called the new oil, the new gold, considering the effect it can have on the economical statistics of the world. You must have heard it that humans produce 2.5 quintillion bytes of data every day. In fact, the statistics show that on daily basis Instagram handles 95 million photos and videos being shared on its platform. About 306.4 billion emails are sent and 5 million Tweets are made each day. Facebook alone has a daily 350 million photos upload. It generates 4 petabytes of data per day!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V3HuN82qezvDOln2" /><figcaption>Photo by <a href="https://unsplash.com/@firmbee?utm_source=medium&amp;utm_medium=referral">William Iven</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>These aren’t just figures but the data of humans from around the globe that can give an enormous amount of information about their behavior, their affiliations, sentiments, and other vital aspects that if analyzed and processed well can change the graphs of businesses!</p><p>With companies spending a lot in hiring data engineers, analysts, data scientists, and other related job profiles, it can be understood as an investment made in the data resources. Post-corona virus hit, many businesses found that AI and data science were necessary to attract potential customers and maximize their efficiencies. Not only from the business aspect, the governments, parliaments, and the agencies have used the data analytics and modeling tools to track the COVID-19 outbreak in real-time. BlueDot, a start-up based in Toronto, was the first to report the COVID-19 outbreak in Wuhan in December 2019 because its AI, machine learning, and big data-based platform predicted some unusual pneumonia cases happening around the market in Wuhan. After that, Google’s DeepMind published a research paper based on deep learning, predicting the structure of proteins associated with SARS-CoV-2, the virus causing COVID-19 using their AlphaFold system.</p><p>This gives us a brief idea about the potential of the data but there are two phrases we need to remember — “Not all data is useful” and “All data is useful but is not used”. Seems like conflicting, right? The thing is that the data that is available consists of noise, outliers that if generalized can lead to the loss of meaning and can be a hit back. That is why before using the data for predictions, it is preprocessed and prepared enough to make it trustworthy. Another side of the coin is that the outlier data can speak volumes and is not totally a ‘waste data’ if utilized properly.</p><figure><img alt="Data privacy" src="https://cdn-images-1.medium.com/max/1024/0*AjYLyGrf0QE9BaxO" /><figcaption>Photo by <a href="https://unsplash.com/@morningbrew?utm_source=medium&amp;utm_medium=referral">Morning Brew</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The world may have been a little slow in realizing this matrix of a data revolution that has already enveloped us but the top-lined businesses had understood its importance way before. Be it Google, Facebook, Netflix, or the data science companies like Numerator, Cloudera, data science has been at the root of the career opportunities of the modern world. You must have heard about the openings for analytics managers, business analysts, data analysts, research analysts, data scientists, etc. As per the Glassdoor report, data scientists in America have an average salary of around 90K USD! With thousands of career opportunities, the proper guide to step into the field becomes crucial for those aspiring to stay in the top command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*-sKn4UaaH17IOIEf.png" /><figcaption>Image source: Google</figcaption></figure><p>The world may have been a little slow in realizing this matrix of a data revolution that has already enveloped us but the top-lined businesses had understood its importance way before. Be it Google, Facebook, Netflix, or the data science companies like Numerator, Cloudera, data science has been at the root of the career opportunities of the modern world. You must have heard about the openings for analytics managers, business analysts, data analysts, research analysts, data scientists, etc. As per the Glassdoor report, data scientists in America have an average salary of around 90K USD! With thousands of career opportunities, the proper guide to step into the field becomes crucial for those aspiring to stay in the top command.</p><p>Stay tuned. Happy learning:)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4891b2b43735" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devtorq/data-is-the-new-fuel-4891b2b43735">Data is the new fuel</a> was originally published in <a href="https://medium.com/devtorq">EduTorq Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributions — Understanding the statistical tools of python]]></title>
            <link>https://medium.com/devtorq/distributions-understanding-the-statistical-tools-of-python-c94114dd18d7?source=rss-7e43c0deda9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c94114dd18d7</guid>
            <category><![CDATA[probability-distributions]]></category>
            <category><![CDATA[numpy]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[Hafsa Farooq]]></dc:creator>
            <pubDate>Fri, 31 Jul 2020 10:17:37 GMT</pubDate>
            <atom:updated>2020-09-18T07:11:30.258Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Distributions — Understanding the statistical tools of python</strong></h3><p>Even though the term ‘data science’ was coined recently in 2008, it doesn’t mean that the field was inexistent before that. The field of statistics has been a breeding ground for the emerging field of data science. The fundamental difference in approach between the two is that <strong>the</strong> <strong>statisticians are in need of the data to solve a problem that is already known to them</strong> while <strong>the data scientists have to formulate the right questions given the bulk of data available to them</strong>. The field of statistics is considered as the cornerstone of the data science processes (be it data analysis and visualization or the designing of machine learning models).</p><p>In this article, we are going to learn about the concept of distributions, the binomial distribution in detail and understanding the python tools available for the purpose.</p><h4><strong>Distributions — The concept:</strong></h4><p>We are well aware of the concept of the probability of simple and complex events. Considering a simple event such as rolling dice or a complex event such as the respective success rates of the COVID19 drugs in the market, the dataset of all of the possible outcomes and their respective number of occurrences over some sample is called as the distribution table of the event and it gives the idea of the probability of the occurrence of a particular outcome from the frequency distribution it has over a given sample.</p><p>For instance, let’s take a simple event of tossing 4 coins. Again let X be some random variable (random because it takes numerical values subject to a random phenomenon) whose value is equal to the number of heads in this statistical experiment. The possible outcomes of this experiment are:</p><p>TTTT, TTTH, TTHT, THTT, HTTT, TTHH, THHT, HHTT, HTHT, HTTH, THTH, HHHT, HHTH, HTHH, THHH, HHHH</p><p>If we repeat the experiment 100 times to check the number of heads and record the number of times X(=0,1,2,3,4) heads occur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*iVN3BQ5dNiwmwyEDqVXtiQ.png" /><figcaption>Results of a statistical experiment repeated 100 times to check the number of heads each time four coins are tossed at once</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*UBVAaCjTTkaJVhEpwNZL9g.png" /></figure><p>There are different types of distributions depending upon the shape and the nature of data:</p><p>★ Binomial distribution</p><p>★ Chi-square distribution</p><p>★ Normal distribution</p><p>★ Poisson distribution</p><p>★ Bernoulli distribution</p><p>★ Uniform distribution</p><p>★ Exponential distribution</p><p>We will discuss binomial distribution in this blog and how python has made calculations easy for us.</p><p><strong>Binomial distribution</strong></p><p>In this type of distribution, there are only two possible outcomes in each trial — success and failure and we have to determine the number of successes possible in <strong>N</strong> trails. The random variable, in this case, is discrete and is denoted by X ~ b (N, p), where <strong>p</strong> is the probability of success in a single trail. The trails are independent of each other in a binomial statistical experiment. The binomial distribution is thereby bi-parametric. The binomial probability function b(n|N,p) denotes <strong>n</strong> successes in <strong>N</strong> trials and is equal to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*vlFUqp0AVdxdwnE8VDYViw.png" /><figcaption><strong>q</strong> = Probability of failure in a single trail (equals to (<strong>p</strong>-1))</figcaption></figure><p>The mean/expected value/average = <strong><em>Np</em></strong>, variance =<strong><em> Npq</em></strong> = <strong><em>Np(p-1)</em></strong></p><ul><li>When the value of <strong>p</strong> != <strong>q</strong>, then binomial distribution looks like:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*vSHIpo7fl1M90OblFOopVA.png" /></figure><ul><li>When the value of <strong>p</strong> = <strong>q</strong>, then binomial distribution looks like:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*1EdqZebnq_xK57KUsGtVqQ.png" /></figure><p>Python provides a way to skip these manual calculations and draw the simulations of real-world scenarios in a simpler manner.</p><p><strong><em>Python at scene</em></strong></p><p>The NumPy library provides us with a way to implement the binomial distributions by creating its <em>simulations</em>.</p><p>The following code with default values is been explained:</p><pre><strong>numpy.random.binomial(</strong><em>n</em><strong>, </strong><em>p</em><strong>, </strong><em>size=None</em><strong>)</strong></pre><p>The hyperparameters are as follows:</p><p><em>n</em><strong>: </strong>Number of trails; should be integer &gt; 0</p><p><em>p</em><strong>: </strong>Probability of success in one trial; interval [0,1]</p><p><em>size: </em>Determines the shape of the output. It is an interesting hyperparameter that along with the nature of n and p (scalar or vectors) determines the number of samples that are drawn.</p><p><em>Example:</em></p><pre>from numpy import random</pre><pre>random.binomial(n=100, p=0.5, size = 6)</pre><pre><em>Output: </em>[59 55 46 55 54 49]</pre><p><em>Example :</em></p><p>Suppose we want to simulate the probability of flipping a fair coin 20 times, and getting a number greater than or equal to 15. Use np.random.binomial(n, p, size) to do 10000 simulations of flipping a fair coin 20 times, then see what proportion of the simulations are 15 or greater.</p><pre><em>x = np.random.binomial(20, 0.5, 10000)</em></pre><pre><em>print((x&gt;=15).mean())</em></pre><pre><em>Output: </em>0.0228</pre><p><em>Example :</em></p><p>A company drills 9 wild-cat oil exploration wells, each with an estimated probability of success of 0.1. All nine wells fail. What is the probability of that happening?</p><p>Let’s do 20,000 trials of the model, and count the number that generates zero positive results.</p><pre>sum(np.random.binomial(9, 0.1, 20000) == 0)/20000.</pre><pre>Output: 0.38885, or 38%.</pre><p>These statistical models play an important role in the design of more complex data science models.</p><p>We will learn more about statistical tools provided to us by Python in the future.</p><p>Stay tuned. Happy learning:)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c94114dd18d7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devtorq/distributions-understanding-the-statistical-tools-of-python-c94114dd18d7">Distributions — Understanding the statistical tools of python</a> was originally published in <a href="https://medium.com/devtorq">EduTorq Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DBSCAN — A walkthrough of a density-based clustering method]]></title>
            <link>https://medium.com/devtorq/dbscan-a-walkthrough-of-a-density-based-clustering-method-b5e74ca9fcfa?source=rss-7e43c0deda9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5e74ca9fcfa</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[sklearn]]></category>
            <category><![CDATA[clustering-algorithm]]></category>
            <category><![CDATA[dbscan]]></category>
            <dc:creator><![CDATA[Hafsa Farooq]]></dc:creator>
            <pubDate>Fri, 24 Jul 2020 09:03:32 GMT</pubDate>
            <atom:updated>2020-08-09T09:29:27.361Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>DBSCAN — A walkthrough of a density-based clustering method</strong></h3><p>The idea of having newer algorithms come into the picture doesn’t make the older ones ‘completely redundant’. British statistician, George E. P. Box had once quoted that, <em>“All models are wrong, but some are useful”</em>, meaning that no model is exact enough to certify as cent percent accurate. Reverse claims can only lead to the loss of generalization. The most accurate thing to do is to find the most approximate model.</p><p>Clustering is an unsupervised learning technique where the aim is to group similar objects together. We are virtually living in a world where our past and present choices have become a dataset that can be clustered to identify patterns in our searches, shopping carts, the books we read, etc such that the machine algorithm is sophisticated enough to recommend the things to us. It is fascinating that the algorithms know much more about us then we ourselves can recognize!</p><p>As already discussed in the previous blog, K-means makes use of Euclidean distance as a metric to form the clusters. This leads to a variety of drawbacks as mentioned. Please refer to the blog to read about the K-means algorithm, implementation, and drawbacks: <a href="https://medium.com/@hafsafarooq125/clustering-diving-deep-into-k-means-algorithm-18305a37291">Clustering — Diving deep into K-means algorithm</a></p><p>The real-life data has outliers and is irregular in shape. K-means fails to address these important points and becomes unsuitable for arbitrary shaped, noisy data. In this blog, we are going to learn about an interesting <strong>density-based</strong> clustering approach — DBSCAN.</p><h4><strong>Density-based spatial clustering of applications with noise — DBSCAN</strong></h4><p>DBSCAN is a density-based clustering approach that separates regions with a high density of data points from the regions with a lower density of data points<strong>. Its fundamental definition is that the cluster is a contiguous region of dense data points separated from another such region by a region of the low density of data points</strong>. Unlike K-means clustering, the number of clusters is determined by the algorithm. Two important concepts are <strong>density reachability</strong> and <strong>density connectivity</strong>, which can be understood as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*dKA9zwel05El4kq24Yxkkw.png" /></figure><blockquote>“A point is considered to be density reachable to another point if it is situated within a particular distance range from it. It is the criteria for calling two points as neighbors. Similarly, if two points A and B are density reachable (neighbors), also B and C are density reachable (neighbors), then by chaining approach A and C belong to the same cluster. This concept is called density connectivity. By this approach, the algorithm performs cluster propagation.”</blockquote><p>The key constructs of the DBSCAN algorithm that help it determine the ‘concept of density’ are as follows:</p><p><strong>Epsilon</strong> <strong>ε</strong> (measure): ε<strong> </strong>is the threshold radius distance which determines the neighborhood of a point. If a point is located at a distance less than or equal to ε from another point, it becomes its neighbor, that is, it becomes density reachable to it.</p><p><em>Choice of</em><strong><em> </em></strong><em>ε</em>: The choice of ε is made in a way that the clusters and the outlier data can be segregated perfectly. Too large ε value can cluster the entire data as one cluster and too small value can classify each point as noise. In layman terms, the average distance of each point from its k-nearest neighbors is determined, sorted, and plotted. The point of maximum change (the elbows bend) determines the optimal value of ε.</p><p><strong>Min points m</strong> (measure): It is a threshold number of points present in the ε distance of a data point that dictates the category of that data point. It is driven by the number of dimensions present.</p><p><em>Choice of Min points: </em>Minimum value of Min points has to be 3. Larger density and dimensionality means larger value should be chosen. The formula to be used while assigning value to Min points is: <em>Min points&gt;= Dimensionality + 1</em></p><p><strong>Core points </strong>(data points): A point is a core point if it has at least <em>m</em> number of points within radii of <em>ε</em> distance from it.</p><p><strong>Border points</strong> (data points): A point that doesn’t qualify as a core point but is a neighbor of a core point.</p><p><strong>Noise points</strong> (data points): An outlier point that doesn’t fulfill any of the above-given criteria.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*Js9HtvQ-d6hkms5fMIrTjQ.png" /></figure><p><strong>Algorithm:</strong></p><ol><li>Select a value for <em>ε</em> and <em>m</em>.</li><li>Mark all points as outliers.</li><li>For each point, if at least <em>m</em> points are present within its <em>ε</em> distance range:</li></ol><ul><li>Identify it as a core point and mark the point as visited.</li><li>Assign the core point and its density reachable points in one cluster and remove them from the outlier list.</li></ul><p>4. Check for the density connectivity of the clusters. If so, merge the clusters into one.</p><p>5. For points remaining in the outlier list, identify them as noise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*sBMKxJxBhPv0jDMgmjBvHA.png" /><figcaption>Example of cluster formation by DBSCAN</figcaption></figure><p>The time complexity of the DBSCAN lies between O(<em>n</em> log <em>n</em>) (best case scenario) to O(<em>n</em>²) (worst case), depending upon the <em>indexing structure</em>, <strong><em>ε</em>, and <em>m</em> values chosen</strong>.</p><p><strong>Python code:</strong></p><p>As a part of the scikit-learn module, below is the code of DBSCAN with some of the hyperparameters set to the default value:</p><pre><em>class </em>sklearn.cluster.<strong>DBSCAN</strong>(<em>eps=0.5</em>, <em>*</em>, <em>min_samples=5</em>, <em>metric=&#39;euclidean&#39;</em>)</pre><p><em>eps</em> is the epsilon value as already explained.</p><p><em>min_samples </em>is the Min points value.</p><p><em>metric </em>is the process by which distance is calculated in the algorithm. By default, it is Euclidean distance, other than that it can be any user-defined distance function or a ‘precomputed’ distance matrix.</p><p>There are some advanced hyperparameters which will be best discussed in future projects.</p><p><strong>Drawbacks:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*UCSSpKZgSiYsXQVM4HR5pA.png" /></figure><ol><li>For the large differences in densities and unequal density spacing between clusters, DBSCAN shows unimpressive results at times. At times, the dataset may require different ε and ‘Min points’ value, which is not possible with DBSCAN.</li><li>DBSCAN sometimes shows different results on each run for the same dataset. Although rarely so, but it has been termed as non-deterministic.</li><li>DBSCAN faces the curse of dimensionality. It doesn’t work as expected in high dimensional datasets.</li></ol><p>To overcome these, other advanced algorithms have been designed which will be discussed in future blogs.</p><p>Stay tuned. Happy learning :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5e74ca9fcfa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devtorq/dbscan-a-walkthrough-of-a-density-based-clustering-method-b5e74ca9fcfa">DBSCAN — A walkthrough of a density-based clustering method</a> was originally published in <a href="https://medium.com/devtorq">EduTorq Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clustering — Diving deep into K-Means Algorithm]]></title>
            <link>https://medium.com/devtorq/clustering-diving-deep-into-k-means-algorithm-18305a37291?source=rss-7e43c0deda9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/18305a37291</guid>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[k-means]]></category>
            <category><![CDATA[clustering-algorithm]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Hafsa Farooq]]></dc:creator>
            <pubDate>Sun, 19 Jul 2020 10:45:08 GMT</pubDate>
            <atom:updated>2020-08-09T08:39:43.043Z</atom:updated>
            <content:encoded><![CDATA[<h3>Clustering — Diving deep into K-Means Algorithm</h3><p>Clustering comes from the set of unsupervised learning algorithms. The core idea here is to group (partition) the unlabelled data points based on their features, such that data items in one group would have similar properties. Being acquainted with the faintest machine learning concepts, one would know the idea of features and labels. Unsupervised learning works on features, sometimes as a use-case while preprocessing to find labels. You may have at some point come across the computer program asking you to identify cars from buses, cats from dogs, or the likes of this. How you can do it is by your visual capabilities. In the case of the processor, a clustering algorithm is running underneath to identify groups for images based on their features.</p><p>Consider that you have a huge dataset with the features of students for the past ten years of your college. Features can be like marks of different technical and non-technical subjects, annual income, a grading of soft skills, participation in extracurricular activities, and a number of suspensions, whether the person likes tea or coffee and other details. In the data preprocessing step, irrelevant features can be omitted. After applying clustering algorithms, we can obtain a cluster as in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*8pFnTP1ZEK86VNRWLgKX5Q.png" /></figure><p>Now, this can work as target segmentation where we know based on the features which group of students we need to target for skilling programs, which group of students we can recommend for specific internships, etc.</p><p>This was a simple use-case. Another well-known example is that of Google News. After enough verification, extraction and preprocessing (can be TF-IDF, name entity recognition techniques) of various news articles, a cluster of related news articles appears to us whenever we search one particular news, a keyword, etc. Another use-case can be that of color palettes, which groups similar shades of colors under one group, a technique often used in image compression.</p><p>The clustering algorithm can be:</p><p><em>Flat clustering</em>: Algorithms where the value for the number of clusters is decided by the scientist.</p><p><em>Hierarchical clustering</em>: Algorithms with a top-down/ bottom-up approach, where the machine decides the number of clusters.</p><p>Let’s discuss one of the well-known algorithms:</p><h4><strong><em>K-Means clustering :</em></strong></h4><p>K-means clustering is a centroid based algorithm that assigns each point to a certain cluster based on its Euclidean distance. It is an iterative algorithm with two main steps — The assignment step and the update step. Let us have a look at the algorithm:</p><ul><li>K &lt;- Choose the value for the number of clusters.</li><li>Initialization techniques: Select K number of data points as centroids and assign nearest data points to their respective cluster (Forgy method) or assign a cluster randomly to each data point (Random Partition method).</li><li>Using Euclidean distance, recalculate the centroids for data points assigned to each cluster and change the assignment of data points accordingly.</li><li>Iterate till there is no change in the centroids and a balance of cluster is hence met.</li></ul><p>Keep changing the values of K, and using the elbow method finds the best-suited values of K.</p><p><strong><em>Elbow method for choosing the value of K:</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*fh1Kmn2d6qJxmbqu7Ie9RA.png" /></figure><p><em>Key concept</em>: Total within-cluster sum of square (WCSS) or simply the total intra-cluster variation or “inertia” has to be minimized. For calculating total WCSS calculate the sum over the Euclidean distance of all the within-cluster data points from their centroids and divide by the number of data points. With an increase in K, cluster size gets smaller and the points are closer to their respective centroids. So with a K vs. Total WCSS graph will provide an indicator to an appropriate value of K, such that the trade-off of the computation is fair. The knee (or elbow point) is considered to suggest an optimal value of K.</p><p><strong><em>Python code</em></strong>:</p><p>Again being a part of the scikit-learn module, below is the code of K-means with some of the hyperparameters explained:</p><pre>class sklearn.cluster.KMeans( n_clusters = 8, init = &#39;k-means++&#39;, n_init = 10, max_iter = 300, tol = 0.0001,  random_state = None)</pre><p>The already assigned values are the default values.</p><p><em>n_clusters: </em>The number of clusters you want to generate. This means the same number of centroids will be generated by the algorithm.</p><p><em>init: </em>These are the algorithms that specify the choice of centroid initially. Values can be = {‘k-means++’, ‘random’, ndarray, callable}</p><p><em>n__init:</em> Number of times centroids are initialized and the most appropriate centroid set based on convergence is selected.</p><p><em>max__iter: </em>For each time a centroid set is selected, K-means is iterated over max__iter times.</p><p><em>random__state: </em>The number of times we want the machine to initialize with the same centroids.</p><p><em>tol: </em>Controls tolerance with regards to the changes in the within-cluster sum-squared-error of two consecutive iterations to declare convergence.</p><p><strong><em>Drawbacks</em>:</strong></p><ul><li>The number of clusters is to be decided by the scientist.</li><li>The centroid initialization is random and the chances of getting stuck at a local minimum of the cost function are fairly good.</li><li>Different centroid selection will give different clusters.</li><li>K-means doesn’t perform well on data points of varying density and sizes.</li><li>Outliers can stretch the centroids; in fact, outliers are assigned a centroid separately in some cases.</li><li>More dimensionality is a problem with K-means as the concept of convergence of the most suitable set which was dependent upon the distances becomes less distinguishing and more confusing.</li><li>K-means assumes the spherical shape of the cluster and is not good with clusters of complicated geometric shapes.</li><li>K-means is confusing when there are overlapping data points between clusters.</li></ul><p>To overcome these, other advanced algorithms have been designed which will be discussed in future blogs.</p><p>Stay tuned. Happy learning :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18305a37291" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devtorq/clustering-diving-deep-into-k-means-algorithm-18305a37291">Clustering — Diving deep into K-Means Algorithm</a> was originally published in <a href="https://medium.com/devtorq">EduTorq Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>