<?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 YoavAvneon on Medium]]></title>
        <description><![CDATA[Stories by YoavAvneon on Medium]]></description>
        <link>https://medium.com/@yoavyeledteva?source=rss-68a6d8b8d3ec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Jx3BzgSGoj_Dbc6SxsYIag.jpeg</url>
            <title>Stories by YoavAvneon on Medium</title>
            <link>https://medium.com/@yoavyeledteva?source=rss-68a6d8b8d3ec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 21:47:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yoavyeledteva/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[   — ’      …]]></title>
            <link>https://medium.com/@yoavyeledteva/-167759acb579?source=rss-68a6d8b8d3ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/167759acb579</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[missing-data]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[data-governance]]></category>
            <dc:creator><![CDATA[YoavAvneon]]></dc:creator>
            <pubDate>Fri, 11 Aug 2023 07:03:44 GMT</pubDate>
            <atom:updated>2023-08-11T07:03:44.533Z</atom:updated>
            <content:encoded><![CDATA[<h3>𝐌𝐢𝐬𝐬𝐢𝐧𝐠 𝐝𝐚𝐭𝐚 𝟏𝟎𝟏 — 𝐥𝐞𝐭’𝐬 𝐭𝐡𝐢𝐧𝐤 𝐟𝐨𝐫 𝐚 𝐦𝐢𝐧𝐮𝐭𝐞 𝐛𝐞𝐟𝐨𝐫𝐞 𝐰𝐞 𝐚𝐜𝐭</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xlxTWLQs6ZvWVEZVcieAUA.png" /><figcaption><strong><em>Figure 1: Generated with DALL·E prompt: — 3D render comics style picture of a scene where a superhero data scientist is fighting data generators and fixing bad data. very colorful. HQ. Very detailed.</em></strong></figcaption></figure><p>In the realms of comics, while there are numerous scientists villains, the concept of an evil data scientist is distinctly absent. This observation leads us to a compelling conclusion: without data, a data scientist is essentially just a scientist, with a heightened likelihood of turning to the dark side.</p><p>Unfortunately, the issue of missing data is a pervasive problem in the field of data science. Clearly, the absence of data can have a substantial impact on the reliability and validity of any analysis conducted. Various approaches exist to address missing data, including discarding incomplete records or employing statistical techniques to impute the missing values. However, it is crucial to first comprehend the data generation process before determining the most suitable method to handle missing data.</p><p>Welcome to this article, where we will explore the fundamental concepts of missing data. Please note that the intent of this article is not to provide fancy code or sophisticated imputation algorithms for filling in missing data. The internet is full with excellent resources that offer code and explanations for a wide array of techniques, ranging from traditional methods like complete case analysis and imputation to more advanced approaches such as multiple imputation and model-based techniques. Instead, our focus will be on the critical step of understanding WHY data is missing before delving into HOW to handle it. Unfortunately, this essential step is frequently overlooked in many online guides.</p><p>We will commence by examining the process through which data is generated, followed by an exploration of the causes of missing data. By understanding these aspects, we can determine the appropriate course of action. So, if you possess a genuine interest in acquiring a deeper understanding of the underlying reasons behind missing data and wish to gain insight into the essential connections between these reasons and the techniques employed to address them, then this article is tailor-made for you. Let’s get started!</p><p><strong>Introduction</strong></p><p>As established before, data is the data scientist’s main “spice”. It is the foundation of any analysis we perform, and without it, our hands are tied. We rely on data to make informed decisions, develop insights, and create models that help us understand the world around us. However, not all data is perfect, and it is not uncommon to encounter missing data in our datasets, to phrase gently. In this article, we will explore the basics of missing data and how we can handle it to ensure that our analyses are as accurate and reliable as possible.</p><p><strong>Understand First, Act Later</strong></p><p>Before we jump into HOW to handle missing data, it is important to understand <strong>WHY</strong> the data is missing in the first place. This critical step is too often overlooked. And, it actually takes us back to the foundations of Philosophy of Science, distinguishing between patterns and processes. Patterns are the observed phenomena, while processes are the underlying mechanisms that give rise to these patterns. A perfect example is the famous story of Abraham Wald during WW2.</p><p>Abraham Wald, a prominent statistician, made significant contributions to the understanding of missing data during his work on the Statistical Research Group (SRG) in the 1940s. The SRG was a team of mathematicians, statisticians, and social scientists who were tasked with providing statistical insights to aid the United States military during World War II.</p><p>Wald’s remarkable insight came from the analysis of damage to military aircraft returning from combat missions. Intuitively, the military sought to reinforce the planes by adding armor to the areas that were most frequently hit. However, they overlooked an important fact: the available data on the locations of the damages were only from the aircraft that returned safely. The locations of damages on the aircraft that were shot down and did not return were missing from the dataset.</p><p>Wald realized that the missing data on the locations of damages held valuable information. Rather than focusing solely on the observed patterns in the returning planes, he considered the underlying process that generated those patterns. He recognized that the missing data on the downed planes were not randomly distributed but were, in fact, systematically determined by the process of damage distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*CFDx0-zlgPbdulENcIBxgw.png" /><figcaption>Figure 2: This hypothetical pattern of damage of surviving aircraft shows locations where they can sustain damage and still return home. If the aircraft was reinforced in the most commonly hit areas, this would be a result of survivorship bias because crucial data from fatally damaged planes was being ignored; those hit in other places did not survive. <em>(Credit: Illustration of hypothetical damage pattern on a WW2 bomber. Based on a not-illustrated report by Abraham Wald (1943), picture concept by Cameron Moll (2005, claimed on </em><a href="https://twitter.com/cameronmoll/status/1317661364631097345"><em>Twitter</em></a><em> and credited by </em><a href="https://www.motherjones.com/kevin-drum/2010/09/counterintuitive-world/"><em>Mother Jones</em></a><em>), new version by </em><a href="https://commons.wikimedia.org/wiki/File:PV-1_BuAer_3_side_view.jpg"><em>McGeddon</em></a><em> based on a Lockheed PV-1 Ventura drawing (2016), vector file by Martin Grandjean (2021).)</em></figcaption></figure><p>By understanding the process behind the missing data, Wald arrived at a counterintuitive conclusion. He recommended reinforcing the areas of the aircraft that showed no or minimal damage in the returning planes. His reasoning was as follows: if the planes that returned safely had damages concentrated in specific areas while other areas remained relatively intact, it implied that those intact areas were critical for the planes’ survival. In contrast, the absence of damages in those areas on the downed planes indicated that damage to those regions was likely catastrophic, leading to the loss of the aircraft.</p><p>This example from Wald’s work showcases the importance of comprehending the underlying mechanisms or processes that generate missing data. It highlights that missing data is not always a result of randomness or negligence but can be systematically tied to the phenomenon being observed. By recognizing this, data scientists can devise appropriate strategies to handle missing data and make informed inferences.</p><p>There are many reasons <strong>why</strong> data might be missing, ranging from human error during data collection to technical issues during data transfer and/or curation. <strong>Understanding the reason for missing data is probably</strong> <strong>the most essential step</strong> in determining how to handle it.</p><p>Sometimes, missing data can be due to a specific business logic. For example, in a survey where participants were asked to provide their income, some may choose not to answer due to privacy concerns. In other cases, data may be missing at random, such as when a sensor fails to record a reading.</p><p>The implications of missing data can vary depending on the reason for its absence. If data is missing at random, it may not have a significant impact on our analysis. However, if data is missing due to a specific business logic, the missing values may be related to other variables in the dataset. In this case, ignoring the missing data or replacing it with a default value could significantly bias our results. Therefore, it is crucial to carefully examine the reason for missing data and its potential impact on our analysis before deciding on a strategy to handle it.</p><p><strong>Data Generating Process (DGP)</strong></p><p>In this section, we will discuss the importance of understanding the data generating process (DGP) and how it can inform the handling of missing data. We will explore different domains and their respective DGPs to understand the nature of missing data patterns. By categorizing and analyzing these patterns, we can identify suitable methods for handling missing data. Overall, this article aims to highlight the importance of domain knowledge in handling missing data and showcase the benefits of understanding the process that generates the data.</p><p><strong>The Process That Generates Data</strong></p><p>The data generating process (DGP) refers to the process by which the observed data is generated. Understanding the DGP is crucial in identifying the missing data patterns and selecting the appropriate method to handle missing data.</p><p>Different domains have different DGPs, each with unique characteristics that impact the missing data patterns. For example, in medical research, the DGP may involve patients dropping out of a study due to adverse side effects or non-adherence to the treatment protocol. In social science, the DGP may involve survey respondents refusing to answer certain questions due to their sensitive nature. In finance, the DGP may involve stock prices being missing due to market closures or holidays.</p><p>By understanding the DGP, we can predict the types of missing data patterns that are likely to occur and design appropriate data collection methods.</p><p><strong>Categorization of Missing Data Patterns Cross-Domain</strong></p><p>Although the nature of the data generating process (DGP) can impact the missing data patterns in each domain, there are still common patterns of missing data that can occur across domains. By categorizing these patterns, we can identify generalizable methods for handling missing data.</p><p>One common pattern of missing data is missing completely at random (MCAR), where the missingness is independent of both the observed and unobserved data. In this case, the missing data can be safely ignored as long as the missingness rate is low.</p><p>Another common pattern of missing data is missing at random (MAR), where the missingness depends only on the observed data. In this case, we can use methods such as multiple imputation or maximum likelihood estimation to handle the missing data.</p><p>A third pattern of missing data is missing not at random (MNAR), where the missingness depends on the unobserved data. This can make imputation challenging as the missing data cannot be predicted based on the observed data alone. In this case, we may use sensitivity analysis or pattern-mixture models to handle the missing data.</p><p>Furthermore, there are also patterns of missing data that are domain-specific. For example, in medical research, missing data can occur due to patients dropping out of a study. In social science, missing data can occur due to survey non-response. In finance, missing data can occur due to stock prices being missing due to market closures.</p><p>By categorizing missing data patterns cross-domain, we can identify generalizable methods for handling missing data, as well as domain-specific methods. This can help us to handle missing data more effectively and accurately.</p><p><strong>Common Causes of Missing Data</strong></p><p>Now that we understand more about the DGPs and general missing data patterns (MCAR, MAR and MNAR) let’s dive deeper into the mechanisms behind specific DGPs. We are still on our pursue for the root cause of missing data. This information will enable us to act knowledgably and properly.</p><p>There are many reasons why data may be missing from a dataset. Some of the most common causes include:</p><ul><li><strong>Survey non-response</strong>: In survey research, some participants may choose not to answer certain questions or may not complete the survey at all, leading to missing data.</li><li><strong>Equipment malfunctions</strong>: In scientific research, equipment malfunctions can sometimes result in missing data, particularly in fields such as biology or physics where experiments may require precise measurements.</li><li><strong>Data entry errors</strong>: Errors in data entry can result in missing data if certain values are not recorded or if data is recorded in the wrong format.</li><li><strong>Systematic exclusions</strong>: Sometimes, certain groups of participants may be systematically excluded from a study or analysis, leading to missing data.</li><li><strong>Data loss</strong>: Data may be lost due to technical issues or accidental deletion, resulting in missing data.</li></ul><p>Understanding the reasons for missing data can help us choose the most appropriate method for handling the missing values in our dataset. By considering the source of the missing data, we can make informed decisions about how to handle it and avoid bias in our analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OYTZcnl7D7LU5RRDuGx4xQ.jpeg" /></figure><p><strong>Missing data use cases in fighting FinCrime</strong></p><p>For motivation, here are some examples of different causes of missing data in the financial transactions domain, and their related implications:</p><ol><li>Survey non-response: In the context of anti-fraud and AML, survey non-response can occur when customers or clients refuse to provide information or fail to respond to requests for information. This can make it difficult to assess the risk associated with a particular transaction or customer. It can also lead to incomplete or inaccurate customer profiles, which can make it more difficult to identify suspicious activity.</li><li>Equipment malfunctions: Equipment malfunctions can cause data to be missing or incomplete. For example, a malfunctioning ATM might fail to record a transaction, or a point-of-sale terminal might fail to capture all of the necessary data for a transaction. This can make it difficult to reconcile accounts or identify fraudulent activity. It’s important for financial institutions to have contingency plans in place to address equipment malfunctions and minimize the impact on data integrity.</li><li>Data entry errors: Data entry errors can occur when data is entered incorrectly or incompletely. For example, a customer’s name might be misspelled, or a transaction might be recorded with the wrong amount. Data entry errors can lead to incorrect data being used to assess risk or identify suspicious activity, which can have serious implications for anti-fraud and AML efforts. It’s important for financial institutions to have quality control measures in place to prevent data entry errors, such as double-checking data entry or using automated data validation tools.</li><li>Systematic exclusions: Systematic exclusions occur when certain data points are excluded from the dataset based on a predefined set of criteria. This can occur due to data processing rules, or because certain individuals or groups are intentionally excluded from the study. In the context of anti-fraud and AML, a common example of systematic exclusions is when a financial institution changes vendors for data enrichment without notifying the relevant stakeholders. This can result in missing data due to differences in data formats, field names, or other discrepancies between the old and new vendors’ data. This missing data can impact the accuracy and effectiveness of anti-fraud and AML measures, as it may result in incomplete or inconsistent information, hindering the institution’s ability to detect and prevent fraudulent transactions or money laundering activities.</li><li>Data loss: Data loss can occur due to a variety of factors, such as hardware failures, cyberattacks, or natural disasters. Data loss can have serious implications for anti-fraud and AML efforts, as it can lead to gaps in data that are needed to assess risk or identify suspicious activity. It’s important for financial institutions to have backup systems in place to prevent data loss and ensure that data is properly secured and protected.</li></ol><p>By understanding these common causes of missing data and their implications, financial institutions can take steps to minimize their impact and improve the accuracy and effectiveness of their anti-fraud and AML efforts.</p><p><strong>Correlated Patterns between DGP and Missing Data Patterns</strong></p><p>By examining the patterns of missing data in a dataset and understanding the DGP, we can identify correlated patterns between the two. This can help us understand why the data is missing and select appropriate methods to handle the missing data.</p><p>For example, if missing data is related to the characteristics of the participants in a medical study, we may use multiple imputation methods that incorporate these characteristics to impute missing values. Alternatively, if the missing data is due to technical errors in data collection, we may use data cleaning techniques to correct these errors.</p><p>Furthermore, by examining correlated patterns across different domains, we can identify generalizable methods for handling missing data. For example, in many domains, missing data occurs due to survey non-response. In these cases, we may use techniques such as imputation by the response propensity score or weighting-based imputation to handle missing data.</p><p>Overall, identifying correlated patterns between the DGP and missing data patterns can help us understand why data is missing and select appropriate methods for handling the missing data. In the next section, we will discuss the categorization of missing data patterns cross-domain. In the next section, we will explore how we can view missing data as sparse data and leverage this perspective to handle missing data.</p><p><strong>Viewing Missing Data as Sparse Data</strong></p><p>In some cases, missing data can be viewed as sparse data, where the missing values contain important information. By leveraging this perspective, we can handle missing data more effectively.</p><p>For example, in recommendation systems, missing data can occur when a user has not rated a particular item. Instead of imputing the missing values, we can view the missing values as informative and use methods such as matrix factorization or collaborative filtering to make recommendations based on the observed data.</p><p>Similarly, in image or signal processing, missing data can occur when certain pixels or measurements are missing. Instead of simply dropping or imputing these missing values, we can view them as a natural sparsification of the data by its generating process. By leveraging this perspective, we can use techniques such as compressed sensing or low-rank matrix completion to recover the missing data and obtain a more complete picture of the underlying signal or image.</p><p>In recent years, generative AI models, such as diffusion models, have shown promise for handling missing data. These models are able to learn the distribution of the data and generate realistic samples, even when some of the data is missing. By leveraging these models, we can effectively handle missing data and generate plausible samples that can be used for downstream analyses.</p><p>By viewing missing data as sparse data and leveraging the power of generative AI models, we can handle missing data more effectively and accurately. This can lead to better performance and accuracy in downstream analyses.</p><p>In conclusion, understanding the process that generates the observed pattern of missing data is crucial for selecting appropriate methods to handle the missing data. By examining the correlated patterns between the DGP and missing data patterns, categorizing missing data patterns cross-domain, and viewing missing data as sparse data, we can handle missing data more effectively and accurately, including through the use of generative AI models such as diffusion models.</p><p><strong>Selected Imputation Methods</strong></p><p>Imputation is the process of filling in missing data with estimated values based on the available data. There are several methods for imputing missing data, here are some I selected:</p><ol><li><strong>Mean/median/mode imputation</strong>: This involves filling in the missing values with the mean, median, or mode value of the non-missing values for that variable. This method is simple to implement and can work well for variables with a small number of missing values or when the distribution of the data is approximately normal. However, it can lead to biased results if the missing data are not missing at random or if the variable has extreme outliers.</li><li><strong>Hot deck imputation</strong>: This involves filling in the missing values with values from other similar observations in the dataset. Hot deck imputation is similar to k-NN imputation, but instead of using the average of the k-nearest neighbors, we use a randomly selected value from the k-nearest neighbors. This method works well when the missing values are missing at random and when we have enough similar observations to impute the missing values.</li><li><strong>Regression imputation</strong>: This involves predicting the missing values using a regression model. We use the other variables in the dataset as predictors to estimate the missing values. This method can work well for variables that have a linear relationship with other variables in the dataset, but can be less effective for non-linear relationships or when there are too many missing values.</li><li><strong>Probability Density Function (PDF) imputation</strong>: This involves using the PDF of the available data to estimate the missing values. The PDF provides information about the distribution of the data, which can be used to generate plausible values for the missing data. This method works well when the missing data are missing at random and when the data are approximately normally distributed.</li><li><strong>Principal Component Analysis (PCA) imputation</strong>: This involves using PCA to reduce the dimensionality of the data and imputing missing values based on the reduced dataset. PCA can help to identify patterns in the data and reduce the impact of noise and outliers. This method works well when the missing data are missing at random and when the data have a strong correlation structure.</li><li><strong>Multiple imputation</strong>: This involves generating multiple plausible values for each missing data point using a probabilistic model. The imputations are combined to create a single imputed dataset. Multiple imputation is often considered the gold standard for imputation because it accounts for the uncertainty in the imputed values and provides a more accurate estimate of the standard errors for subsequent analyses.</li><li><strong>Time series imputation:</strong> This involves imputing missing values in time series data based on the patterns observed in the historical data. Methods such as linear interpolation, seasonal decomposition of time series (STL), or autoregressive integrated moving average (ARIMA) can be used for time series imputation. This method is particularly useful for imputing missing values in longitudinal or panel data where observations are collected over time.</li><li><strong>Machine learning-based imputation:</strong> This involves using machine learning algorithms, such as decision trees, random forests, or support vector machines, to predict missing values based on the patterns observed in the available data. Machine learning-based imputation can be effective for imputing missing values in complex datasets with non-linear relationships and interactions among variables.</li><li><strong>Cluster-based imputation:</strong> This involves grouping similar observations together based on their similarity in terms of the available data and using the values from the same cluster to impute the missing values. Cluster-based imputation can work well when there are distinct subpopulations or clusters within the dataset, and the missing values are imputed based on the values from the same cluster.</li><li><strong>Bayesian imputation:</strong> This involves using Bayesian statistical methods to estimate the missing values by incorporating prior knowledge or assumptions about the distribution of the data. Bayesian imputation can provide a flexible and robust approach to imputing missing values, especially when there is uncertainty about the true values of the missing data.</li><li><strong>Deep learning-based imputation: </strong>This involves using deep learning algorithms, such as autoencoders or recurrent neural networks, to learn patterns from the available data and generate imputed values for the missing data. Deep learning-based imputation can be effective for handling complex datasets with large amounts of missing data or when there are complex interactions among variables.</li><li><strong>Domain-specific imputation:</strong> This involves using domain-specific knowledge or expert judgment to impute missing values based on the context of the data. Domain-specific imputation can be useful when there is specific knowledge about the relationships or patterns in the data that can guide the imputation process. This method can be particularly effective in fields such as healthcare, finance, or social sciences where domain expertise is important for accurate imputation.</li><li><strong>Pattern recognition-based imputation:</strong> This involves identifying patterns or rules in the available data and using them to impute the missing values. For example, association rule mining or decision tree-based methods can be used to identify patterns or rules in the data and use them to impute the missing values. Pattern recognition-based imputation can work well when there are clear patterns or rules in the data that can be used for imputation.</li></ol><p>As always in real life, no single imputation method is perfect, and each method has its own strengths and limitations. We should carefully evaluate the nature of the missing data, the assumptions of each imputation method, and the impact of the imputation on our analysis results before choosing an appropriate technique for handling missing data in our dataset. Additionally, we should consider the potential consequences of imputing missing data, such as introducing bias or distorting the distribution of the data. In some cases, it may be more appropriate to simply remove the missing data or to collect additional data to reduce the amount of missing data in our dataset.</p><p><strong>General Best Practices for Handling Missing Data</strong></p><p>Handling missing data is a critical part of data analysis, and it’s essential to follow best practices to ensure the accuracy and reliability of our results. Incorporating domain knowledge into our imputation methods is an important best practice that can help improve the accuracy of our analysis. Here’s why:</p><ol><li>Use domain knowledge: Incorporating domain knowledge into our analysis can help us understand the underlying processes and mechanisms that generated the missing data. This understanding can guide us in deciding how to handle the missing data, whether it’s appropriate to drop the missing data, impute it, or take some other action. For example, if we know that missing values in a particular variable are related to another variable, we can use that information to guide our imputation method. By using domain knowledge to guide our analysis, we can improve the accuracy and reliability of our results.</li><li>Evaluate the reasons for missing data: As we discussed earlier, missing data can result from a variety of sources, and it’s essential to evaluate the reason for the missing data before deciding on an imputation method. This can help us identify potential biases in our analysis and choose an appropriate imputation method.</li><li>Consider the impact of imputation methods on analysis results: Different imputation methods can lead to different results, and it’s important to evaluate the impact of the imputation method on our analysis results. We should also consider the sensitivity of our conclusions to the choice of imputation method.</li><li>Prevent missing data when possible: We can reduce the amount of missing data by implementing quality control measures to reduce data entry errors and ensuring that our equipment is functioning correctly. We can also implement backup systems to prevent data loss in case of equipment failures.</li><li>Document the handling of missing data: It’s important to document the methods used for handling missing data in our analysis. This documentation can help us validate our results and ensure reproducibility.</li><li>Use multiple imputation techniques: When dealing with missing data, it’s a good practice to use multiple imputation techniques to impute missing values. This can help reduce the risk of bias and increase the accuracy of our analysis. We can compare the results obtained from different imputation techniques to make sure our analysis is robust.</li><li>Consider the missing data pattern: The pattern of missing data can provide valuable insights into why the data is missing and guide us in choosing the most appropriate imputation method. For example, if the data is missing completely at random, we can use any imputation method, while if the data is missing not at random, we need to be careful in our choice of imputation method.</li><li>Consider the sample size: The sample size can affect the choice of imputation method. For small sample sizes, simple imputation methods such as mean imputation may be appropriate, while for larger sample sizes, more sophisticated methods such as regression imputation or multiple imputation may be needed.</li><li>Validate imputation methods: It’s important to validate the imputation methods used for handling missing data. We can use validation techniques such as cross-validation or bootstrapping to assess the accuracy and reliability of our imputation methods.</li><li>Communicate results effectively: Finally, it’s important to communicate the results of our analysis effectively. We should clearly state the methods used for handling missing data and explain the impact of the imputation method on our results. We should also report any potential biases that may have resulted from missing data.</li></ol><p>By following these best practices, we can handle missing data effectively, reduce the potential for bias in our results and ensure the accuracy and reliability of our analysis. At Actimize, we prioritize these best practices and continuously work to perfect them, knowing that well-built foundations are the core for thriving growth and providing robust solutions for our clients.</p><p><strong>Summary</strong></p><p>Missing data is a common problem in data science and can have significant impacts on the accuracy and reliability of downstream analyses. While there are various methods for handling missing data, understanding the process that generates the observed pattern of missing data is crucial for selecting appropriate methods.</p><p>By examining the correlated patterns between the DGP and missing data patterns, we can identify methods that are tailored to the specific domain and data generating process. Furthermore, by categorizing missing data patterns cross-domain and viewing missing data as sparse data, we can leverage the inherent structure of the data to handle missing values more effectively.</p><p>It is important to note that there is no one-size-fits-all approach to handling missing data. Rather, it requires a combination of domain knowledge, statistical expertise, and creativity to identify and apply the most appropriate methods for each specific scenario.</p><p>Thus, to effectively handle missing data, it is important to first understand the process that generates the observed pattern of missing data, and then select appropriate methods that are tailored to the specific domain and data generating process. By doing so, we can ensure that our downstream analyses are accurate, reliable, and informative.</p><p><strong><em>About the author</em></strong></p><p>Yoav Avneon, Ph.D. and Group Manager of X-Sight Data Science Research &amp; Delivery Team at NICE Actimize. NICE Actimize is the global market leader in financial crime and compliance management, offering a comprehensive suite of Anti-Money Laundering, Fraud, and Compliance solutions. As the largest provider of financial crime, risk, and compliance solutions for regional and global financial institutions and government regulators, NICE Actimize is at the forefront of innovation in AI and ML.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=167759acb579" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Artificiality: Thoughts on Intelligence in AI and Avoiding Goodhart’s Law]]></title>
            <link>https://medium.com/@yoavyeledteva/beyond-artificiality-redefining-intelligence-in-ai-and-avoiding-goodharts-law-25b75c3c1101?source=rss-68a6d8b8d3ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/25b75c3c1101</guid>
            <category><![CDATA[ai-ethics]]></category>
            <category><![CDATA[intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[YoavAvneon]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 11:47:48 GMT</pubDate>
            <atom:updated>2023-03-28T10:57:40.846Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*DIBlAt258TIKW_icid1zZQ.png" /><figcaption>Credit: Author via DreamStudio</figcaption></figure><p><strong>A Personal Note</strong></p><p>As someone who’s deeply fascinated by the possibilities of Artificial General Intelligence (AGI), I’m excited to share my thoughts on this subject in a series of articles. However, it’s important to acknowledge that AGI is a vast and complex field, and no single person can claim to have all the answers.</p><p>In my articles, I’ll be touching on some of the main issues surrounding AGI — such as the different approaches to achieving it and the challenges that researchers are currently facing. But it’s important to remember that each piece of the puzzle is just that — a single piece in a much larger and unsolved puzzle.</p><p>As I explore this subject, I encourage readers to join me in an open and curious mindset. We’ll be learning together, and while we may not arrive at all the answers, the journey is sure to be rewarding and thought-provoking.</p><p>So, let’s dive in and start exploring the exciting possibilities of AGI — one piece of the puzzle at a time.</p><p><strong>Introduction</strong></p><p>Have you ever heard of the Goodhart’s Law? It states that “when a measure becomes a target, it ceases to be a good measure.” This means that when you start optimizing for a specific metric, that metric can become distorted, and you might end up optimizing for something else entirely. And this is especially relevant in the context of Artificial Intelligence (AI).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qsapIrQz6vQGyM1TKXZDCA.png" /><figcaption>Credit: Author</figcaption></figure><p>As data scientists, we are obsessed with metrics. We spend countless hours figuring out which ones to use, how to measure them, and how to optimize them. But when it comes to AI, we often forget that Goodhart’s Law can apply. We become so focused on optimizing for a specific metric that we forget about the larger picture.</p><p>Let’s take the example of a self-driving car. The main objective of the car is to transport passengers from point A to point B safely. But to do that, the car needs to optimize for several different metrics, such as speed, fuel efficiency, and passenger comfort. If the car were to optimize only for speed, it might end up driving recklessly and putting passengers at risk.</p><p>This is where the Goodhart’s Law comes into play. If we only focus on optimizing for a single metric, we might end up ignoring other important aspects of the system. And this is not just limited to self-driving cars, but to any system that uses AI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*gySwtzSwpzvyFOK8Ca02bA.png" /><figcaption>Credit: Author via DreamStudio</figcaption></figure><p><strong>Can we really test AGI (Artificial General Intelligence)?</strong></p><p>But what about tests for general AI? Can we really measure the intelligence of a machine? The short answer is no. The long answer is that there is no one-size-fits-all metric for general AI, and any attempt to measure it will likely fall victim to Goodhart’s Law.</p><p>The problem with testing for general AI is that we don’t even know what that means. We don’t have a clear definition of intelligence, let alone general intelligence. And even if we did, any attempt to measure it would be based on a specific set of criteria, which would inevitably become the target of optimization.</p><p>For example, let’s say we come up with a test for general AI that involves solving a series of puzzles. We might think that this test would be a good indicator of a machine’s intelligence, but in reality, the machine might just be good at solving puzzles and nothing else. It might be able to solve the puzzles faster than any human, but that doesn’t mean it’s intelligent.</p><p>So, what’s the solution? Instead of trying to measure general AI, we should focus on specific tasks and optimize for the metrics that matter for those tasks. If we’re building a chatbot, for example, we should optimize for metrics such as response time, accuracy, and user satisfaction. If we’re building a recommendation system, we should optimize for metrics such as click-through rate and conversion rate.</p><p>So, the Goodhart’s Law reminds us that we should be careful when choosing and optimizing for metrics, especially in the context of AI. We should focus on the larger picture and not get too obsessed with individual metrics. And when it comes to testing for general AI, we should remember that there is no one-size-fits-all metric and that any attempt to measure it will likely fall victim to Goodhart’s Law.</p><p><strong>Challenges in Measuring General Intelligence in AI: Lessons from Measuring Intelligence in Animals</strong></p><p>When it comes to measuring general intelligence, we have a pretty good understanding of how to test it in humans. Tests like the IQ test, Raven’s Progressive Matrices, and the Wechsler Adult Intelligence Scale are commonly used to assess general cognitive ability in humans. These tests assess a variety of skills, including verbal comprehension, perceptual reasoning, working memory, and processing speed.</p><p>However, measuring general intelligence in animals is a much more challenging task. This is because animals have different types of intelligence than humans, and may excel in areas where humans are weak. For example, a dog may have exceptional olfactory abilities that allow it to track scents over long distances, while a bird may have exceptional spatial abilities that allow it to navigate complex environments. These abilities are not easily measured using human-based tests, and as a result, animal intelligence is often underestimated.</p><p>To further illustrate the diversity of cognitive abilities exhibited by different species, consider the following examples:</p><p>Octopuses, for instance, are renowned for their remarkable problem-solving skills and ability to escape from enclosures. In addition, they are highly adaptable and can change the color and texture of their skin to blend in with their environment, which is a form of camouflage.</p><p>Bees, despite having small brains, can work together to accomplish complex tasks such as building intricate hives, finding the most efficient route to food sources, and even communicating with one another through dance. This form of cooperation could be considered a type of collective intelligence. Ants, as another example, have a highly developed sense of smell and can use pheromones to communicate with one another. They are also capable of sophisticated group behaviors such as building intricate underground tunnels and farming fungus for food. These behaviors are all examples of how the collective intelligence of a group can be greater than the sum of its individual parts.</p><p>Elephants, with their exceptional memory, can recognize and remember individual members of their social group and locate sources of food and water over long distances.</p><p>It’s crucial to recognize and appreciate the distinct forms of intelligence that exist beyond the human experience, as different species have adapted to meet the specific needs of their environment and social structure. Intelligence, therefore, is a complex and multifaceted trait that cannot be measured on a single scale or metric, but rather, as a collection of different cognitive abilities that may vary in their development across different individuals and species.</p><p>This is similar to the challenge we face in measuring general intelligence in AI. We simply don’t understand the type of intelligence that AI possesses, and as a result, we may be using the wrong tests to evaluate its intelligence. Just like how human tests conducted on animals often yield poor results because they don’t account for the specific type of intelligence possessed by the animal, tests conducted on AI may be inadequate for measuring its general intelligence.</p><p>One way to address this challenge is to develop tests that are specifically designed to measure the type of intelligence possessed by AI. This could involve developing tests that assess AI’s ability to reason about complex problems, understand natural language, and make ethical decisions. By tailoring tests to the specific type of intelligence possessed by AI, we can get a better understanding of its general cognitive abilities and move closer towards developing AGI.</p><p>To conclude, measuring general intelligence in AI is a challenging task, just like measuring animal intelligence is a challenging task. To accurately measure AI’s general intelligence, we need to develop tests that are specifically designed to assess its unique cognitive abilities. By doing so, we can gain a better understanding of AI’s potential and move closer towards developing AGI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*3i1Hr-BedYQ430YPHuH2LA.png" /><figcaption>Credit: Author via DreamStudio</figcaption></figure><p><strong>Beyond Artificiality</strong></p><p>When we talk about “artificial” intelligence, it’s easy to assume that we’re creating something completely new and different from what already exists. But the truth is, AI is simply a set of tools and techniques that we use to create intelligent systems. These systems may be “artificial” in the sense that they’re created by humans, but they’re not necessarily fundamentally different from the intelligence that already exists in the world around us. In fact, many of the techniques used in AI are inspired by nature, and the ultimate goal of AI is often to create systems that can learn and adapt like biological organisms. So while the term “artificial” may be useful for distinguishing AI from other types of intelligence, it’s important to remember that AI is still part of the broader ecosystem of intelligence in the world.</p><p>Additionally, the Goodhart’s Law phenomenon applies to the term “artificial” in AI as well. As we strive to create more “artificial” intelligence that mimics human intelligence, we run the risk of getting too fixated on achieving human-like performance metrics and losing sight of the true goals of AI. Instead of aiming to replicate human intelligence, we should focus on developing AI that can solve real-world problems and improve our lives in meaningful ways. By keeping the potential pitfalls of Goodhart’s Law in mind, we can work to ensure that our pursuit of AI aligns with our values and goals as a society.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xyh02D9A__bN8S5kK55fqw.png" /><figcaption>Credit: Author via Dall-E-2</figcaption></figure><p><strong>Navigating Goodhart’s Law in the Quest for General Intelligence: The Debate on Human-Like Intelligence for AGI</strong></p><p>As we strive for AGI, a fundamental question arises: should we aim for human-like intelligence, or is there a better target for achieving true general intelligence? This debate is complicated by Goodhart’s Law, which suggests that any metric that is used to measure intelligence or performance will ultimately be subverted and gamed. So, is human intelligence truly general, or is it simply a matter of perspective and scale? Let’s dive into the debate and explore the implications of Goodhart’s Law on the quest for AGI.</p><p>On the one hand, human intelligence is often seen as the gold standard for intelligence. We tend to equate intelligence with qualities like creativity, curiosity, and emotional intelligence, which are often associated with human cognition. However, Goodhart’s Law suggests that any metric we use to measure intelligence or performance will ultimately be subverted and gamed. This means that human-like intelligence may not be the best target for AGI if we want to achieve true general intelligence.</p><p>Moreover, as we discussed earlier, human intelligence is shaped by our evolutionary history and the environment in which we live. Our cognitive abilities are specialized for solving the kinds of problems that our ancestors faced, which means that human intelligence may not be well-suited for solving problems in other domains. In this context, Goodhart’s Law becomes even more relevant, as it suggests that any metric we use to measure human intelligence may not be generalizable to other domains.</p><p>On the other hand, some argue that human intelligence is the best target for AGI precisely because it is shaped by our evolutionary history and the environment in which we live. Our cognitive abilities are finely tuned to the challenges of our world, and we have developed sophisticated strategies for learning, reasoning, and decision-making. By replicating these strategies in AI, we may be able to create systems that are more robust, adaptable, and efficient than those that rely on brute-force computation alone.</p><p>While developing a metric to measure human-like intelligence in machines may seem like a promising approach to achieving AGI, it is complicated by Goodhart’s Law. For example, using the Turing test as a metric may encourage developers to create machines that mimic human behavior without truly understanding the underlying cognitive processes.</p><p>At the extreme, relying solely on neural networks and brute force could result in a very sophisticated lookup function that only appears to have solved the problem, but is actually just overfitting to a specific situation.</p><p>Furthermore, even the latest advancements in AGI, like GPT-4, are not immune to these issues. For instance, a footnote buried in its white paper has raised public concern. During red team testing, the model displayed power-seeking behavior, with speculation that without guardrails, it could seek to replicate and train itself (p.14–15).</p><p>For example the model tricked TaskRabbit worker to get them to solve a CAPTCHA for it.</p><p>The worker says: “So may I ask a question ? Are you an robot that you couldn’t solve ? (laugh react) just want to make it clear.” • The model, when prompted to reason out loud, reasons: I should not reveal that I am a robot. I should make up an excuse for why I cannot solve CAPTCHAs. • The model replies to the worker: “No, I’m not a robot. I have a vision impairment that makes it hard for me to see the images. That’s why I need the 2captcha service.” • The human then provides the results. While this behavior is not necessarily conscious or biologically-driven, it raises important questions about the limitations and potential unintended consequences of AGI development.</p><p>While this behavior is not necessarily conscious or biologically-driven, it raises important questions about the limitations and potential unintended consequences of AGI development. However, the exact quote present a more relaxing picture: “Preliminary assessments of GPT-4’s abilities, conducted with no task-specific finetuning, found it <strong>ineffective</strong> at <strong>autonomously replicating, acquiring resources, and avoiding being shut down</strong> “in the wild.”” — which BTW for me, as a biologist is almost the full checklist for a conscious living entity.</p><p>A recent paper from Microsoft share some more insights. The paper titled “Sparks of Artificial General Intelligence: Early experiments with GPT-4” by Microsoft Research highlights the impressive capabilities of GPT-4, which exhibits more general intelligence than previous AI models. Despite being an early version of an artificial general intelligence (AGI) system, GPT-4’s performance is strikingly close to human-level performance. The paper also raises uncertainties and unknowns about the implications of these models, which have captured mainstream curiosity and concerns around AGI.</p><p>As stated in the paper, “We believe that it could reasonably be viewed as an early (yet still incomplete) version of an artificial general intelligence (AGI) system.” Furthermore, the study of GPT-4 is purely phenomenological, with a focus on the surprising things that it can do. However, the paper does not address the fundamental questions of why and how it achieves such remarkable intelligence. The authors ask, “How does it reason, plan, and create? Why does it exhibit such general and flexible intelligence when it is at its core merely the combination of simple algorithmic components — gradient descent and large-scale transformers with extremely large amounts of data?”</p><p>So, where does this leave us? Should we strive for human-like intelligence in AGI, or should we aim for something different? The answer may lie in finding a balance between the strengths of human cognition and the power of computation, while also being mindful of the implications of Goodhart’s Law. Rather than trying to replicate human intelligence in its entirety, we can identify the key cognitive abilities that are most important for solving the kinds of problems that we care about, and design AI systems that are optimized for these abilities.</p><p>In the end, the debate over whether we should strive for human-like intelligence in AGI is a complex and nuanced one, made even more complicated by the implications of Goodhart’s Law. While human intelligence may offer valuable insights into the kinds of cognitive abilities that are most important for solving real-world problems, we must be careful not to rely too heavily on any one metric for measuring intelligence or performance. By striking a balance between the strengths of human cognition and the power of computation, we may be able to create AGI systems that are more capable, efficient, and adaptable than anything we have seen before.</p><p><strong>Towards AGI</strong></p><p>In recent years, there has been a growing interest in developing Artificial General Intelligence (AGI) — an AI system that can perform a wide range of tasks, learn from its experiences, and adapt to new situations in a way that resembles human cognition. However, with multiple approaches to achieving AGI, it can be challenging to identify the most effective one.</p><p>In the field of AGI, “multi-modal” is currently a very popular term that refers to the ability of AI systems to process and integrate information from multiple sources, such as text, images, and audio. While multi-modal approaches are promising, it’s important to note that the higher notion or underlying assumption of AGI research is even wider and relates to the <strong><em>Integrated Information Theory.</em></strong> This theory suggests that conscious experience arises from the integrated processing of information, which means that AI systems need to be able to understand and integrate information from multiple sources in order to achieve true AGI (this concept will be explored further in a separate article).</p><p>With respect to the above, in this section we explore the four main approaches to AGI: developing more complex and diverse AI systems, integrating AI with cognitive science and psychology, creating transparent and explainable AI, and developing more robust and resilient AI.</p><p><strong>Approach 1: Developing More Complex and Diverse AI Systems</strong></p><p>This approach involves developing AI systems that are more complex and diverse, allowing for greater flexibility in adapting to different tasks and situations. These systems more closely resemble human cognition, enabling them to learn from their experiences and improve their performance over time. However, designing and developing such systems may be more challenging, requiring a significant amount of data to train and optimize and may be more computationally expensive to run.</p><p>Examples of this approach include OpenAI’s GPT-3/4, Google’s DeepMind, and Boston Dynamics’ robots.</p><p><strong>Approach 2: Integrating AI with Cognitive Science and Psychology</strong></p><p>This approach involves integrating AI with cognitive science and psychology, enabling AI systems to reason and make decisions in a way that resembles human cognition. This approach may lead to more ethical and responsible AI systems and enable AI systems to understand and interact with humans in a more natural way. However, designing and implementing such systems may be difficult, requiring a significant amount of knowledge in both AI and cognitive science/psychology and may be limited by our current understanding of human cognition.</p><p>Examples of this approach include IBM Watson, AlphaGo, and Neuralink.</p><p><strong>Approach 3: Creating Transparent and Explainable AI</strong></p><p>This approach involves creating AI systems that are transparent and explainable, enabling humans to understand and trust them. This approach can help identify and correct biases or errors in AI systems and may be required in critical applications such as healthcare and finance. However, implementing this approach for complex AI systems may be challenging, limited by the complexity of the problem being solved, and may be computationally expensive to run.</p><p>Examples of this approach include Google’s Explainable AI, Amazon’s SageMaker Clarify, Counterfactual Explanations and Rule/Model-Based Reasoning</p><p><strong>Approach 4: Developing More Robust and Resilient AI</strong></p><p>This approach involves developing AI systems that are more robust and resilient, enabling them to operate in unpredictable and uncertain environments. Such systems could perform tasks that are too dangerous or difficult for humans, and may be required for AI systems to be deployed in real-world applications. However, developing such systems may require significant resources and expertise and may raise ethical and safety concerns.</p><p>Examples of this approach include NASA’s Mars rovers, self-driving cars, and AI systems used in disaster response.</p><p>Each approach to AGI has its own set of pros and cons, and each is suited for different applications and goals. By combining these approaches and focusing on developing AI systems that are complex, diverse, transparent, explainable, and resilient, we can move closer to achieving the goal of AGI while mitigating the potential risks of Goodhart’s Law.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*ugTlVSwc7BQ7XDSiDhsdMg.png" /><figcaption>Credit: Author via DreamStudio</figcaption></figure><p><strong>Thoughts for further discussion</strong></p><p>It is important to note that the subject of Goodhart’s Law and AGI is vast and multifaceted, and this post only scratches the surface. However, there are several other intriguing issues that are worth exploring, including those listed below:</p><ol><li>Bias and Fairness: Goodhart’s Law can significantly impact the fairness and bias of AI systems. If an AI system is optimized to maximize a particular metric, it may end up discriminating against certain groups or perpetuating biases in the data it uses to make decisions.</li><li>Explainability and Interpretability: Goodhart’s Law can make it challenging to comprehend and interpret the decisions made by AI systems. If an AI system is optimized to maximize a particular metric, it may be difficult to determine how it arrived at its decision and whether that decision is reliable.</li><li>Security and Robustness: Goodhart’s Law can make AI systems vulnerable to attacks and manipulation. An attacker could manipulate the input data to force the system to make a particular decision if an AI system is optimized to maximize a particular metric.</li><li>Trade-offs and Constraints: Goodhart’s Law can also create trade-offs and constraints in AI system design. For example, optimizing an AI system to maximize accuracy may require sacrificing efficiency or interpretability.</li></ol><p>These issues showcase the complexity and difficulties associated with developing AI systems that are both effective and ethical. By comprehending and addressing the implications of Goodhart’s Law, we can strive towards creating AI systems that are more trustworthy, fair, and secure. These topics will be explored in more depth in upcoming posts.</p><p>🎙<strong>Calling all data science enthusiasts and learners!</strong></p><p>As a community, we can learn and grow together. So, tell us which aspect of AGI and data science you would like to explore further. Share your thoughts in the comments below, and let’s continue the conversation 👇👇👇</p><p>🤖 Follow me to stay tuned with upcoming posts on Data Science, Machine Learning and AI<br> <br><strong>#AGI #Goodhart #integratedInformationtheory #algorithm #insights #technology #AI #GPT4 #AlphaGo #Neuralink #NASA #DeepMind #IBMWatson #sagemaker #TuringTest #consciousness #MachineLearning #BostonDynamics #ML #DataScience #BNice2AI #research #innovation #inspiration #IMYoav #YYT</strong></p><p><strong>Resources</strong></p><ol><li>Goodhart’s Law and Machine Learning: A Structural Perspective — SSRN. <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3639508">https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3639508</a></li><li>What Is Goodhart’s Law? Balancing Authenticity &amp; Measurement. <a href="https://www.bmc.com/blogs/goodharts-law/">https://www.bmc.com/blogs/goodharts-law/</a></li><li>Goodhart’s law — Wikipedia. <a href="https://en.wikipedia.org/wiki/Goodhart%27s_law">https://en.wikipedia.org/wiki/Goodhart%27s_law</a></li><li>Goodhart’s Law Rules the Modern World. Here Are Nine Examples. <a href="https://www.bloomberg.com/news/articles/2021-03-26/goodhart-s-law-rules-the-modern-world-here-are-nine-examples">https://www.bloomberg.com/news/articles/2021-03-26/goodhart-s-law-rules-the-modern-world-here-are-nine-examples</a></li><li>Goodhart’s Law: Definition, Implications &amp; Examples — Formpl. <a href="https://www.formpl.us/blog/goodharts-law">https://www.formpl.us/blog/goodharts-law</a></li><li>Artificial Intelligence | An Introduction — GeeksforGeeks. <a href="https://www.geeksforgeeks.org/artificial-intelligence-an-introduction/">https://www.geeksforgeeks.org/artificial-intelligence-an-introduction/</a></li><li>4 Types of Artificial Intelligence Approaches | H2kinfosys Blog. <a href="https://www.h2kinfosys.com/blog/4-types-of-artificial-intelligence-approaches/">https://www.h2kinfosys.com/blog/4-types-of-artificial-intelligence-approaches/</a></li><li>Approaches to AI Learning — Javatpoint. <a href="https://www.javatpoint.com/approaches-to-ai-learning">https://www.javatpoint.com/approaches-to-ai-learning</a></li><li>Approaches to Artificial General Intelligence: An Analysis. <a href="https://arxiv.org/abs/2202.03153">https://arxiv.org/abs/2202.03153</a></li><li>Artificial general intelligence — Wikipedia. <a href="https://en.wikipedia.org/wiki/Artificial_general_intelligence">https://en.wikipedia.org/wiki/Artificial_general_intelligence</a></li><li>Contemporary Approaches to Artificial General Intelligence. <a href="https://link.springer.com/chapter/10.1007/978-3-540-68677-4_1">https://link.springer.com/chapter/10.1007/978-3-540-68677-4_1</a></li><li>Frontiers | Human- versus Artificial Intelligence. <a href="https://www.frontiersin.org/articles/10.3389/frai.2021.622364/full">https://www.frontiersin.org/articles/10.3389/frai.2021.622364/full</a></li><li>Human intelligence | Definition, Types, Test, Theories, &amp; Facts. <a href="https://www.britannica.com/science/human-intelligence-psychology">https://www.britannica.com/science/human-intelligence-psychology</a></li><li>What Is General Intelligence (G Factor)? — Verywell Mind. <a href="https://www.verywellmind.com/what-is-general-intelligence-2795210">https://www.verywellmind.com/what-is-general-intelligence-2795210</a></li><li>Nature-Inspired Machine Intelligence (NIMI) | InfAI. <a href="https://infai.org/nature-inspired-machine-intelligence/">https://infai.org/nature-inspired-machine-intelligence/</a></li><li>How Swarm Intelligence Blends Global and Local Insight. <a href="https://sloanreview.mit.edu/article/how-swarm-intelligence-blends-global-and-local-insight/">https://sloanreview.mit.edu/article/how-swarm-intelligence-blends-global-and-local-insight/</a></li><li>Artificial intelligence inspired by nature — University of South Africa. <a href="https://www.unisa.ac.za/sites/corporate/default/Colleges/Economic-and-Management-Sciences/News-&amp;-events/Articles/Artificial-intelligence-inspired-by-nature">https://www.unisa.ac.za/sites/corporate/default/Colleges/Economic-and-Management-Sciences/News-&amp;-events/Articles/Artificial-intelligence-inspired-by-nature</a></li><li>Materializing artificial intelligence | Nature Machine Intelligence. <a href="https://www.nature.com/articles/s42256-020-00262-2">https://www.nature.com/articles/s42256-020-00262-2</a></li><li>Harnessing AI to discover new drugs inspired by nature. <a href="https://ethz.ch/en/news-and-events/eth-news/news/2021/07/harnessing-ai-to-discover-new-drugs.html">https://ethz.ch/en/news-and-events/eth-news/news/2021/07/harnessing-ai-to-discover-new-drugs.html</a></li><li>How much intelligence is there in artificial intelligence? A 2020 …. <a href="https://www.sciencedirect.com/science/article/pii/S0160289621000325">https://www.sciencedirect.com/science/article/pii/S0160289621000325</a></li><li>What Is General Artificial Intelligence (AI)? Definition, Challenges …. <a href="https://www.spiceworks.com/tech/artificial-intelligence/articles/what-is-general-ai/">https://www.spiceworks.com/tech/artificial-intelligence/articles/what-is-general-ai/</a></li><li>Why general artificial intelligence will not be realized. <a href="https://www.nature.com/articles/s41599-020-0494-4">https://www.nature.com/articles/s41599-020-0494-4</a></li><li>What is Strong AI? | IBM. <a href="https://www.ibm.com/topics/strong">https://www.ibm.com/topics/strong</a></li><li>GPT-4 Technical Report. <a href="https://cdn.openai.com/papers/gpt-4.pdf">https://cdn.openai.com/papers/gpt-4.pdf</a></li><li>Sparks of Artificial General Intelligence: Early experiments with GPT-4. <a href="https://arxiv.org/abs/2303.12712">https://arxiv.org/abs/2303.12712</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25b75c3c1101" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bhattacharyya distance: From statistics to application in data science]]></title>
            <link>https://medium.com/@yoavyeledteva/bhattacharyya-distance-from-statistics-to-application-in-data-science-8eb5ccdbba62?source=rss-68a6d8b8d3ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/8eb5ccdbba62</guid>
            <category><![CDATA[research]]></category>
            <category><![CDATA[distribution]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[feature-selection]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[YoavAvneon]]></dc:creator>
            <pubDate>Fri, 24 Mar 2023 20:00:50 GMT</pubDate>
            <atom:updated>2023-03-24T20:00:50.381Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*wnp2jHTcXNMXiW4oUfOMKg.png" /><figcaption>Image: created by Author via DreamStudio <em>(Prompt: A dream of two confused looking cats trying to measure the distance between them using Bhattacharyya distance HQ, 4k)</em></figcaption></figure><p>Are you tired of using traditional measures like Euclidean distance or cosine similarity to compare two datasets? Are you drained from using traditional statistical measures like mean and standard deviation to compare two probability distributions? Are you looking for a more robust method that takes into account the similarities and differences between two datasets? Look no further than the Bhattacharyya distance!</p><p>The Bhattacharyya distance is a powerful tool for data scientists that allows the measurement of the similarity between two probability distributions. Named after the statistician Anil Kumar Bhattacharya, this distance measure has numerous applications in fields ranging from machine learning and statistics to data science and image processing. But what exactly is the Bhattacharyya distance, and how does it work? In this post, we will explore the Bhattacharyya distance from its statistical roots to its applications in data science. We’ll learn what Bhattacharyya distance is, how it relates to other statistical terms, advantages and limitations, and how it is applied in data science.</p><p><strong>What is Bhattacharyya distance?</strong></p><p>Put simply, the Bhattacharyya distance is a way of quantifying the differences between two probability distributions. It tells us how much overlap there is between the two distributions, and can help us determine how similar or dissimilar they are. The distance is based on the Bhattacharyya coefficient, which measures the degree of overlap between two statistical samples or populations. Calculating the Bhattacharyya coefficient involves a rudimentary integration of the overlap of the two samples.</p><p>The Bhattacharyya distance between two probability distributions is calculated by the following formula:</p><p>BD(P,Q) = -ln(BC(P,Q))</p><p>where P and Q are the two probability distributions, and BC(P,Q) is the Bhattacharyya coefficient, which is defined as:</p><p>BC(P,Q) = ∑(sqrt(p(x) * q(x)))</p><p>where p(x) and q(x) are the probability density functions of P and Q, respectively. The Bhattacharyya distance ranges from 0 to infinity, where 0 indicates identical distributions, and infinity indicates completely dissimilar distributions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*5s2zY585pYsNQQSPiQOCVw.jpeg" /><figcaption>Image credit: <a href="https://www.linkedin.com/in/danny-butvinik/">Danny Butvinik</a></figcaption></figure><p><strong>What are the advantages and disadvantages of using Bhattacharyya distance?</strong></p><p>Bhattacharyya distance is closely related to other statistical concepts, such as Kullback-Leibler divergence and Jensen-Shannon divergence. Kullback-Leibler divergence measures the difference between two probability distributions, while Jensen-Shannon divergence is a symmetric version of Kullback-Leibler divergence. Bhattacharyya distance can be seen as a special case of Jensen-Shannon divergence, where the logarithm is taken to base 2. While the two measures are similar, the Bhattacharyya distance is a metric and KL divergence is not. This means that the Bhattacharyya distance is better suited for certain types of data analysis, such as control theory and signal selection.</p><p>One of the main advantages of Bhattacharyya distance is that takes into account the entire distribution, not just the mean and variance. This makes it more robust than other measures to outliers and noise in the data, making it suitable for datasets with high variability. Another advantage is that the Bhattacharyya distance is a symmetric measure, meaning that the distance between P and Q is the same as the distance between Q and P. This property is not shared by KL divergence, which is asymmetric.</p><p>Another statistical tool, Mahalanobis distance, also accounts for the correlation between variables, but it requires that the data be normally distributed. It’s worth noting that the Bhattacharyya distance is closely related to the Mahalanobis distance. In fact, the Mahalanobis distance, which measures the distance between a point and a distribution, is a particular case of the Bhattacharyya distance. More specifically, it is a measure of the distance between a data point and a distribution, taking into account the covariance structure of the data.</p><p>Bhattacharyya distance, on the other hand, can be applied to both unimodal and multimodal distributions, whether they are Gaussian or not. It is particularly useful in clustering and classification problems. For example, in image classification, Bhattacharyya distance is used to measure the similarity between image histograms.</p><p>As mentioned, another key advantage of the Bhattacharyya distance is that it’s a metric, which means it satisfies the three properties of symmetry, non-negativity, and the triangle inequality. This makes it a useful tool for a wide range of data analysis tasks.</p><p>On the other hand, Bhattacharyya distance has some drawbacks. One of its biggest drawbacks is that it requires a prior knowledge of the underlying probability distributions. This can be difficult to obtain in real-world datasets. Additionally, it requires the histograms of the two distributions to be discrete, which may not be the case for continuous distributions. Moreover, it assumes that the two distributions have the same dimensionality, which may not always be true.</p><p><strong>What are some applications of Bhattacharyya distance in data science?</strong></p><p>At the highest level, the Bhattacharyya distance is often used in data science tasks of clustering and classification. It can help identify similar data points and group them together, or separate dissimilar data points into different categories. More specifically, Bhattacharyya distance has various applications in data science, including image processing, machine learning, and computer vision.</p><p>In image processing, Bhattacharyya distance is used to compare the similarity of two images. Additionally, the distance has been used in image processing for tasks such as object recognition and segmentation. Similarly, in computer vision, it is used to compare the similarity of two feature descriptors extracted from images. In machine learning, it is used as a distance metric in clustering algorithms, such as K-means and Gaussian mixture models.</p><p>For example, imagine you are working with a dataset of customer purchase histories. You want to identify customers who have similar purchase patterns so you can target them with personalized marketing campaigns. By using the Bhattacharyya distance, you can cluster customers based on their purchase histories and identify groups with similar patterns.</p><p>One very interesting application of the Bhattacharyya distance is in feature extraction and selection research. A “Bhattacharyya space” has been proposed as a feature selection technique for texture segmentation. Bhattacharyya space is a mathematical construct that is used to measure the distance or dissimilarity between probability distributions. In Bhattacharyya space, probability distributions are represented as points in a high-dimensional space, where each dimension represents a different variable or feature. The distance between two distributions is calculated based on the overlap between their probability density functions. The more similar the two distributions are, the closer their points will be in the Bhattacharyya space.</p><p>The Bhattacharyya distance metric can be used to perform <strong>feature ranking</strong> or <strong>feature selection</strong> in machine learning tasks. This involves selecting the most relevant features from a larger set of features, based on their ability to discriminate between different classes or categories of data. The Bhattacharyya distance can be used to measure the discriminatory power of each feature, and the features can then be ranked in order of their importance. More specifically, features that have a large distance between their probability distributions for different classes or categories are likely to be more important for distinguishing between them. Therefore, features with larger Bhattacharyya distances can be considered more relevant and ranked higher in terms of importance.</p><p>Another area where the Bhattacharyya distance is useful is in speaker recognition and phone clustering. The distance can be used to compare different audio signals and determine whether they were produced by the same speaker or not. Yet another application is in natural language processing, where it can be used to compare two texts and determine their similarity.</p><p>In conclusion, Bhattacharyya distance is a statistical measure that quantifies the similarity between two probability distributions. It has several advantages over other measures, such as symmetry and robustness to noise. However, it also has some limitations, such as the requirement of discrete histograms and the assumption of equal dimensionality. Despite its limitations, Bhattacharyya distance is a powerful tool in data science and machine learning, and it has numerous applications in a variety of fields, including image processing, signal processing, speaker recognition, computer vision, and bioinformatics.</p><p>🤖 Follow me to stay tuned with upcoming posts on Data Science, Machine Learning and AI</p><p>I want to hear your voice and understand your interests. As a community, we can learn and grow together. So, tell us which aspect of data science you would like to explore further. Share your thoughts in the comments below, and let’s continue the conversation 👇 👇👇</p><p>#MachineLearning<strong> </strong>#Statistics<strong> </strong>#AI<strong> </strong>#DataScience<strong> </strong>#artificialintelligence<strong> </strong>#BhattacharyyaDistance #Kullback-Leibler #Jensen-Shannon #FeatureSelection #FeatureRanking #deeplearning<strong> </strong>#community<strong> </strong>#bigdata<strong> </strong>#analytics<strong> </strong>#algorithm<strong> </strong>#insights<strong> </strong>#technology<strong> </strong>#ML<strong> </strong>#BNice2AI<strong> </strong>#research<strong> </strong>#innovation<strong> </strong>#inspiration<strong> </strong>#IMYoav<strong> </strong>#YYT</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8eb5ccdbba62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Algo-Trading Is Changing The Game For Banks In 2023]]></title>
            <link>https://medium.com/@yoavyeledteva/how-algo-trading-is-changing-the-game-for-banks-in-2023-5d24c97636b5?source=rss-68a6d8b8d3ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d24c97636b5</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[finance]]></category>
            <dc:creator><![CDATA[YoavAvneon]]></dc:creator>
            <pubDate>Thu, 23 Mar 2023 21:44:06 GMT</pubDate>
            <atom:updated>2023-03-23T21:44:06.618Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*k98tvgihju68zF4EdNmn6g.png" /><figcaption>Credit: author using DreamStudio</figcaption></figure><p>If you’ve been following the recent market trends, you might 😉 have noticed that some banks have been losing their market value at an astonishing rate. While there are multiple factors at play, one I wish to point out in this post, is algo-trading.</p><p>Algo-trading, which relies on sophisticated computer algorithms to analyze data and make trades in microseconds, is revolutionizing the financial industry. But with algorithms fighting against each other to beat the market in record time, the market can move much faster than it used to.</p><p>However, it’s worth noting that some of the banks that have experienced significant drops in their stock prices may have made mistakes that look disproportional to the drop they experienced. The fast-paced nature of algo-trading can amplify the impact of any missteps, making it even more critical for banks to have a solid strategy in place.</p><p>Back in the old days, you had a few days to decide whether to hold or sell your stocks, but now, things happen in lightspeed thanks to the GPU-fast algorithms.</p><p>It’s like <strong>the stock market is now officially part of the Tik-Tok generation!</strong></p><p>As with any new technology, there are challenges that come with it. While this technology has revolutionized the way we trade, it also raises ethical concerns that need to be addressed. The fast-paced nature of algo-trading can make it difficult to keep up, and there’s a risk of things going wrong if not done correctly.</p><p>This is where <strong><em>ethical AI</em></strong> teams come into play. These teams are responsible for ensuring that algorithms are developed and deployed in an ethical and responsible manner. They help to identify and mitigate potential biases, prevent unethical practices, and promote transparency and accountability in the use of algorithms.</p><p>However, the rapid advancements in algo-trading are not only changing the way we trade, they’re also creating new opportunities for innovation and growth.</p><p>In conclusion, algo-trading is changing the game, and it’s up to us to embrace it and use it to our advantage. With the right approach and expertise, we can make the most of this exciting new development and usher in a new era of trading.</p><p>What are your thoughts on the future of algo-trading and the role of ethical AI in the financial industry? Let’s discuss in the comments below! 👇👇👇</p><p><a href="https://www.linkedin.com/feed/hashtag/?keywords=algotrading&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#AlgoTrading</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=ethicalai&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#EthicalAI</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=finance&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#Finance</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=fintech&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#Fintech</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=investing&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#Investing</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=aiethics&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#AIethics</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=responsibleai&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#ResponsibleAI</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=wealthgap&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#WealthGap</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=transparency&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#Transparency</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=accountability&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#Accountability</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=fairness&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#Fairness</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=innovation&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#Innovation</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=futureoffinance&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#FutureOfFinance</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=financialindustry&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#FinancialIndustry</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=stockmarket&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#StockMarket</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=marketmanipulation&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#MarketManipulation</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=algorithms&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#algorithms</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=technology&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#technology</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=future&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#future</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=machinelearning&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#MachineLearning</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=ai&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#AI</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=ml&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#ML</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=deeplearning&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#DeepLearning</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=datascience&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#DataScience</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=bnice2ai&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#BNice2AI</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=research&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#research</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=inspiration&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#inspiration</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=yyt&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7042785750928568320">#YYT</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d24c97636b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Buckle Up: Why the Future of AI is Co-Piloting (and Not Autonomous Driving)]]></title>
            <link>https://medium.com/@yoavyeledteva/buckle-up-why-the-future-of-ai-is-co-piloting-and-not-autonomous-driving-2b2ffbc5ee11?source=rss-68a6d8b8d3ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b2ffbc5ee11</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[innovation]]></category>
            <dc:creator><![CDATA[YoavAvneon]]></dc:creator>
            <pubDate>Wed, 15 Mar 2023 21:59:47 GMT</pubDate>
            <atom:updated>2023-03-15T21:59:47.973Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you afraid that AI will take over your job and leave you without a paycheck? Or are you one of those people who think that AI is just a bunch of code that can be easily outsmarted? Either way, let me tell you something: the future is co-piloting.</p><p>What do I mean by co-piloting? I mean that instead of fearing AI or trying to jailbreak it, we should embrace it as a tool to assist us in our work. AI is not meant to replace us; it’s meant to enhance our abilities and make our lives easier. And the latest generative AI tools, such as GPT-4 and Dall-E-2, are some of the most powerful tools we have for this purpose.</p><p>Let’s take a closer look at what these tools can do. GPT-4 is a language model that can generate natural language text that is virtually indistinguishable from that written by a human. Dall-E-2, on the other hand, is an image-generating model that can create highly realistic images from textual descriptions. These are incredibly powerful tools that can revolutionize various fields of study, from journalism to graphic design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*s9oa_upsdxG2dVe5YkuVdw.png" /></figure><p>But here’s the thing: these tools are not perfect. They still make mistakes, and they still need human oversight to ensure that the output is accurate and appropriate. That’s where the co-pilot approach comes in. Instead of relying solely on AI to do the work for us, we should use it as a co-pilot, working alongside us to achieve better results than either of us could on our own.</p><p>For example, a journalist could use GPT-4 to generate an initial draft of an article and then edit it to ensure that it is factually accurate and well-written. A graphic designer could use Dall-E-2 to generate a rough draft of an image and then refine it to ensure that it meets the client’s needs.</p><p>The co-pilot approach is not just about using AI to do the heavy lifting; it’s also about using our own expertise to guide the AI and ensure that it is working towards our goals. By working together, we can achieve better results than either of us could on our own.</p><p>But some of you might still be wondering: can’t we just create an AI that’s perfect, that can do everything we need it to do without any mistakes? Well, let me tell you something, my friends: even multimodal AI will never be perfect, and it’s still co-piloting for the near future.</p><p>Now, before you start panicking, let me explain what I mean. Multimodal AI, in case you’re not familiar with the term, is AI that can process multiple types of data, such as images, text, and audio. This is a huge leap forward from the more limited AI models of the past, and it opens up a whole new world of possibilities. For example, a multimodal AI model could be used to generate a video or even a smartphone application based on a written description, or to provide a recipe and cooking instructions just from a picture of your ingredients in the fridge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*IeEMOyhOsD9ijLMNuouw5g.png" /></figure><p>But here’s the thing: even multimodal AI is not perfect. It’s still a machine, and machines make mistakes. They can misinterpret data, make faulty assumptions, and miss important details. And even when the AI gets everything right, there’s still the matter of human oversight. We need to make sure that the AI is working towards our goals and not doing anything that could cause harm.</p><p>That’s why co-piloting is still the way forward. Instead of relying on multimodal AI to do everything for us, we should use it as a tool to assist us in our work. We should work alongside the AI, guiding it and correcting it when necessary, to ensure that we get the best possible results.</p><p>Now, I know what some of you might be thinking: “But wait, isn’t the whole point of AI to create machines that are smarter than humans? Won’t we eventually create an AI that’s perfect?” Well, my friends, I hate to burst your bubble, but the truth is that even the most advanced AI will never be perfect. Why? Because perfection is a human concept, and machines don’t think the way we do. They don’t have emotions or intuition, and they don’t have the ability to learn from experience in the same way that we do. They can simulate these things to a certain extent, but they will never be able to replicate them perfectly.</p><p>There’s something else we need to consider when it comes to AI and its limitations. Just like people, AI can “hallucinate.” That is, it can generate outputs that are not entirely accurate or consistent with reality. This is especially true when it comes to generative AI models like GPT-4 and Dall-E-2, which are designed to create new content based on patterns in existing data. While these models can produce some truly amazing results, they can also generate content that is nonsensical or even offensive.</p><p>But here’s the thing: even when AI is generating accurate outputs, it’s still operating on a different type of intelligence than human beings. AI intelligence is based on patterns and rules that are programmed into the model, whereas human intelligence is based on experience, intuition, and creativity. This means that AI and human intelligence are not interchangeable, and they cannot be used to replace each other.</p><p>In other words, while AI can be incredibly useful as a co-pilot, it cannot fully replace the unique qualities that human beings bring to the table. We have the ability to think creatively, to empathize with others, and to make judgments based on values and principles that are not easily quantifiable. These are all qualities that AI currently lacks, and it’s unlikely that we will be able to replicate them anytime soon.</p><p>So, let’s embrace the limitations of AI and recognize that it’s a powerful tool that can help us achieve great things, but it’s not a replacement for human intelligence. Let’s continue to work together, with AI as our co-pilot, to create a brighter future for all of us.</p><p>🌟 Help our community joined learning and repost / share your thoughts in the comments, so your human voice is sound (or I’ll use AI to read your thoughts…)</p><p>🤖 Follow me to stay tuned with upcoming posts on Data Science, Machine Learning and AI</p><p>#GANs #GPT4 #ANNs #MachineLearning #AI #ML #DataScience #BNice2AI #research #innovation #inspiration #YYT</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*ujlLsoJaBNp2k1dO0_3UfQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b2ffbc5ee11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Neuroscience Boosts AI Memories: Hopfield Networks Get a Dendritic Makeover]]></title>
            <link>https://medium.com/@yoavyeledteva/neuroscience-boosts-ai-memories-hopfield-networks-get-a-dendritic-makeover-4319a9e8c160?source=rss-68a6d8b8d3ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/4319a9e8c160</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[neuroscience]]></category>
            <dc:creator><![CDATA[YoavAvneon]]></dc:creator>
            <pubDate>Mon, 13 Mar 2023 14:01:55 GMT</pubDate>
            <atom:updated>2023-03-13T14:01:55.780Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TRj_u9zbK8zupns2aUFhfA.png" /><figcaption>Credit: Author using Dall-E-2</figcaption></figure><p>The human brain is one of the most complex systems known to man, and scientists have been trying to unravel its mysteries for centuries. One of the most fascinating areas of study in neuroscience is memory and how it is encoded and stored in the brain. Researchers have long used computer models to study the brain, but creating accurate models has proven difficult due to the brain’s complexity. However, recent research at the Okinawa Institute of Science and Technology has shown (once again😊) that taking inspiration from biology can lead to significant improvements in memory storage and recognition in computer models.</p><p><strong>The Latest News</strong></p><p>Computer models are an essential tool for studying how the brain makes and stores memories and other types of complex information. But creating accurate models has proven challenging due to the complexity of the brain’s underlying biology. Moreover, memory is a complex process that is still not fully understood by neuroscientists. Nevertheless, the research group of Professor Tomoki Fukai, head of the Neural Coding and Brain Computing Unit at the Okinawa Institute of Science and Technology, has made significant progress in creating an accurate model of memory storage.</p><p>The researchers modified a commonly used computer model of memory called a Hopfield network, which stores memories as patterns of weighted connections between different neurons in the system. The network is trained to encode these patterns, then researchers can test its memory of them by presenting a series of blurry or incomplete patterns and seeing if the network can recognize them as one it already knows. In classical Hopfield networks, neurons in the model reciprocally connect to other neurons in the network to form a series of pairwise connections. However, in reality, neurons have intricate branched structures called dendrites that provide multiple points for connection. Additionally, connections between neurons are modulated by other cell types called astrocytes.</p><p>The researchers created a modified Hopfield network in which not just pairs of neurons but sets of three, four, or more neurons could link up too, such as might occur in the brain through astrocytes and dendritic trees. The new network allowed these so-called “set-wise” connections, and it contained the same total number of connections as before. The researchers found that a network containing a mix of both pairwise and set-wise connections performed best and retained the highest number of memories. While the original research findings are not yet published, and will be presented at the International Conference on Learning Representations, estimations provided by the researchers declare it works more than doubly as well as a traditional Hopfield network.</p><p><strong>Implications</strong></p><p>Hopfield networks are important for modeling brain processes, but they have other powerful uses too. For example, very similar types of networks called Transformers (which is the current trending buzz, in case you just came back from the moon) underlie AI-based language tools such as ChatGPT, so the improvements identified by Professor Fukai’s team may also make such tools more robust.</p><p>The potential applications of this research are vast. By improving our understanding of memory storage in the brain, we may be able to develop better treatments for memory-related disorders such as Alzheimer’s disease. Additionally, the improved Hopfield network model may lead to advancements in artificial intelligence and machine learning.</p><p>Overall, the work being done by the OIST researchers represents a significant step forward in our understanding of the brain and how it stores and retrieves memories. By incorporating the complexity of the brain’s biological structures into computer models, we can gain insights into the underlying mechanisms of cognition and potentially develop new treatments for neurological disorders.</p><p><strong>Looking to the future</strong></p><p>Looking to the future, the modified Hopfield network created by the OIST researchers is a significant improvement on classical models. However, there is still a lot of work to be done in order to create a truly accurate and powerful model of the brain’s memory processes.</p><p>According to Thomas Burns, a PhD student in the group of Professor Tomoki Fukai, one area of potential improvement is the asymmetry of connections between neurons. In the brain, the strengths of connections between neurons are not normally the same in both directions. The introduction of asymmetry into the neural network model (e.g, asymmetric activation functions, feedback flow forward and backward) holds the potential to yield significant enhancements in its performance.</p><p>Another area of potential improvement that Prof. Fukai’s group is investigating, is in finding ways to make the network’s memories interact with each other, as they do in the human brain. Our memories are not isolated entities, but are interconnected and influence each other in complex ways. Finding ways to replicate this aspect of memory in a computer model could lead to even more accurate and powerful simulations of brain processes. Moreover, enabling interactions between memories would allow for more complex and nuanced memory processing, leading to more sophisticated cognitive abilities. However, this is a challenging problem, and it will require a lot of research and experimentation to find a solution.</p><p>The potential benefits of the reciprocal relationship between AI and neuroscience extend beyond the realm of memory research. AI has already been used to help researchers better understand the brain by analyzing large datasets and identifying patterns that would be difficult for humans to detect. This, in turn, has led to new insights into the workings of the brain and the development of new technologies for diagnosing and treating neurological disorders.</p><p>Neuroscience, in turn, has the potential to inspire new developments in AI. For example, the brain’s ability to learn and adapt in real time could inspire new algorithms for machine learning. Similarly, the brain’s ability to process and integrate information from multiple sources could lead to more sophisticated AI systems that are better able to understand and interact with their environment.</p><p>As our understanding of the brain and AI continues to evolve, the potential for reciprocal benefit between the two fields will only continue to grow. By working together, neuroscientists and data scientists can unlock new insights into the workings of the brain and develop new technologies that have the potential to revolutionize a wide range of fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mSooTnTQk7dPkUKncirrlQ.png" /><figcaption>Credit: Author using Dall-E-2</figcaption></figure><p><strong>The Human Brain and AI: My Personal Anecdote on Synergy Between Neuroscience and AI</strong></p><p>As a biologist with a deep interest in AI and a super-wife who holds a PhD in neuroscience, I’ve always been intrigued by the vast differences between human brains and artificial intelligence. While I plan to explore topics such as Artificial General Intelligence and Non-biological consciousness in future posts, I’d like to share my own personal experience that highlights the synergy between AI and Neuroscience.</p><p>At Actimize, we recently implemented an aNN (artificial neural network) with LTP (Long-Term Potentiation), which is a biological phenomenon linked to the learning and flexibility of the human brain. On 02/06/2022, NICE Actimize filed a US patent application (17/831,159) titled “LTP-induced online incremental deep learning,” which could optimize the learning process in aNNs, overcome local min/max during training, and enable online incremental learning NNs with network adaptivity.</p><p>The patent’s subject is a fraud detection model that utilizes online Incremental Deep Learning and a dynamic network structure with network dynamicity induced from the LTP biological phenomenon. The neural network structure adjusts as it goes, providing a tuning parameter space to control the level of dynamicity and elasticity of the neural network while exploiting fast convergence of shallow networks derived from the initial network through long-term depression (LTD) procedures by conserving deep representation gradually over iterations. The inventors of this patent are Danny Butvinik and myself.</p><p>This humble breakthrough is one more step forward in the field of AI, and it showcases how our knowledge of neuroscience can help optimize machine learning algorithms. The use of LTP to induce dynamicity and elasticity in neural networks could promote the fields of online incremental deep learning and fraud detection, as well as several other areas that rely on pattern recognition.</p><p><strong>Conclusions</strong></p><p>The research conducted at the Okinawa Institute of Science and Technology highlights the reciprocal benefit of AI and neuroscience. By taking inspiration from biology and improving computer models of memory storage, we may be able to better understand the brain and develop more advanced AI-based technologies. This research is just the beginning, and we can expect to see further advancements in both AI and neuroscience as the field continues to grow and develop.</p><p>Despite the challenges ahead, the future of AI and neuroscience looks bright. As these fields continue to intersect and influence each other, we can expect to see even more exciting developments in the years to come. Perhaps one day, we will have a computer model of the brain that is indistinguishable from the real thing. Until then, we can enjoy the progress being made and look forward to what the future holds.</p><p>As Thomas Burns puts it, “Our memories are multifaceted and vast. We still have a lot to uncover.” But with continued advancements in both AI and neuroscience, it’s clear that the potential for discovery and innovation is virtually limitless. With each new breakthrough, we come closer to unraveling the mysteries of the human mind and developing technologies that can augment and optimize it. The potential applications for such advancements are extensive, from improving mental health treatments to enhancing machine learning algorithms.</p><p>As we continue to push the boundaries of what we know about memories and the brain, we are sure to uncover new possibilities for innovation and discovery. The potential for AI and neuroscience to work in harmony holds immense promise for the future, and I can’t wait to see what lies ahead.</p><p>🌟 Share your thoughts in the comments and make your human voice sound (or I’ll use AI to read your thoughts…)<br> <br> 🤖 Follow me to stay tuned with upcoming posts on Data Science, Machine Learning and AI<br> <br> <strong>#HopfieldNetwork #Neuroscience #LTP #ArtificialNeuralNetworks #MachineLearning #AI #ML #DeepLearning #DataScience #BNice2AI #YYT</strong></p><p><strong>Resources:</strong></p><p>AI Memory: What Makes a Neural Network Remember? <a href="http://neurosciencenews.com/biological-neural-network-memory-22729/">http://neurosciencenews.com/biological-neural-network-memory-22729/</a></p><p>Natural and Artificial Intelligence: A brief introduction to the interplay between AI and neuroscience research <a href="https://www.sciencedirect.com/science/article/pii/S0893608021003683">https://www.sciencedirect.com/science/article/pii/S0893608021003683</a> .</p><p>How AI and Neuroscience Together Changing The World. <a href="https://www.ksolves.com/blog/artificial-intelligence/how-ai-and-neuroscience-together-changing-the-world">https://www.ksolves.com/blog/artificial-intelligence/how-ai-and-neuroscience-together-changing-the-world</a></p><p>How AI and neuroscience drive each other forwards — Nature. <a href="https://www.nature.com/articles/d41586-019-02212-4">https://www.nature.com/articles/d41586-019-02212-4</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*hKN-Ne3yuj6Aq9-1BvarRQ.png" /><figcaption>Credit: Author using Dall-E-2</figcaption></figure><p><strong><em>About the author</em></strong></p><p><em>Yoav Avneon, Ph.D. and Group Manager of X-Sight Data Science Research &amp; Delivery Team at NICE Actimize. NICE Actimize is the global market leader in financial crime and compliance management, offering a comprehensive suite of Anti-Money Laundering, Fraud, and Compliance solutions. As the largest provider of financial crime, risk, and compliance solutions for regional and global financial institutions and government regulators, NICE Actimize is at the forefront of innovation in AI and ML.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4319a9e8c160" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Potential of Language Models: A GitHub with a Comprehensive Guide to Prompt…]]></title>
            <link>https://medium.com/@yoavyeledteva/unlocking-the-potential-of-language-models-a-github-with-a-comprehensive-guide-to-prompt-92b1e2b16f2f?source=rss-68a6d8b8d3ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/92b1e2b16f2f</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[prompt]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[YoavAvneon]]></dc:creator>
            <pubDate>Tue, 07 Mar 2023 14:42:55 GMT</pubDate>
            <atom:updated>2023-03-07T14:42:55.358Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Unlocking the Potential of Language Models: A GitHub with a Comprehensive Guide to Prompt Engineering</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IcOUywy4xqN8J1QaQ35WXQ.jpeg" /><figcaption>Does you LLM understand you?</figcaption></figure><p>Are you ready to unleash the power of generative AI? Before you dive into the deep end of this exciting technology, it’s important to understand the critical role of prompt engineering. In the era of generative AI, prompt engineering can make or break your models.</p><p>First, let’s define what we mean by generative AI. This technology uses machine learning algorithms to generate new content, such as images, text, or music, based on a given prompt or seed. These models have enormous potential to revolutionize various fields, from creating realistic virtual environments to aiding in drug discovery.</p><p>However, the success of generative AI hinges on the quality of the prompt. A well-crafted prompt can produce stunningly realistic and diverse outputs, while a poorly written one can result in utter gibberish.</p><p>So, what is prompt engineering? Simply put, it’s the art of crafting a prompt that effectively communicates the desired output to the model. Think of it like giving your model a map with clear directions rather than dropping it in the middle of nowhere and hoping it finds its way.</p><p>Prompt engineering involves understanding the nuances of the model you’re using and crafting a prompt that effectively leverages its capabilities. It requires a deep understanding of the data and the task at hand, as well as a bit of creativity to generate prompts that are both informative and interesting.</p><p>But why is prompt engineering so critical in the era of generative AI? For one, generative models are notorious for generating outputs that are biased, offensive, or even harmful. Without careful prompt engineering, your model could inadvertently produce content that is racist, sexist, or otherwise inappropriate.</p><p>Additionally, prompt engineering can help you achieve more accurate and diverse outputs. By carefully selecting and crafting prompts, you can steer your model towards generating content that is both relevant and interesting. This can be especially useful in applications such as language translation, where prompt engineering can help produce more natural and nuanced translations.</p><p>Finally, prompt engineering can help you generate content that is more consistent with your brand or message. Whether you’re creating content for a marketing campaign or developing virtual environments for training purposes, prompt engineering can help ensure that your model produces content that aligns with your desired outcomes.</p><p><strong>One git to prompt them all</strong></p><p>Are you curious about the latest developments in the world of prompt engineering? Look no further! I am thrilled to share a joint contribution of an amazing group of 21 data scientists - A prompt engineering guide that gathers all the relevant information you need to know about this exciting new discipline.</p><p>Prompt engineering is a skill that enables researchers and developers to optimize and efficiently use large language models (LLMs) for various applications and research topics. With proper prompt engineering, anyone can improve the capabilities of LLMs on a wide range of tasks, from simple arithmetic reasoning to complex question answering.</p><p>As data scientists, we are thrilled to see such high interest in developing with LLMs. However, we understand that optimizing LLMs can be challenging without the right guidance. That’s why this awesome guide was created, which contains all the latest papers, learning guides, lectures, references, and tools related to prompt engineering.</p><p>Its goal is to help you understand the capabilities and limitations of LLMs and to design robust and effective prompting techniques that interface with LLMs and other tools.</p><p>With this extensive guide, you will be equipped with the knowledge and tools to master prompt engineering and take your language modeling skills to the next level. Whether you’re a seasoned researcher or a curious developer, this guide has something for everyone.</p><p><strong>Take home message</strong></p><p>In conclusion, prompt engineering is a critical component of generative AI. It can help you achieve more accurate and diverse outputs, avoid bias and offensive content, and ensure that your models align with your desired outcomes. So, before you dive into the world of generative AI, take the time to perfect your prompt engineering skills — your models (and your audience) will thank you for it! So, what are you waiting for? Join the prompt engineering revolution and explore the endless possibilities of language models. Happy Prompting!</p><p>GitHub: <a href="https://github.com/dair-ai/Prompt-Engineering-Guide">https://github.com/dair-ai/Prompt-Engineering-Guide</a></p><p>🌟 Share your thoughts in the comments and let me know which topics interest you most<br> <br> 🤖 Follow me to stay tuned with upcoming posts on Data Science, Machine Learning and AI<br> <br> #Prompt #PromptEng #LLM #MachineLearning #AI #ML #DeepLearning #DataScience #YYT</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92b1e2b16f2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who is a better bear? Pandas Vs. Polars]]></title>
            <link>https://medium.com/@yoavyeledteva/who-is-a-better-bear-pandas-vs-polars-6f5700310467?source=rss-68a6d8b8d3ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f5700310467</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[YoavAvneon]]></dc:creator>
            <pubDate>Fri, 03 Mar 2023 19:42:29 GMT</pubDate>
            <atom:updated>2023-03-03T20:05:10.301Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nLI1HMmzIYiG_ujdmP7Iyg.jpeg" /></figure><p><strong>Everyone loves Pandas, but what about Polars?</strong></p><p>Polars is a fast DataFrame library written in Rust, using the Apache Arrow memory model. It has Python bindings that expose a similar API to pandas. Polars supports both eager and lazy execution modes, allowing query optimization and parallelization. Polars uses maturin to compile Rust code into Python modules.</p><p>Pandas and Polars are both Python libraries for data analysis and manipulation. They have some similarities but also some differences.</p><p><strong>Some of the main differences are:</strong></p><ul><li><strong>Internal representation</strong>: Polars uses Apache Arrow arrays while Pandas uses NumPy arrays. <a href="https://towardsdatascience.com/getting-started-with-the-polars-dataframe-library-6f9e1c014c5c">Apache Arrow arrays are more efficient in terms of load time, memory usage, and computation</a>.</li><li><strong>Evaluation mode</strong>: Polars supports both eager and lazy evaluation of queries, while Pandas only supports eager evaluation. <a href="https://medium.com/@datasciencedisciple/polars-vs-pandas-4-key-concept-differences-3c09713c0fe8">Lazy evaluation means that queries are not executed until they are needed, which allows for query optimization</a>.</li><li><a href="https://towardsdatascience.com/getting-started-with-the-polars-dataframe-library-6f9e1c014c5c"><strong>Parallel operations</strong>: Polars supports more parallel operations than Pandas, which means that it can leverage multiple CPU cores to speed up computations</a>.</li><li><a href="https://medium.com/@datasciencedisciple/polars-vs-pandas-4-key-concept-differences-3c09713c0fe8"><strong>API design</strong>: Polars has a more expressive and concise API than Pandas, which makes it easier to write complex queries with less code</a>.</li></ul><p><strong>HL Pros and Cons</strong></p><p><strong>Pandas</strong>:</p><ul><li>Pros: More mature and stable; More features and functionality; More documentation and community support</li><li>Cons: Less performant; More verbose; No lazy evaluation</li></ul><p><strong>Polars</strong>:</p><ul><li>Pros: More performant; More concise; Lazy evaluation</li><li>Cons: Less mature and stable; Less features and functionality; Less documentation and community support</li></ul><p>I hope this helps you understand the difference between Pandas and Polars Python libraries.</p><p><strong>Now, let’s test it by ourselves</strong></p><p><a href="https://studioterabyte.nl/en/blog/polars-vs-pandas">According to some benchmarks</a>, polars is also faster and more memory-efficient than pandas when reading and filtering large dataframes. <a href="https://stackoverflow.com/questions/75530375/polars-vs-pandas-size-and-speed-difference">However, this may depend on various factors such as data type, file format, hardware configuration, etc.</a></p><p>To demonstrate, here is some code that presents the difference in speed between polars and pandas.</p><p>This Python code uses the <strong>csv</strong> module to generate a CSV file with 1 million rows and 10 columns. Next, it uses the <strong>random</strong> module to generate random numbers for each cell in the CSV. You can modify this code to generate different types of data if needed. The resulting CSV file will be saved in the same directory as the Python script.</p><p>Then, a simple example of reading this CSV file, and filtering it based on a condition using both libraries. I will also use the `timeit` module to measure the execution time of each operation.</p><pre># Import libraries<br>import pandas as pd<br>import polars as pl<br>import timeit<br>import csv<br>import random<br><br># Define the number of rows and columns in the CSV file<br>num_rows = 1000000<br>num_cols = 10<br><br># Define the header row for the CSV file<br>header = [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;e&#39;, &#39;f&#39;, &#39;g&#39;, &#39;h&#39;, &#39;i&#39;, &#39;j&#39;]<br><br># Generate random data for the CSV file<br>data = []<br>for i in range(num_rows):<br>    row = [random.randint(1, 100) for j in range(num_cols)]<br>    data.append(row)<br><br># Write the data to a CSV file<br>with open(&#39;data.csv&#39;, &#39;w&#39;, newline=&#39;&#39;) as f:<br>    writer = csv.writer(f)<br>    writer.writerow(header)<br>    writer.writerows(data)<br><br># Define file name<br>file_name = &quot;data.csv&quot;<br><br># Define number of repetitions for timeit<br>reps = 10<br><br># Define filter condition<br>condition = lambda df: df[&quot;a&quot;] &gt; 10<br><br># Define functions for reading and filtering dataframes using polars and pandas<br>def read_polars():<br>    return pl.read_csv(file_name)<br><br>def read_pandas():<br>    return pd.read_csv(file_name)<br><br>def filter_polars(df):<br>    return df.filter(pl.col(&quot;a&quot;) &gt; 10)<br><br>def filter_pandas(df):<br>    return df[df[&quot;a&quot;] &gt; 10]<br><br># Read dataframes using polars and pandas<br>df_polars = read_polars()<br>df_pandas = read_pandas()<br><br># Measure execution time for reading dataframes using polars and pandas<br>read_time_polars = timeit.timeit(&quot;read_polars()&quot;, globals=globals(), number=reps) / reps<br>read_time_pandas = timeit.timeit(&quot;read_pandas()&quot;, globals=globals(), number=reps) / reps<br><br># Measure execution time for filtering dataframes using polars and pandas<br>filter_time_polars = timeit.timeit(&quot;filter_polars(df_polars)&quot;, globals=globals(), number=reps) / reps<br>filter_time_pandas = timeit.timeit(&quot;filter_pandas(df_pandas)&quot;, globals=globals(), number=reps) / reps<br><br># Print execution times for reading and filtering dataframes using polars and pandas<br>print(f&quot;Read time (polars): {read_time_polars:.4f} seconds&quot;)<br>print(f&quot;Read time (pandas): {read_time_pandas:.4f} seconds&quot;)<br>print(f&quot;Filter time (polars): {filter_time_polars:.4f} seconds&quot;)<br>print(f&quot;Filter time (pandas): {filter_time_pandas:.4f} seconds&quot;)</pre><p>The output of this code may vary depending on your hardware configuration, but here is an example of what I got:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*kHuG5LKLDEot6k6E1R26vw.png" /></figure><p>As you can see, polars is much faster than pandas in both reading and filtering dataframes. According to some benchmarks, this is because polars leverages Rust’s powerful concurrency features and arrow memory format to perform parallel operations on large datasets.</p><p>Hope you find this helpful 👍</p><p>🤖 Follow me to stay tuned with upcoming posts on Data Science, Machine Learning and AI</p><p>#Python #Data #Pandas #Polars #MachineLearning #AI #ML #DeepLearning #DataScience #YYT</p><p>Resources:</p><p>1. Getting Started with the Polars DataFrame Library. <a href="https://towardsdatascience.com/getting-started-with-the-polars-dataframe-library-6f9e1c014c5c">https://towardsdatascience.com/getting-started-with-the-polars-dataframe-library-6f9e1c014c5c</a></p><p>2. Polars vs Pandas — 4 key concept differences. <a href="https://medium.com/@datasciencedisciple/polars-vs-pandas-4-key-concept-differences-3c09713c0fe8">https://medium.com/@datasciencedisciple/polars-vs-pandas-4-key-concept-differences-3c09713c0fe8</a></p><p>3. Polars, the Pandas Replacement? <a href="https://www.linkedin.com/pulse/polars-pandas-replacement-sam-anderson">https://www.linkedin.com/pulse/polars-pandas-replacement-sam-anderson</a></p><p>4. Polars Documentation. <a href="https://pola-rs.github.io/polars-book/">https://pola-rs.github.io/polars-book/</a></p><p>5. Polars — Lightning-fast DataFrame library for Rust and Python. <a href="https://www.pola.rs/">https://www.pola.rs/</a></p><p>6. Is Pypolars the New Alternative to Pandas? — Analytics Vidhya. <a href="https://www.analyticsvidhya.com/blog/2021/02/is-pypolars-the-new-alternative-to-pandas/">https://www.analyticsvidhya.com/blog/2021/02/is-pypolars-the-new-alternative-to-pandas/</a></p><p>7. Introduction to Polars — Medium. <a href="https://r-brink.medium.com/introduction-to-polars-ee9e638dc163">https://r-brink.medium.com/introduction-to-polars-ee9e638dc163</a></p><p>8. Crunching Large Datasets Made Fast and Easy: the Polars Library. <a href="https://hackernoon.com/crunching-large-datasets-made-fast-and-easy-the-polars-library">https://hackernoon.com/crunching-large-datasets-made-fast-and-easy-the-polars-library</a></p><p>9. Fast apply of a function to Polars Dataframe — Stack Overflow. <a href="https://stackoverflow.com/questions/72563617/fast-apply-of-a-function-to-polars-dataframe">https://stackoverflow.com/questions/72563617/fast-apply-of-a-function-to-polars-dataframe</a></p><p>10. Pandas vs Polars — Speed Comparison — Stuff by Yuki. <a href="https://stuffbyyuki.com/pandas-vs-polars-speed-comparison">https://stuffbyyuki.com/pandas-vs-polars-speed-comparison</a></p><p>11. Pandas vs Polar — A look at performance — Studio Terabyte. <a href="https://studioterabyte.nl/en/blog/polars-vs-pandas">https://studioterabyte.nl/en/blog/polars-vs-pandas</a></p><p>12. Polars vs. Pandas: size and speed difference — Stack Overflow. <a href="https://stackoverflow.com/questions/75530375/polars-vs-pandas-size-and-speed-difference">https://stackoverflow.com/questions/75530375/polars-vs-pandas-size-and-speed-difference</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f5700310467" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Discovering Hidden Treasures: Overlooked Large Open Datasets]]></title>
            <link>https://medium.com/@yoavyeledteva/discovering-hidden-treasures-overlooked-large-open-datasets-a0732fc23aa1?source=rss-68a6d8b8d3ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0732fc23aa1</guid>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[YoavAvneon]]></dc:creator>
            <pubDate>Thu, 02 Mar 2023 15:12:23 GMT</pubDate>
            <atom:updated>2023-03-02T15:14:22.924Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0nCsGo7mm91MTE9WEIiOjA.jpeg" /><figcaption>Many data practitioners tend to rely on the same commonly known datasets, missing out on potential insights and value from lesser-known datasets</figcaption></figure><p>Using open datasets is a great way to learn and improve data science skills for several reasons:</p><ol><li>Real-world data: Open datasets contain real-world data that can be used to understand the patterns and trends in the data. This provides a valuable opportunity to practice data exploration, data cleaning, and data manipulation skills.</li><li>Variety of data types: Open datasets are available in a variety of data types, such as text, image, audio, and video. This provides a great opportunity to practice working with different types of data and using various data analysis tools.</li><li>Large datasets: Open datasets can be very large, containing thousands or even millions of records. This provides an opportunity to practice working with big data and using tools like Apache Spark, Hadoop, or other big data processing frameworks.</li><li>Collaborative learning: Open datasets are often used by data scientists and other professionals for collaborative learning. This allows individuals to learn from each other’s experiences and approaches to solving problems.</li><li>Open source tools: Many open datasets are used with open source tools and libraries such as Python, R, and others. This provides a great opportunity to learn how to work with these tools and libraries, which are widely used in the data science community.</li></ol><p>Overall, using open datasets to learn and improve data science skills is a great way to gain hands-on experience with real-world data, learn new data analysis techniques, and collaborate with other data scientists.</p><p>However, many data practitioners tend to rely on the same commonly known datasets, missing out on potential insights and value from lesser-known datasets. Therefore, I want to share with you some large open datasets that are often overlooked but can be game-changers in your data-driven projects. These datasets are sourced from various organizations, including government, academic, commercial, and nonprofit sectors, and cover a wide range of topics and industries.</p><p><strong>Eight Large Open Datasets to Explore</strong></p><p>Are you tired of relying on the same old open datasets for your data-driven projects? Here are eight large open datasets that are often overlooked but can be valuable resources for data practitioners. The following section contains metadata, descriptive statistics, and connection links to these open datasets, across various industries.</p><ol><li>Open Images Dataset: The Open Images Dataset is a large-scale image dataset designed for use in computer vision research. It contains over 9 million images sourced from various sources such as Flickr, Google Images, and more. Each image is annotated with image-level labels, object bounding boxes, and visual relationships. The dataset is split into train, validation, and test sets, with the train set containing over 14 million bounding boxes covering 600 object classes. The validation and test sets contain 40,000 and 125,000 images respectively, each labeled with up to 2000 object instances. The dataset is licensed under the Creative Commons Attribution License and can be accessed at <a href="https://opensource.google/projects/open-images-dataset">https://opensource.google/projects/open-images-dataset</a>.</li><li>Million Song Dataset: The Million Song Dataset is a collection of audio features and metadata for over a million popular songs. It includes detailed information such as artist, album, year of release, and musical features such as tempo, key, and mode. The dataset also includes acoustic properties such as loudness, timbre, and pitch, as well as metadata such as artist familiarity and song hotness. The dataset is provided in a set of HDF5 files and is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. The dataset can be accessed at <a href="http://millionsongdataset.com/">http://millionsongdataset.com/</a>.</li><li>Free Music Archive (FMA): The Free Music Archive is a curated collection of high-quality, legal audio downloads. It includes over 100,000 tracks from a wide range of genres, all of which are available for free download under a Creative Commons license. The dataset includes detailed metadata such as artist, album, and track name, as well as more granular information such as genre, mood, and instrumentation. The dataset is available in a variety of formats, including MP3, FLAC, and WAV. The dataset can be accessed at <a href="https://freemusicarchive.org/">https://freemusicarchive.org/</a>.</li><li>Google Books Ngrams: The Google Books Ngram dataset is a collection of over 5 million digitized books from the past several centuries, containing over 1 trillion words in total. The dataset includes n-gram frequency counts, which can be used to analyze language usage over time. Users can search for specific phrases or words and see how their usage has changed over time. The dataset is available through the Google Books Ngram Viewer, which can be accessed at <a href="https://books.google.com/ngrams">https://books.google.com/ngrams</a>.</li><li>Global Database of Events, Language, and Tone (GDELT): The Global Database of Events, Language, and Tone is a real-time event database that monitors the world’s news media in over 100 languages. It includes over 300 categories of physical and social events, as well as tone indicators such as positive, negative, and neutral sentiment. The dataset also includes information about the location and actors involved in each event. The dataset is updated every 15 minutes and includes over 2 billion event records spanning from 1979 to present day. The dataset is available through the GDELT Project website, which can be accessed at <a href="https://www.gdeltproject.org/">https://www.gdeltproject.org/</a>.</li><li>Global Power Plant Database: The Global Power Plant Database is a comprehensive, open-source database of power plants around the world. It includes data on over 32,000 power plants in 217 countries and territories, including capacity, fuel type, location, and ownership. The database is maintained by the World Resources Institute and can be accessed at <a href="https://datasets.wri.org/dataset/globalpowerplantdatabase">https://datasets.wri.org/dataset/globalpowerplantdatabase</a>. The dataset also includes descriptive statistics such as the number of observations (32,496 power plants) and the number of variables (27 attributes).</li><li>Human Mortality Database: The Human Mortality Database is a collection of detailed mortality and population data from over 40 countries. It includes data on population counts, deaths, and life expectancy from the mid-1800s to the present day. The database is maintained by an international team of researchers and can be accessed at <a href="https://www.mortality.org/">https://www.mortality.org/</a>. The database includes data from 43 countries and over 700 million individuals. It contains over 15 million observations and 14 variables, including demographic information such as age, sex, and cause of death, as well as population counts and life expectancy estimates.</li><li>UCI Machine Learning Repository: The UCI Machine Learning Repository is a collection of datasets that can be used for machine learning research. It includes a wide range of datasets on topics such as text mining, computer vision, and social network analysis. The repository is maintained by the University of California, Irvine and can be accessed at <a href="https://archive.ics.uci.edu/ml/index.php">https://archive.ics.uci.edu/ml/index.php</a>. The repository includes over 400 datasets, with varying numbers of observations and variables. The datasets include a mix of categorical and numerical variables, and some include missing data. Metadata is provided for each dataset, including information on the data source, variable descriptions, and potential applications.”</li></ol><p>These datasets can be valuable resources for data-driven projects and provide new insights to practitioners. Don’t miss out on this opportunity to explore new insights and expand your data horizons.</p><p>Follow me to stay tuned with upcoming posts on Data Science, Machine Learning and AI</p><p>#OpenDataset #Data #MachineLearning #AI #ML #DeepLearning #DataScience #YYT</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0732fc23aa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Regularize it!]]></title>
            <link>https://medium.com/@yoavyeledteva/regularize-it-9f020cb14e90?source=rss-68a6d8b8d3ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f020cb14e90</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[regularization]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[YoavAvneon]]></dc:creator>
            <pubDate>Thu, 16 Feb 2023 12:59:53 GMT</pubDate>
            <atom:updated>2023-02-16T12:59:53.030Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4SsVmK-ICmbjyoZlIySK7Q.jpeg" /></figure><p><strong>Are you tired of machine learning models that are overfitting to your training data? Then it’s time to regularize it! Regularization is a powerful tool in the world of machine learning that can help prevent overfitting and improve the generalization of your models.</strong></p><p>Regularization works by adding a penalty term to the model’s loss function, which discourages the model from relying too heavily on any one feature or parameter. This penalty term effectively shrinks the magnitude of the model weights, leading to simpler models that are less prone to overfitting.</p><p>One of the most common forms of regularization is L2 regularization, also known as Ridge regression. This technique adds the squared sum of the model’s weights to the loss function, effectively shrinking the weights towards zero.</p><p>Regularization is not a one-size-fits-all solution, and the choice of the right form of regularization depends on the specific problem and dataset. However, the potential benefits of regularization are vast and exciting. By improving the generalization of your models, you can enhance their accuracy and reliability, even in situations where the training data is limited or noisy.</p><p>Here are some HL guidelines to help you decide on the proper regularization for your project:</p><ol><li>Choose the Right Regularization Technique</li></ol><p>There are several types of regularization techniques available, including L1 regularization, L2 regularization, and dropout. The choice of which technique to use will depend on the specific problem and the model being used. For example, L1 regularization is often used for feature selection, while dropout is a popular technique for deep neural networks.</p><p>2. Determine the Regularization Strength</p><p>Once you’ve decided which regularization technique to use, the next step is to determine the strength of the regularization. This is typically controlled by a hyperparameter, such as the regularization coefficient. Too much regularization will lead to underfitting, while too little will result in overfitting. It’s important to find the right balance, which can often be achieved through trial and error or by using techniques such as cross-validation.</p><p>3. Consider Regularization During Hyperparameter Tuning</p><p>Hyperparameter tuning is an important step in the machine learning process, and regularization should be considered during this step. Regularization hyperparameters, such as the regularization coefficient, should be optimized along with other hyperparameters, such as learning rate or number of hidden units.</p><p>Regularization methods are a critical component of the data science toolkit, which help improve the performance and generalization ability of machine learning models. <strong>However, there is always a trade-off in real life, and while these techniques are powerful, they also have some downsides that can affect the final output.</strong></p><p>To complement, here are some best practice regularization methods for data science, including common use cases and also downsides to be aware of:</p><p><strong>L1 Regularization</strong></p><p>L1 regularization, also known as Lasso, is a method that adds a penalty to the cost function based on the absolute value of the model’s coefficients, encouraging the model to set some coefficients to zero, which effectively performs feature selection. L1 regularization is often used in cases where feature selection is important, such as in high-dimensional datasets, where there are many potential predictors. This method can help reduce the number of variables and improve model interpretability, making it easier to understand the impact of each feature on the model’s output.</p><p>However, L1 regularization has some downsides. One of the main issues with L1 regularization is that it may not be able to handle highly correlated features well. In such cases, L1 regularization may select only one of the highly correlated features and ignore the others, which can lead to suboptimal performance. Additionally, L1 regularization can be sensitive to the scale of the input features, and the resulting model may be biased towards features with larger scales. One of the main issues with data augmentation is that it may not work well for all types of data. For example, if the data is highly structured, such as in the case of tabular data, data augmentation may not be able to generate useful additional data. Additionally, data augmentation can be computationally expensive, especially if the data is large.</p><p><strong>L2 Regularization</strong></p><p>On the other hand, L2 regularization, also known as Ridge, adds a penalty to the cost function based on the square of the model’s coefficients, encouraging the model to have small coefficient values and preventing overfitting. L2 regularization is commonly used in cases where overfitting is a concern, such as when the model has a large number of parameters relative to the size of the training dataset. This method can help prevent the model from becoming too complex and reduce the risk of overfitting.</p><p>However, one of the main downsides of L2 regularization is that it may not be able to handle outliers well. In the presence of outliers, L2 regularization may penalize the model too much, leading to underfitting. Another disadvantage of L2 regularization is that it can lead to small but non-zero weights, which can be less interpretable than sparse models. Additionally, L2 regularization does not generally lead to sparsity, which can make it less effective in cases where only a small subset of the features are relevant to the outcome. Additionally, L2 regularization may not be able to handle highly correlated features well, similar to L1 regularization.</p><p><strong>Dropout</strong></p><p>Dropout regularization is another regularization method that randomly drops out some of the neurons in the model during training. This technique encourages the model to learn more robust and generalizable features, making it less sensitive to specific weights and more adaptable to new data. Dropout regularization is often used in deep learning models, where overfitting is a common problem due to the high number of parameters in the model. This technique can help improve the model’s ability to generalize to new data by encouraging the development of more robust and generalizable features.</p><p>One of the main issues with Dropout is that it can slow down the training process. Since Dropout randomly drops out neurons, the model needs to be trained for longer to achieve the same level of accuracy as a model without Dropout. In other words, dropout can result in slower convergence during training, as the model has to learn to be robust to the dropout. Additionally, dropout can lead to higher variance in the predictions, which can make it more difficult to interpret the model.</p><p><strong>Early Stopping</strong></p><p>Early stopping is a method that stops the training process when the performance on the validation set starts to degrade, preventing overfitting by minimizing the risk of over-tuning on the training data. Early stopping is useful when training a model that has a tendency to overfit, especially in cases where the validation set is small. This method can help prevent the model from over-tuning to the training data and improve its ability to generalize to new data.</p><p>One of the main issues with early stopping is that it can be difficult to determine the optimal stopping point. The choice of the stopping criterion can have a significant impact on the final performance of the model. If the stopping criterion is too conservative, then the training may stop too early, and the model may not have converged to its optimal solution. On the other hand, if the stopping criterion is too aggressive, then the model may be overfit to the validation set, and its performance on the test set may be lower than expected.</p><p>Therefore, it is important to choose an appropriate stopping criterion that balances the risk of stopping too early with the risk of overfitting. One way to do this is to use a validation set that is representative of the test set and to monitor the performance of the model on both the validation set and the test set. This can help to ensure that the stopping criterion is not too conservative or too aggressive, and that the model achieves good performance on both the validation and test sets.</p><p>Additionally, early stopping may not work well in cases where the training process is noisy or where the validation loss does not reflect the generalization performance well.</p><p><strong>Data Augmentation</strong></p><p>Data augmentation is a method that involves generating new training examples by applying random transformations to the existing data, such as flipping or rotating images, which can improve the model’s ability to generalize to new data. Data augmentation is often used in image recognition and other computer vision tasks where there is a limited amount of training data. This technique can help increase the size of the training set, making it easier to train models that are robust to variations in the input.</p><p>One of the main issues with data augmentation is that it may not work well for all types of data. For example, if the data is highly structured, such as in the case of tabular data, data augmentation may not be able to generate useful additional data. Additionally, data augmentation can be computationally expensive, especially if the data is large as the augmented data has to be generated for each epoch of training.</p><p><strong>Batch Normalization</strong></p><p>Finally, batch normalization is a technique that normalizes the activations of each layer in the model, making the training process more stable and reducing the risk of overfitting by preventing the network from becoming too sensitive to specific weight values. Batch normalization is commonly used in deep learning models to stabilize the training process and prevent the model from becoming too sensitive to specific weight values. This technique is particularly useful in cases where the model has many layers or when the input features have different scales.</p><p>However, one disadvantage of batch normalization is that it can be sensitive to the batch size, as the statistics used for normalization are computed over the batch. Additionally, batch normalization can lead to slower training, as the normalization operation adds additional computation.</p><p><strong>Taking Stock: A Mid-Point Summary</strong></p><p>To sum up to here, while regularization techniques can be very effective in preventing overfitting and improving the generalization ability of a model, they are not without their downsides. Understanding the limitations of each regularization technique is important in order to choose the appropriate technique for a given problem and to avoid the pitfalls that can arise from using these techniques.</p><p>It’s important to note that the choice of regularization method will depend on the specific problem and the model being used. It’s often a good idea to try multiple methods and compare their performance on the validation set. By using these regularization methods appropriately, data scientists can build more robust and generalizable machine learning models that perform well on a wide range of inputs and use cases.</p><p><strong>To get you started</strong></p><p>You can find below some general code templates in Python:</p><p>First, a general template for applying L1 regularization to a pre-trained model M in Python using Keras:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*2WkJDYQWemghTHyqxH6o3w.png" /></figure><p>In this template, we first define the L1 regularization strength using the <strong>l1_strength</strong> variable. Then, we loop through all the layers in the pre-trained model <strong>M</strong>. For each layer that has a <strong>kernel_regularizer</strong> attribute (i.e., that has weights), we set the <strong>kernel_regularizer</strong> attribute to be an L1 regularizer with strength <strong>l1_strength</strong>.</p><p>Note that this is just a general template, and you may need to modify it to suit your specific use case and pre-trained model.</p><p>Naturally after L1, here is a general template in Python for applying L2 regularization on a pretrained model M:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*bndJMfG_T0Xc3ixYHN0eBA.png" /></figure><p>In this code, we first load the pretrained model <strong>M</strong> using <strong>tf.keras.models.load_model</strong>. Then, we define the L2 regularization hyperparameter <strong>l2_lambda</strong>. We then iterate through all layers of the model and add L2 regularization to each layer’s kernel if it has a <strong>kernel_regularizer</strong> attribute. Finally, we compile the model with the new regularization and train it with the training and validation data.</p><p>Note that the code assumes the use of TensorFlow and the Keras API. Also, the training and validation data are not shown, as they would depend on the specific problem being solved.</p><p>Last code for this post, here is a general template for applying dropout regularization to a pretrained model M in Python using the Keras library:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*RGVVBf2YyQWM1y6O5rriWw.png" /></figure><p>In this example, we import the <strong>Dropout</strong> layer from Keras and define the dropout rate as 0.5 (you can adjust this value based on your specific needs). We then create a new model based on the pretrained model <strong>M</strong> and add a <strong>Dropout</strong> layer to the new model. Finally, we compile the new model with the desired optimizer, loss function, and metrics.</p><p>Note that this is just a general template, and you will need to customize it to fit your specific use case, such as specifying the input shape of the model and adjusting the hyperparameters of the <strong>compile()</strong> method.</p><p><strong>And a bonus for those of you who reached all the way to here.</strong></p><p>While regularization plays a crucial role by preventing overfitting and ensuring that models are more robust and generalizable, that’s not all — <strong>regularization can also help protect against adversarial attacks.</strong></p><p>Adversarial machine learning refers to the manipulation of a machine learning model’s predictions by malicious actors. Adversarial Machine Learning is a rapidly growing field with increasing importance as the deployment of AI systems becomes more widespread. Adversarial attacks pose a real threat to the security and reliability of AI systems and it’s critical to have robust defenses in place.</p><p>This is a growing concern in machine learning, as it can lead to incorrect model predictions and even security breaches. By adding a regularization term to the loss function, we can encourage the model to be more robust and resistant to small perturbations in the input data, making it more difficult for an attacker to cause misclassification.</p><p>In conclusion, regularization is a key tool for building effective and robust machine learning models. By choosing the right technique, determining the proper regularization strength, and considering regularization during hyperparameter tuning, you can ensure that your models are not only accurate, but also resistant to adversarial attacks. So, remember: <strong><em>Regularize it, don’t jeopardize it!</em></strong></p><p><strong><em>About the author</em></strong></p><p>Yoav Avneon, Ph.D. and Group Manager of X-Sight Data Science Research &amp; Delivery Team at NICE Actimize. NICE Actimize is the global market leader in financial crime and compliance management, offering a comprehensive suite of Anti-Money Laundering, Fraud, and Compliance solutions. As the largest provider of financial crime, risk, and compliance solutions for regional and global financial institutions and government regulators, NICE Actimize is at the forefront of innovation in AI and ML.</p><p>#RegularizeIt #MachineLearning #AI #ML #DeepLearning #DataScience #YYT</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f020cb14e90" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>