<?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 Elizabeth Obee on Medium]]></title>
        <description><![CDATA[Stories by Elizabeth Obee on Medium]]></description>
        <link>https://medium.com/@elizabethobee?source=rss-7f2051aeec2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TgQLXDziYfVQym-kAxjRcA.jpeg</url>
            <title>Stories by Elizabeth Obee on Medium</title>
            <link>https://medium.com/@elizabethobee?source=rss-7f2051aeec2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 10:39:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@elizabethobee/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[How I Connected Cursor IDE to Databricks: Methods That Changed My Workflow]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science-collective/how-i-connected-cursor-ide-to-databricks-methods-that-changed-my-workflow-b33a5d066ca4?source=rss-7f2051aeec2------2"><img src="https://cdn-images-1.medium.com/max/2600/1*soxIzj3y809_0Q2bauUGzw.jpeg" width="4032"></a></p><p class="medium-feed-snippet">Cursor opens up new options for utilizing the Databricks platform with AI assistance</p><p class="medium-feed-link"><a href="https://medium.com/data-science-collective/how-i-connected-cursor-ide-to-databricks-methods-that-changed-my-workflow-b33a5d066ca4?source=rss-7f2051aeec2------2">Continue reading on Data Science Collective »</a></p></div>]]></description>
            <link>https://medium.com/data-science-collective/how-i-connected-cursor-ide-to-databricks-methods-that-changed-my-workflow-b33a5d066ca4?source=rss-7f2051aeec2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b33a5d066ca4</guid>
            <category><![CDATA[cursor]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[databricks]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Elizabeth Obee]]></dc:creator>
            <pubDate>Wed, 28 Jan 2026 03:39:09 GMT</pubDate>
            <atom:updated>2026-03-19T12:51:38.426Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Coding Corner: Complex string concatenation]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://elizabethobee.medium.com/code-smells-complex-string-concatenation-95968fb564e7?source=rss-7f2051aeec2------2"><img src="https://cdn-images-1.medium.com/max/2600/1*SdvJP2i3iO0J908KoiRVKw@2x.jpeg" width="4032"></a></p><p class="medium-feed-snippet">How to avoid it and how to use it</p><p class="medium-feed-link"><a href="https://elizabethobee.medium.com/code-smells-complex-string-concatenation-95968fb564e7?source=rss-7f2051aeec2------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://elizabethobee.medium.com/code-smells-complex-string-concatenation-95968fb564e7?source=rss-7f2051aeec2------2</link>
            <guid isPermaLink="false">https://medium.com/p/95968fb564e7</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Elizabeth Obee]]></dc:creator>
            <pubDate>Fri, 19 Sep 2025 02:31:51 GMT</pubDate>
            <atom:updated>2025-11-15T00:54:02.880Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Upgrading Azure Databricks to Unity Catalog]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://elizabethobee.medium.com/upgrading-azure-databricks-to-unity-catalog-d7fb63dcf7e5?source=rss-7f2051aeec2------2"><img src="https://cdn-images-1.medium.com/max/2600/0*bdf9OWwO8UPHQph1" width="3859"></a></p><p class="medium-feed-snippet">A data scientist explores data security and a better way to organize your data in the Databricks platform</p><p class="medium-feed-link"><a href="https://elizabethobee.medium.com/upgrading-azure-databricks-to-unity-catalog-d7fb63dcf7e5?source=rss-7f2051aeec2------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://elizabethobee.medium.com/upgrading-azure-databricks-to-unity-catalog-d7fb63dcf7e5?source=rss-7f2051aeec2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7fb63dcf7e5</guid>
            <category><![CDATA[data-organization]]></category>
            <category><![CDATA[databricks]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[azure-databricks]]></category>
            <category><![CDATA[unity-catalog]]></category>
            <dc:creator><![CDATA[Elizabeth Obee]]></dc:creator>
            <pubDate>Thu, 29 May 2025 18:26:30 GMT</pubDate>
            <atom:updated>2025-05-29T18:26:30.311Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Day in the Life of a Chief Data Officer]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science-collective/a-day-in-the-life-of-a-chief-data-officer-690b6f9cf851?source=rss-7f2051aeec2------2"><img src="https://cdn-images-1.medium.com/max/2600/0*emRcwiwfw-i6_zWK" width="6000"></a></p><p class="medium-feed-snippet">Defining the value of your data</p><p class="medium-feed-link"><a href="https://medium.com/data-science-collective/a-day-in-the-life-of-a-chief-data-officer-690b6f9cf851?source=rss-7f2051aeec2------2">Continue reading on Data Science Collective »</a></p></div>]]></description>
            <link>https://medium.com/data-science-collective/a-day-in-the-life-of-a-chief-data-officer-690b6f9cf851?source=rss-7f2051aeec2------2</link>
            <guid isPermaLink="false">https://medium.com/p/690b6f9cf851</guid>
            <category><![CDATA[data-literacy]]></category>
            <category><![CDATA[chief-data-officer]]></category>
            <category><![CDATA[data-strategy]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Elizabeth Obee]]></dc:creator>
            <pubDate>Fri, 11 Nov 2022 04:21:56 GMT</pubDate>
            <atom:updated>2025-09-23T20:12:42.916Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Using Elasticsearch for anomaly detection in time series]]></title>
            <link>https://elizabethobee.medium.com/using-elasticsearch-for-anomaly-detection-in-time-series-c4bfef8c20d?source=rss-7f2051aeec2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4bfef8c20d</guid>
            <category><![CDATA[anomaly-detection]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[time-series-analysis]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Elizabeth Obee]]></dc:creator>
            <pubDate>Tue, 15 Feb 2022 17:57:44 GMT</pubDate>
            <atom:updated>2022-02-15T17:57:44.332Z</atom:updated>
            <content:encoded><![CDATA[<h4>Low code alerting for unusual events</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*PUQ6iLGgcZ6M3u3fPkpwtQ.png" /></figure><p>I used a 14-day free trial of the Elastic Cloud to try out the anomaly detection capabilities with publicly available data on crime in <a href="https://data.cityofnewyork.us/Public-Safety/NYPD-Arrests-Data-Historic-/8h9b-rp9u">New York City</a>. A dashboard view of this data, containing 5M arrest records from 2006 to 2021 is also available on the <a href="https://data.cityofnewyork.us/Public-Safety/NYPD-Historic-Arrests-Summary-Dashboard/is7e-8exf">NYC Open Data website</a>. I aggregated the frequency of arrests to the day and borough, and loaded it into my Elastic Cloud instance with a machine learning node enabled.</p><p>The Elastic Cloud contains the Elasticsearch 7.16.3 and Kibana products that are customarily used to evaluate time series log data, but can be used with any type of data represented in JSON indexes. Elasticsearch is a search engine based on the Lucene library that was initially open-source with the Apache 2.0 license, and then re-licensed by Elastic NV in early 2021. This license change was related to a <a href="https://venturebeat.com/2021/12/27/elastic-ceo-reflects-on-amazon-spat-license-switch-and-the-principles-of-open-source/">dispute with Amazon</a> that has resulted in the Amazon offering being rebranded as OpenSearch. Over time, the Elastic product and Amazon OpenSearch product can be expected to diverge, but at the moment their capabilities are still pretty similar.</p><p>My Elastic Cloud consisted of multiple instances and zones, including the machine learning node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q1p9eWFZyEiFUqgGiURpGA.png" /></figure><p>In order to load my NOPD arrest data I used the Data Visualizer import menu to create an index, and an index pattern pointing at this index containing my data. This is an alternative to using logstash that can be accessed within the machine learning product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qyt6gy1J6dFGZ03qlypLTQ.png" /></figure><p>The data is processed and schema inferred based upon the data types observed in the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S0dMmxybl45MMXvTJR0oow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2CFu6KP_vFo-9jGJhxamKw.png" /></figure><p>Once my data is loaded I can set up a machine learning job. I pick my time range and the metric I want to track. Also I can specify any influencers that I want to consider when an anomaly is detected. These influencers may help explain what has caused the event or what segment of the data may be associated with the event. A variety of menus are available to set up single metric or multi-metric jobs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G53NzQZGWWFC-0NbYH74vw.png" /></figure><p>I selected a multi-metric job and generated a list of anomalies for a higher than usual frequency of arrests per day. While there are a few anomalies that can be found over time on individual days, the more notable observation is the general decrease in arrest frequency over time. The anomaly detection algorithm identifies trend and seasonality in the data and will account for these patterns when identifying anomalies. It is possible to configure email or other types of alerts to be generated to notify users when anomalies have been detected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7xJsPZdy-I4w2LUjZ4PMkg.png" /></figure><p>While Elasticsearch/Kibana provides a low-code environment for time series anomaly detection, it can be challenging to use. The ability to configure options using the actual GUI menu is somewhat limited, where the Advanced option allows fuller control. The ability to move results from the machine learning job output to a dashboard is also limited.</p><p>One issue with using Elasticsearch/Kibana is that the user persona for the tool is also somewhat inconsistent. The user is someone who desires to use a low-code environment, is capable of evaluating the meaning of anomalies, and is also comfortable reading and editing JSON code, or using “painless code”, to do any data cleaning or feature engineering needed prior to execution of the anomaly detection.</p><p>Additional investment in the product to improve ease of use of the GUI will open up the potential user base for this powerful time series analysis product. Better integration between machine learning components and the end-user dashboards would also be helpful.</p><p>So, what about the crime? It seems like New York City has never been safer. New lows were reached during the early days of the covid pandemic so it seems reasonable to think that crime may go up again as mobility increases. The multi-year trend of decreasing arrests, though, is quite dramatic. If we can assume that arrest rates are a proxy for crime rates, this indicates great progress has been made over time regarding reducing crime in New York City.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4bfef8c20d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Next Generation of AI Technology]]></title>
            <link>https://elizabethobee.medium.com/the-next-generation-of-ai-technology-d245926d6613?source=rss-7f2051aeec2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d245926d6613</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[patents]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Elizabeth Obee]]></dc:creator>
            <pubDate>Sat, 06 Nov 2021 05:35:32 GMT</pubDate>
            <atom:updated>2021-11-17T01:45:02.730Z</atom:updated>
            <content:encoded><![CDATA[<h4>What patent trends can tell us</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wZfMCmmXdGqEPJRP" /><figcaption>Photo by <a href="https://unsplash.com/@possessedphotography?utm_source=medium&amp;utm_medium=referral">Possessed Photography</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Recently, Facebook announced they will delete their facial recognition files and terminate their automatic image recognition program. At the same time, they have rebranded as Meta and plan to focus on virtual reality. This may be somewhat surprising, but not if you consider the <a href="https://www.latimes.com/business/technology/story/2020-01-14/facebook-piling-up-patents-augmented-reality-push">169 patents</a> they had already filed in the Optical Elements category by early 2020, evidence of their commitment to exploring the augmented reality space.</p><p>Apple has been investing in the development of electric vehicles, now you can view a speculative look at what an <a href="https://www.vanarama.com/car-interiors-created-by-tech-giants/#intro">Apple car</a> could look like, based upon a number of patents filed by Apple. Not all patents are intended to be used, some may be filed just to protect a concept from being patented by others. While usage may not be guaranteed, a review of AI patent trends gives some indication about what areas of technology are generating research interest and corporate investment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*oH0b2Y-0Sd6iKxU2p_P45w.png" /><figcaption>Figure from <a href="https://www.uspto.gov/sites/default/files/documents/OCE-DH-AI.pdf">Inventing AI</a></figcaption></figure><p>In my <a href="https://towardsdatascience.com/artificial-intelligence-patent-101-3eebf93f5297">previous article</a> on patents, I searched the patent database for key terms such as “machine learning”, and reviewed the leading companies in select patent categories with a large amount of AI related patents. Around the same time, the US Patent Technology Office released a comprehensive dataset of patents categorized into eight AI component technology areas with significant activity related to artificial intelligence. This data was also summarized in the report <a href="https://www.uspto.gov/sites/default/files/documents/OCE-DH-AI.pdf">Inventing AI</a>, which detailed a comprehensive effort to identify and classify every patent related to AI technology.</p><p>AI patents crop up in a wide variety of patent categories, creating complexity in defining and tracking what AI is. The eight types of AI defined here span across many categories of the official patent classification hierarchy. The AI categories of knowledge processing and planning/control represent the largest amount of activity, but all categories are seeing growth over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*PMnI-OyJ4KFzY3dnmNpH_w.png" /><figcaption>Figure from <a href="https://www.uspto.gov/sites/default/files/documents/OCE-DH-AI.pdf">Inventing AI</a>, frequency of patents by AI category over time</figcaption></figure><p>Every industry is now looking for ways to optimize their processes and increase productivity through the usage of AI. Patent activity for AI inventions is now present in over 40% of patent subclasses. The most frequent assignees continue to be very familiar names, IBM, Microsoft, and Google. By 2018, annual AI patent applications reached more than 60,000 annually, and 2021 is on track to finish with over 100K AI patent applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*RGLjCqq9BA-8-z42I01CWA.png" /><figcaption>Results from Google Patent Search</figcaption></figure><p>Searching for patents, using <a href="https://patents.google.com,/">https://patents.google.com,</a> or another search engine, allows you to examine patents for particular techniques, by certain companies, or for particular inventors. For example, my search for knowledge graphs + fraud, in US patents, indicates the activity of payment processors in patenting technology in this area.</p><h4>Conclusion</h4><p>Review of patents can give insight into how companies are creating their algorithms and logic for core business processes, what they value, who is working on what, and what technology is on the rise.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d245926d6613" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Artificial Intelligence Patent 101]]></title>
            <link>https://medium.com/data-science/artificial-intelligence-patent-101-3eebf93f5297?source=rss-7f2051aeec2------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eebf93f5297</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[patents]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Elizabeth Obee]]></dc:creator>
            <pubDate>Wed, 18 Aug 2021 13:15:57 GMT</pubDate>
            <atom:updated>2021-08-18T13:15:57.584Z</atom:updated>
            <content:encoded><![CDATA[<h4>Who is creating patents and should you get one too?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mEkRAK11KQuyYY4yrvitcA.jpeg" /><figcaption>Angel’s Trumpet, by author</figcaption></figure><h4>Patent Publication Trends</h4><p>Patent publications related to AI and machine learning have continued to increase at a dramatic rate, now reaching close to 100K applications a year at the US Patent Office. Only three years ago the rate was closer to 70K applications a year. Using <strong>patentguru.com</strong>, I reviewed the frequency of U.S. patent publications and patent application publications for the following terms in their title: “machine-learning” or “machine learning” or “data analysis” or “analytics” or “computer program product” or “artificial intelligence” or “data science” or “neural network.” The more general terms of “analytics” and “computer program product” were included as only the patent titles were reviewed not the body of the patent text.</p><p>It is possible a small amount of non-ML/AI patents are included but manual inspection of the resulting patents determined these search terms gave good results. The top assignee for the patents was IBM, followed by Qualcomm, Samsung, Intel, Microsoft, Google, Huawei, and Apple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*Dq_LalloUe7c74nZMqCyiw.png" /></figure><h4>How are Patents Organized?</h4><p>Patents need to be filed into a particular category. These categories were created a long time ago, before computer work products were something that needed a category. For this reason you will find most US Patent Office ML/AI type patents in category G: Physics, but they can be found in any category depending on the domain the invention is applied on.</p><p>A: Human Necessities</p><p>B: Performing Operations, Transporting</p><p>C: Chemistry, Metallurgy</p><p>D: Textiles, Paper</p><p>E: Fixed Constructions</p><p>F: Mechanical Engineering, Lighting, Heating, Weapons</p><p>G: Physics</p><p>H: Electricity</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*Fch767bgvJfw1JA88TwKug.png" /></figure><h4>How to Get More Information On A Particular Class of Patents</h4><p>Within each class there are subclasses, with G06F the most common for the US Patent Office ML/AI patents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*XflJrhnLHtExicl_1U4ZXg.png" /></figure><p>Using <a href="http://www.patbase.com/stats/class.php?ipc=G06N">www.patbase.com</a>, I reviewed information on the category G06N. This is a category where I recently filed a machine learning patent application. The results here are for all patents and applications in the class, not just the machine learning related ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*7EbMygCeKo-wyFh1ah5qZw.png" /><figcaption>PatBase Analytics Results for G06N</figcaption></figure><p>The top assignee for the category of computer systems based on specific computational models is IBM, which has twice the number of patents as the next closest assignees Microsoft, Google, and Samsung. In this evaluation I did not limit to U.S. patents and so you will see the distribution of assignees globally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*sqZfHbLlNfcK-B3fS0pI4w.png" /></figure><p>Many of these applications are for Chinese patents, followed by the United States.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*wxHqwOm-1ZNZW1WqQSE35Q.png" /></figure><p>The number of patent applications in 2020 and 2021 for G06N, across all countries, is experiencing dramatic growth. This is just one of the multiple categories where machine learning and AI patents can be filed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*mpl8td0O7jhSKwriAmId9w.png" /></figure><h4>How do I write a patent of my very own?</h4><p>You don’t. Your patent attorney does it for you. Only a patent attorney or a very dedicated inventor would attempt to write a patent. Your company can hire a patent attorney to help you, if they are dedicated to the concept of patenting their intellectual property and want to protect your project. The cost is not insignificant, and it is entirely possible that your company may prefer to keep your work as a “trade secret” rather than patent it. Assuming your patent is for work associated with an employer, your name will appear on the patent, but the “assignee” of the patent will be your employer.</p><p>Publication of your work, rather than pursuing a patent, is another path that can be taken. This may be preferable if the goal is to establish a reputation as an expert, as well as the dissemination of general knowledge, rather than specific protection of the work.</p><p>In order to proceed with patenting your work, you need to be able to demonstrate that your work is novel, non-obvious, and useful. You should create documents to explain your invention in layman’s terms. It should clearly explain your work, and what aspect of the work you are trying to protect. You are not able to patent abstract concepts, there must be a practical application to your invention. Your attorneys will be able to search for “prior art” to confirm your claims. While you can also search for “prior art”, keep in mind that you are required to disclose any findings that you have from such a search. When the patent is written, it will contain exactly that — “claims”. These claims describe exactly what your invention is composed of and are the most important part of the patent. They will also decide which class and subclass your patent should be submitted to, and the type of patent you will file.</p><p>It can be a bit disorienting to see your invention parsed into legalese that is difficult for even you to understand, and accompanied by unfamiliar diagrams. Apparently this is exactly what the patent office is looking for, so at this point you need to trust your attorneys. You also need to ensure that they have clearly understood your invention as they wrote it up and that the claims do in fact represent what you are trying to patent. Different claims can be associated with different inventors, so this is where you can designate which inventor contributed to the various aspects of the overall invention.</p><h4>Can I make money from my patent?</h4><p>Probably not. Also, your employer will probably not make any money from it either. Patents can be used to increase the intrinsic value of a company, and demonstrate their position as an innovative leader, even where no actual monetary value is associated with a specific patent. Also, the patent protects your product from being patented by someone else. Many patents are filed without a specific plan to monetize the invention being protected.</p><h4>New AI Data From The USPTO</h4><p>The US Patent Office has recently released a dataset of <a href="https://www.uspto.gov/about-us/news-updates/uspto-releases-new-artificial-intelligence-patent-dataset">AI related patents</a>. This dataset was compiled based upon a more comprehensive method of classifying patents than was used in this article. In an upcoming article I will discuss this new data and the related findings released by the patent office.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eebf93f5297" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/artificial-intelligence-patent-101-3eebf93f5297">Artificial Intelligence Patent 101</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Science and AI Books for 2021]]></title>
            <link>https://medium.com/data-science/data-science-and-ai-books-for-2021-b8665856cb9e?source=rss-7f2051aeec2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8665856cb9e</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[business-strategy]]></category>
            <dc:creator><![CDATA[Elizabeth Obee]]></dc:creator>
            <pubDate>Fri, 09 Apr 2021 01:54:52 GMT</pubDate>
            <atom:updated>2021-04-09T05:49:31.942Z</atom:updated>
            <content:encoded><![CDATA[<h4>Recent print publications of interest</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lHsH9wS0dsqkRq1d" /><figcaption>Photo by <a href="https://unsplash.com/@sylviasyang?utm_source=medium&amp;utm_medium=referral">Sylvia Yang</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Here are some of the notable data science publications that are currently available in print form, listed in order of publication. I have found myself using more and more online training resources, blogs, videos, and other sources of information besides printed books for keeping up with industry trends and the need to up-skill in a variety of topics. It seems we aren’t quite ready to give up books yet, and so in some cases, the same content creators have now added print books to their offerings.</p><p>The books below cover topics ranging from mathematics, to business strategy, to model building and implementation, to societal impact of artificial intelligence. They are available on Amazon or can be ordered from your favorite local bookstore. I selected books that had larger number of reviews on Amazon, were published since the beginning of 2020, and covered interesting subjects related to data science, engineering, and AI. They are all also available in digital formats.</p><h4>The Book List</h4><p>Iansiti, Marco, and Karim Lakhani. <em>Competing in the Age of AI: Strategy and Leadership When Algorithms and Networks Run the World.</em> Harvard Business Review Press, 2020.</p><ul><li>This book focuses on the acceleration of data-driven decision making in conjunction with digital transformation of brick-and-mortar business models. This includes AI models as well as the more traditional inventory forecasting that suddenly became mission critical in the age of Covid-19.</li></ul><p>Thompson, John and Douglas Laney. <em>Building Analytics Teams: Harnessing analytics and artificial intelligence for business improvement</em>. Packt Publishing, 2020.</p><ul><li>This book explores the different ways to structure the management of a data science team within the organization, and the various ways that senior management can impact the success of the people and projects. The mindset necessary to succeed with innovation projects is quite different from other business initiatives and requires the right leaders at the top of the chart.</li></ul><p>Deisenroth, Marc Peter. <em>Mathematics for Machine Learning.</em> Cambridge University Press, 2020.</p><ul><li>The title sums it up for this one, if you are unfamiliar with the mathematics behind statistical and machine learning methods and determined to learn, this will help you out with the fundamentals. Topics include linear algebra, calculus, and probability functions underlying linear regression, principal component analysis, gaussian mixture models, and support vector machines.</li></ul><p>Burkov, Andriy. <em>Machine Learning Engineering</em>. True Positive Inc, 2020.</p><ul><li>A guide to practical applied machine learning model development and implementation. Many otherwise good data scientists may lack experience with implementation, or even consider it “out-of-scope” for model developers. The best practices and design principles contained are usually learned on the job through involvement in all phases of the project life cycle. The book is a follow up to The One Hundred Page Machine Learning Book.</li></ul><p>Howard, Jeremy and Sylvain Gugger.<em> Deep Learning for Coders with Fastai and PyTorch: AI Applications Without a PhD. </em>O’Reilly Media, 2020.</p><ul><li>PyTorch is gaining rapidly in popularity for deep learning model development, and this book will get you going with computer vision, NLP and more, using fastai. The book complements their on-line course and code, and has a goal of making building deep learning models achievable by a broader field of practitioners than research scientists.</li></ul><p>Moroney, Laurence. <em>AI and Machine Learning for Coders: A Programmer’s Guide to Artificial Intelligence</em>. O’Reilly Media, 2020.</p><ul><li>An introduction to TensorFlow for images, NLP and more from Google, including sections on TensorFlow Lite for mobile deployments. The book is a good complement to the TensorFlow specialization at Coursera.</li></ul><p>Morales, Miguel. <em>Grokking Deep Reinforcement Learning. </em>Manning Publications, 2020.</p><ul><li>Part of the “Grokking” series — tacking reinforcement learning. The author is affiliated with Georgia Tech and their reinforcement learning course as well as the Udacity nanodegree and now gives this introduction to the application of deep reinforcement learning models. This book is for machine learning modelers who want to add reinforcement learning to their toolkit.</li></ul><p>Lakshmanan, Valliappa, Sara Robinson, and Michale Munn. <em>Machine Learning Design Patterns: Solutions to Common Challenges in Data Preparation, Model Building, and MLOps</em>. O’Reilly Media, 2020.</p><ul><li>If you are not from an engineering background, the concept of machine learning design patterns may be a new one. But it is also a great idea to define common patterns and repeatable solutions, which we are all familiar with if you work with modularized code. Lak is familiar as well from the Google Cloud Platform courses on Coursera, and with his Google coauthors has put out this explanation of best practices and practical solutions.</li></ul><p>Harford, Timothy. <em>The Data Detective: Ten Easy Rules to Make Sense of Statistics</em>. Riverhead Books, 2021.</p><ul><li>From the author of the bestseller The Undercover Economist, we have this explanation of how statistics can help us know what and what not to believe, and how statistics can be a tool to help us understand the world. Our emotional responses to information can bias how we process and respond to inputs, such as dismissing evidence we do not care to hear. This books seems very timely in light of the recent political climate.</li></ul><p>Rochwerger, Alyssa Simpson and Wilson Pang. <em>Real World AI: A Practical Guide for Responsible Machine Learning.</em> Lioncrest Publishing, 2021.</p><ul><li>Real world examples of AI in industry and how it can go wrong, with easy to read and non-technical explanations from technical product leaders. The concepts of bias and responsible usage of AI are parts of data literacy that business leaders will need to master as usage of models becomes more widespread.</li></ul><p>Amos, David, Dan Bader, Joanna Jablonski, and Fletcher Heisler. <em>Python Basics: A Practical Introduction to Python 3</em>. Real Python, 2021.</p><ul><li>A book from the realpython.com team, who also put out popular tutorials for learning python that help beginners get up to speed as quickly as possible.</li></ul><h4>Bonus Book</h4><p>Larson, Erik. <em>The Myth of Artificial Intelligence: Why Computers Can’t Think the Way We Do</em>. Belknap Press, 2021.</p><ul><li>This one is hot off the presses this week! It is a discussion of general human intelligence versus the current state of artificial intelligence, and how progress in a narrowly defined, specialized area (how to play chess) does not necessarily mean we are getting closer to human-like thinking machines. So, take a rain-check on the impending arrival of the robot overlords, that is going to have to wait a while.</li></ul><h4>Summary</h4><p>I hope this inspires you to get reading! Good luck and I hope you enjoy reading one (or more) of these books as you continue your journey in data science and engineering.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8665856cb9e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/data-science-and-ai-books-for-2021-b8665856cb9e">Data Science and AI Books for 2021</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning Model Development and Deployment with MLflow and Scikit-learn Pipelines]]></title>
            <link>https://medium.com/data-science/machine-learning-model-development-and-deployment-with-mlflow-and-scikit-learn-pipelines-f658c39e4d58?source=rss-7f2051aeec2------2</link>
            <guid isPermaLink="false">https://medium.com/p/f658c39e4d58</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[scikit-learn]]></category>
            <category><![CDATA[mlflow]]></category>
            <category><![CDATA[machine-learning-python]]></category>
            <category><![CDATA[pipeline]]></category>
            <dc:creator><![CDATA[Elizabeth Obee]]></dc:creator>
            <pubDate>Mon, 04 Jan 2021 15:44:55 GMT</pubDate>
            <atom:updated>2021-01-04T15:44:55.627Z</atom:updated>
            <content:encoded><![CDATA[<h4>Creating API Deployments From Python Models</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZOPW-A_eGHmOQGi_NXQV7w.jpeg" /><figcaption>Victorian Era Converted Gasolier Chandelier - Image by Author</figcaption></figure><p>The Victorian Gasolier is an example of an industrial gas pipeline terminating in an elegant fixture. Similarly, our machine learning pipeline needs to be functional, compatible with other systems, and attractive for both developers and users. This post contains an example of python machine learning model development using Scikit-learn pipelines and deployment with MLflow. The steps include:</p><ul><li>Utilizing <strong>Scikit-learn</strong> pipeline with custom transformers</li><li>Output of model and custom transformer code to <strong>MLflow</strong> tracking server</li><li>Executing using <strong>ML Project</strong> to link model code to results</li><li>Serving of model from the <strong>MLflow</strong> tracking server via a REST-API</li></ul><p>Why would you want to use this approach? This combination of methods eliminates the need for additional model serving logic, allows traceability to original model development code, incorporates both industry standard and custom code based upon domain knowledge, and allows for easy model deployment.</p><blockquote>AI needs to be customized for your business context. You can’t just download an open-source package and apply it to your problem. — Andrew Ng</blockquote><p>By combining domain knowledge with a reusable code base, we can leverage open source solutions to similar problems and build customized systems.</p><h3>Pipelines</h3><p>Pipelines have a number of advantages.</p><ul><li>Ensuring no leakage of information between test and train data</li><li>Bundling of models with preprocessing steps into a single serialized object instead of multiple steps and outputs</li><li>Allowing for the same data preparation steps to run during development and deployment</li></ul><p>The Scikit-learn pipeline is also compatible with other modeling packages such as Keras and XGBoost.</p><p>For this pipeline we will import the Cleveland Clinic heart disease dataset from the <a href="https://archive.ics.uci.edu/ml/datasets/Heart+Disease">UC Irvine Machine Learning Repository</a>. A very similar dataset is also available on Kaggle. Features related to laboratory and physiological testing include:</p><ul><li>Age of patient</li><li>Sex of patient</li><li>CP — chest pain type</li><li>Trestbps — resting blood pressure</li><li>Chol — serum cholesterol</li><li>FBS — fasting blood sugar</li><li>Restecg — resting electrocardiogram results</li><li>Thalach — maximum heart rate</li><li>Exang — exercise induced angina</li><li>Oldpeak — ST depression induced by exercise</li><li>Slope — slope of the peak exercise ST segment</li><li>CA — number of major vessels colored with flouroscopy</li><li>Thal — type of defect</li><li>Num — diagnosis of heart disease</li></ul><p>Let’s read in the data, set up our target variable, and take a look at the data.</p><pre>import numpy as np<br>import pandas as pd<br>from sklearn.compose import ColumnTransformer<br>from sklearn.pipeline import Pipeline<br>from sklearn.impute import SimpleImputer<br>from sklearn.preprocessing import StandardScaler, OneHotEncoder<br>from sklearn.linear_model import LogisticRegression<br>from sklearn.model_selection import train_test_split<br>from sklearn.metrics import accuracy_score, precision_score, recall_score</pre><pre>import mlflow<br>import mlflow.sklearn<br>from mlflow.models.signature import infer_signature</pre><pre>URL = &#39;https://archive.ics.uci.edu/ml/machine-learning-databases/heart-disease/processed.cleveland.data&#39;</pre><pre>df = pd.read_csv(URL, header=None, names=[&#39;age&#39;,&#39;sex&#39;,&#39;cp&#39;,&#39;trestbps&#39;,&#39;chol&#39;,&#39;fbs&#39;,&#39;restecg&#39;,&#39;thalach&#39;<br>,&#39;exang&#39;,&#39;oldpeak&#39;,&#39;slope&#39;,&#39;ca&#39;,&#39;thal&#39;,&#39;num&#39;])</pre><pre>df[&#39;target&#39;]=np.where(df[&#39;num&#39;] &gt; 0,1,0)</pre><pre>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*amrvpUCI24pbAh2k4qa0ug.png" /></figure><p>In order to demonstrate the use of a custom transformer we will create a new feature based upon the ratio of the resting blood pressure to the maximum blood pressure. This feature will be created as a new class and saved into a separate file so it can be output to the MLflow tracking server to be used during deployment in combination with the saved model.</p><pre>import pandas as pd<br>from sklearn.base import BaseEstimator, TransformerMixin</pre><pre>#Custom Transformer Class<br>class NewFeatureTransformer(BaseEstimator, TransformerMixin):<br>     def fit(self, x, y=None):<br>          return self</pre><pre>     def transform(self, x):<br>          x[&#39;ratio&#39;] = x[&#39;thalach&#39;]/x[&#39;trestbps&#39;]<br>          x=pd.DataFrame(x.loc[:, &#39;ratio&#39;])<br>          return x.values</pre><p>Now, let’s split our data up into train, validation, and test datasets.</p><pre>train, test = train_test_split(df, test_size=0.2)<br>train, val = train_test_split(train, test_size=0.2)</pre><pre>print(len(train), &#39;Train Examples&#39;)<br>print(len(val), &#39;Validation Examples&#39;)<br>print(len(test), &#39;Test Examples&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*GcnJ94DtHIOr2hPNIC2_7w.png" /></figure><p>We are now ready to import our custom class and define the pipeline.</p><pre>from custom_class import NewFeatureTransformer</pre><pre>#Define the Pipeline</pre><pre>numeric_features = [&#39;age&#39;,&#39;trestbps&#39;,&#39;chol&#39;,&#39;thalach&#39;,&#39;oldpeak&#39;]<br>numeric_transformer = Pipeline(steps=[<br>     (&#39;imputer&#39;, SimpleImputer(strategy=&#39;median&#39;)),<br>     (&#39;scaler&#39;, StandardScaler())])</pre><pre>categorical_features = [ &#39;cp&#39;,&#39;restecg&#39;,&#39;ca&#39;,&#39;thal&#39;,&#39;slope&#39;]<br>categorical_transformer = Pipeline(steps=[ <br>     (&#39;imputer&#39;, SimpleImputer(strategy=&#39;constant&#39;,fill_value=0)),<br>     (&#39;onehot&#39;, OneHotEncoder(handle_unknown=&#39;ignore&#39;))])</pre><pre>binary_features = [ &#39;sex&#39;,&#39;fbs&#39;,&#39;exang&#39;]<br>binary_transformer = Pipeline(steps=[<br>     (&#39;imputer&#39;,SimpleImputer(strategy=&#39;constant&#39;,fill_value=0))])</pre><pre>new_features_input =  [ &#39;thalach&#39;,&#39;trestbps&#39;]<br>new_transformer = Pipeline(steps=[<br>     (&#39;new&#39;, NewFeatureTransformer())])</pre><pre>preprocessor = ColumnTransformer(<br>     transformers=[<br>          (&#39;num&#39;, numeric_transformer, numeric_features),<br>          (&#39;cat&#39;, categorical_transformer, categorical_features),<br>          (&#39;binary&#39;, binary_transformer, binary_features),<br>          (&#39;new&#39;, new_transformer, new_features_input)])</pre><pre># Now join together the preprocessing with the classifier.</pre><pre>clf = Pipeline(steps=[(&#39;preprocessor&#39;, preprocessor),<br>     (&#39;classifier&#39;, LogisticRegression())], verbose=True)</pre><pre>#fit the pipeline<br>clf.fit(train, train[&#39;target&#39;].values)</pre><pre>#create predictions for validation data<br>y_pred = clf.predict(val)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*5pf_6573vXAfgqVxjQHtPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*c6sAEeOH6aBdp9V_UtYJLg.png" /></figure><p>Now that we have our pipeline, the next step is to save the resulting model to the MLflow tracking server.</p><h3>MLflow</h3><p>The MLflow Project is a framework-agnostic approach to model tracking and deployment, originally released as open source in July 2018 by Databricks. MLflow is now a member of the <a href="https://www.linuxfoundation.org/press-release/2020/06/the-mlflow-project-joins-linux-foundation/">Linux Foundation</a> as of July 2020. It is also possible to deploy models saved on a MLflow tracking server via Seldon into Kubernetes. This allows the usage of the model tracking functionality of MLflow with the expanded deployment capabilities of Seldon.</p><p>Although MLflow has a scikit-learn “flavor” for models, due to the usage of a custom transformer we will need to instead use the generic “python function flavor”. Usage of MLflow with scikit-learn pipelines allows us to save the model definition and all preprocessing steps and transformations into a single object, plus our custom transformer code. First set up the model output class and the conda environment that is needed to execute the model in the future.</p><pre>class ModelOut (mlflow.pyfunc.PythonModel):<br>     def __init__(self, model):<br>          self.model = model</pre><pre>     def predict (self, context, model_input):<br>          model_input.columns= map(str.lower,model_input.columns)<br>          return self.model.predict_proba(model_input)[:,1]</pre><pre>mlflow_conda={&#39;channels&#39;: [&#39;defaults&#39;],<br>     &#39;name&#39;:&#39;conda&#39;,<br>     &#39;dependencies&#39;: [ &#39;python=3.6&#39;, &#39;pip&#39;,<br>     {&#39;pip&#39;:[&#39;mlflow&#39;,&#39;scikit-learn&#39;,&#39;cloudpickle&#39;,&#39;pandas&#39;,&#39;numpy&#39;]}]}</pre><p>Next we will output the model and some metrics to the tracking server.</p><pre>with mlflow.start_run():<br>     #log metrics<br>     mlflow.log_metric(&quot;accuracy&quot;, accuracy_score( val[&#39;target&#39;].values, y_pred))<br>     mlflow.log_metric(&quot;precison&quot;, precision_score( val[&#39;target&#39;].values, y_pred))<br>     mlflow.log_metric(&quot;recall&quot;, recall_score( val[&#39;target&#39;].values, y_pred))</pre><pre>     # log model<br>     mlflow.pyfunc.log_model(   artifact_path=&quot;model&quot;,<br>          python_model=ModelOut(model=clf,),<br>          code_path=[&#39;custom_class.py&#39;],<br>          conda_env=mlflow_conda)<br>     signature = infer_signature(val, y_pred)</pre><pre>     #print out the active run ID<br>     run = mlflow.active_run()<br>     print(&quot;Active run_id: {}&quot;.format(run.info.run_id))</pre><h3>Execution Using MLflow Project</h3><p>Using MLflow Project and Github, the model saved to the tracking server can be linked to the <a href="https://github.com/elizobee/pipeline_with_mlflow">Github code</a>. You can also use the MLproject file to execute locally. Here is an example of what our very simple MLproject file looks like.</p><pre>name: heartdisease_pipeline_with_mlflow</pre><pre>conda_env: disease_conda.yaml</pre><pre>entry_points:<br>     main:<br>          command: &#39;python pipeline_with_mlflow.py&#39;</pre><p>We can either execute this based upon the conda.yaml file to set up a new conda environment, or execute with the — no-conda option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RDBn036CXMfJJjsjTEwZxg.png" /></figure><p>Now we can review the details of our run_id in the MLflow tracking server, by executing mlflow ui at the anaconda prompt, of our activated environment that contains MLflow. We find the tracking server at http:\\localhost:5000</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1B2iZDFXVSZqWpa_I8PmLw.png" /></figure><h3>Model Serving</h3><p>The model can now be served from the Anaconda prompt.</p><pre>mlflow models serve -m file:C:\Users\Elizabeth\Documents\GitHub\EO\mlruns\0\4c5e296e18174521a470891251eed5ea\artifacts\model\</pre><p>You will get a message, after building a conda environment and activating it, that the model is serving on <a href="http://localhost:5000.">http://localhost:5000.</a> We can now provide data to the model and receive a prediction. We will use python here to demonstrate but this API could also be invoked to score data from a stream.</p><pre>import requests<br>host = &#39;localhost&#39;<br>port = &#39;5000&#39;</pre><pre>url = f&#39;http://{host}:{port}/invocations&#39;</pre><pre>headers = {&#39;Content-Type&#39;: &#39;application/json&#39;,}<br># test contains our data from the original train/valid/test split</pre><pre>http_data = test.to_json(orient=&#39;split&#39;)<br>r = requests.post(url=url, headers=headers, data=http_data)</pre><pre>print(f&#39;Predictions: {r.text}&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M_LyzTmCRuXXcIVrqV_gTw.png" /></figure><h3>Summary</h3><p>Writing python based production ready deployment code for data science models is facilitated by the usage of Scikit-learn pipelines and MLflow model tracking servers. With this method the data scientist can produce an API from a model without additional ETL of an input data stream. This can facilitate deployment and allow software engineers to focus upon infrastructure and systems integration, including continuous integration and delivery instead of maintaining a modeling related code base. It also makes redeployments as easy as referencing a new run_id on the MLFlow tracking server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f658c39e4d58" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/machine-learning-model-development-and-deployment-with-mlflow-and-scikit-learn-pipelines-f658c39e4d58">Machine Learning Model Development and Deployment with MLflow and Scikit-learn Pipelines</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>