<?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 Matthew Connelly on Medium]]></title>
        <description><![CDATA[Stories by Matthew Connelly on Medium]]></description>
        <link>https://medium.com/@matthewconnelly?source=rss-df2bb6d31be1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*71NS0EoHEVuXiEcq0k1a2A.jpeg</url>
            <title>Stories by Matthew Connelly on Medium</title>
            <link>https://medium.com/@matthewconnelly?source=rss-df2bb6d31be1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 14:32:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@matthewconnelly/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[Directing your company towards ethical AI]]></title>
            <link>https://medium.com/data-science/ai-ethics-558db9895bd?source=rss-df2bb6d31be1------2</link>
            <guid isPermaLink="false">https://medium.com/p/558db9895bd</guid>
            <category><![CDATA[strategy]]></category>
            <category><![CDATA[ai-ethics]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ethics]]></category>
            <dc:creator><![CDATA[Matthew Connelly]]></dc:creator>
            <pubDate>Sun, 27 Jun 2021 16:46:42 GMT</pubDate>
            <atom:updated>2021-07-04T23:09:54.487Z</atom:updated>
            <content:encoded><![CDATA[<h4>A comprehensive strategy to enable organisations to place ethics at the heart of their AI modelling</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eGpEhhVKMhhkgUwbIrFxeg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@aaronburden">Aaron Burden</a> on <a href="https://unsplash.com/photos/NXt5PrOb_7U">Unsplash</a></figcaption></figure><p>For most organisations, AI ethics is the equivalent of flossing: they know it’s good for them, but they prefer to do something — possibly anything — else. But with growing scrutiny from governments, the press, and international organisations, companies must ensure they consider the ethics of their models.</p><p>In this article, we’re going to explore a comprehensive strategy for producing responsible AI models. To do this, we’re going to consider several factors, including: (<em>1) </em>fairness, (<em>2</em>) explainability and transparency, (<em>3</em>) accountability, (<em>4</em>) security and safety, and (<em>5</em>) the level of human-centricity and benefit to society as a whole.</p><h3>Fair</h3><p><strong>Organisations should ensure that their AI models are fair by carefully choosing the model’s features, testing the model, and adopting IBM’s AI fairness algorithm</strong></p><p>Currently, the society that we live in is unfair, but the models that we deploy should aim to make society fairer. Therefore, fairness should be put at the heart of all of an organisation’s models, particularly since there are large legal penalties associated with discrimination. However, ‘fair’ is a subjective term. On the one hand, fairness could be considered as treating everyone equally despite their circumstances. However, on the other hand, fairness could be considered as treating each individual based on their own circumstance. And seemingly ‘fair decision’, as one Google report found, such as giving disadvantaged people access to credit, negatively impacted their credit score. Machines learning models, however, have no awareness of context, and thus fairness. Amazon’s AI recruitment-screening model, for example, had a bias towards male applicants, because historically men filled these roles. Although there are no quick fix for any of these ethical issues that organisations, which implement AI models, are facing, they should consider an ethical framework, which can increase the fairness of their model throughout its lifecycle, including:</p><ul><li><strong>Choosing the features. </strong>Discrimination can be broken down into two main components: intentional (disparity treatment) and unintentional (disparate impact). However, steering clear of disparate impact, is not a straightforward a simply removing protected features; some apparently neutral features can act as proxies for protected features. Therefore, organisations should carefully consider the impact of each feature used in its model.</li><li><strong>Adopting IBM’S fairness 360. </strong>Organisation should consider adopting IBM’s AI Fairness 360 toolkit to detect and mitigate against biases within a given dataset. Three bias optimising preprocessing techniques, which can be found within this library, standout, including group discrimination, individual distortion, and utility preservation. Throughout the design and development process, for AI models, the developers should consider using these techniques to minimise the bias within the algorithm.</li><li><strong>Validating the model. </strong>During the development process, the organisation’s developers should test the AI model, including using the ‘eighty-percent rule’. This rule, frequently used by statisticians, is calculated by dividing the proportion of the disadvantaged group by the advantaged group. In addition to this, organisations should look at getting another external team to validate the model’s performance, particularly from an ethical standpoint.</li></ul><p><strong>Key takeaways:</strong></p><ul><li>Organisations should adopt a fairness-by-design approach to all of the AI model decision-making.</li><li>There is no one-size-fits-all methodology to fairness. However, organisations should adopt two core principles: first, document their approach to minimise disparate impact; and second, clearly justify all of their decisions.</li></ul><h3><strong>Explainable and transparent</strong></h3><p><strong>To guide the AI model production, organisation should ensure that they weigh the risk and accuracy requirements associated with their model</strong></p><p>One of the key trade-offs in AI model ethics is between the model’s accuracy and its explainability. On the one hand, it’s tempting to believe that, in all situation, a more accurate model outweighs the costs of it being less explainable. Certainty, this is true in some low-risk, low-impact situations, such as a streaming service recommending which movie you should watch next. However, on the other hand, having a model that’s difficult to explainable may <em>not </em>be acceptable in many situations, such as offering a loan to a customer. So, how should an organisation decide how explainable their model should be? First, they should weigh the risk and accuracy requirements against each other. Second, if a lack of transparency is acceptable, then organisation can consider black-box modelling techniques (e.g. neural nets, random forest); however, if explainability is important, then they should focus on using interpretable models (e.g. decision trees, logistic regression).</p><p><strong>As organisation embrace AI, they should:</strong></p><ul><li><strong>Clarify the explainability requirements. </strong>Organisations, in conjunction with business and legal stakeholders, should consider their expected level of explainability for their model.</li><li><strong>Utilise your data scientists. </strong>There are a wide range of machine learning algorithms, from high transparency (e.g. decision trees), partial transparency (e.g. random forest), and little transparency (e.g. neural nets). So, organisations should leverage their data scientists to determine the level of transparency that they require for their desired use case.</li><li><strong>Hire AI ethicists. </strong>Organisations should consider hiring people that have a deep understanding of the model, and can, upon requests, explain the approach that the model took to produce a given outcome.</li></ul><p><strong>Key takeaways:</strong></p><ul><li>Organisations — particularly banks, government agencies, and pharmaceutical companies — face a large amount of scrutiny; therefore, they should focus on making their algorithm explainable. To do this, they should use high or partial transparent models, unless there is a clear competitive advantage of using a less transparent model (e.g. neural nets) that outweighs the risks associated with them. Note, however, in most use cases, it’s unlikely that humans will need to vet all of the AI’s decision-making, only for high-risk decisions.</li></ul><h3>Accountable</h3><p><strong>Organisations should ensure the AI model’s designers, developers, and managers are responsible for the societal and litigation impacts of their solution going live</strong></p><p>Algorithms, if left unchecked, can impact businesses, individuals, and societies. Therefore, it’s vital that organisations have an artificial intelligence governance policy in place. Although, at first, it seems like the AI’s logical decision-making is objective; humans judgement plays a role throughout the design and development of the model. Consequently, data scientists and their management should remain accountable for the actions of their model. The list below explores three ways to make an organisation’s AI more accountable, including implementing strong AI governance, defining the responsibility associated with the consequences of the AI system, and documenting all ethical decisions.</p><ul><li><strong>Governance. </strong>Organisations should ensure that they produced clear and accessible policies, standards, and procedures for their ethical considerations before undertaking any AI modelling project. Thus, minimising confusions around who is responsible for any ethical consequences associated with the production of the model.</li><li><strong>Responsibility.</strong> The data scientist and their management should remain accountable for their models. Therefore, organisations should ensure that they provide their employees, who work in the AI space, with relevant compliance training, so they understand their accountability to make sure that the team is producing a responsible, socially-beneficial model. As one fast company study found, fifty-percent of developers believed that the developers, who produced the AI model, should be accountable for the consequences of their model.</li><li><strong>Documentation. </strong>All design decision-making should be clearly documented, and accessible to leadership and programmers. Furthermore, if an organisation’s consultants or contractors leave, they should consider hiring full-time ethicists to monitor the model throughout its entire lifetime, and ensure that any ethical concerns are addressed swiftly and effectively.</li></ul><p><strong>Key takeaways:</strong></p><ul><li>Make clear and accessible policies, standards, and procedures to outline the ethical considerations associated with AI model development.</li><li>The data scientists and their management will be responsible for the implications of the organisation’s customer churn model.</li><li>Produced detailed records for the ethical considerations.</li></ul><h3>Secure and safe</h3><p><strong>Organisations should ensure that they respect their users’ privacy, monitor the algorithm, and do no harm to their customers</strong></p><p>The AI model should be implemented in a secure and safe manner, which includes respecting customers privacy, monitoring the algorithm, and doing no harm.</p><ul><li><strong>Respect privacy. </strong>Companies are increasingly providing their customers with greater control on their data. However, this type of data privacy optimisation requires a careful balancing act. On the one hand, companies that collect more data may be at an increased risk from litigation penalties. However, on the other hand, companies that have strong data privacy standards may forego monetary benefits of data. So, what should organisations do? The optimal strategy is to collect and use no more — but no less — data than the organisation’s competitors. In addition to this, organisations should clearly articulate to its customers the intricacies of their AI model.</li><li><strong>Monitor the algorithm. </strong>The analytics team should ensure that they clearly articulates the methodology of the AI model. So, if key team members leave, the organisation can respond to ethical queries posed by its customers. Furthermore, organisations should consider creating a permanent role for AI ethicists, who will be able to monitor the AI algorithm throughout its entire lifecycle. The monitoring processes should include considering the inputs, outputs, and local legislation.</li><li><strong>Do no harm. </strong>Ensure that the AI model system is <em>not </em>used to harm any of the organisation’s customers. Take, for instance, a credit card customer who has had trouble managing their finance, and may have gotten into significant amounts of debt — it’s not appropriate for the organisation to encourage this customer to borrow more money with the bank. Instead, the organisation should focus on supporting its customer to help them achieve their goals. And if that isn’t something to be proud of — what is? So, the algorithm should ensure that a human can step in when necessary, to make sure that the algorithm doesn’t harm other individuals.</li></ul><p><strong>Key takeaways:</strong></p><ul><li>Adopt a privacy-by-design approach to all decision-making associated with designing, developing, and testing of an AI model.</li><li>Produce an AI model that is customer-centric.</li></ul><h3><strong>Human-centric and socially beneficial</strong></h3><p><strong>Organisations should ensure their system is managed by a human, socially beneficial, and lawful. To do this, high-risk tasks will be augment by humans and low-risk tasks automated</strong></p><p>When designing and developing an AI system, organisations should take into consideration a variety of social and ethical factors, and the organisation shall only produce algorithms where the benefits clearly outweigh the risks. Three principles stand out in terms of both their human-centricity and their potential to benefit society. These are human-in-the-loop, socially beneficial, and lawful.</p><ul><li><strong>Human-centric. </strong>A human should, at all times, be in charge of the AI model. But this doesn’t mean that the human should always approve every decision made by the AI. However, organisations should ensure that high-risk decisions are augmented by humans.</li><li><strong>Socially beneficial. </strong>AI should positively augment society, particularly to help achieve large issues within society. Note, however, not everything that is socially beneficial is human-centric. China’s social credit score, for instance, aims to shield society as whole, but it doesn’t take an individual’s need for privacy into account.</li><li><strong>Lawful. </strong>Organisations shall, at all times, ensure that their AI model and digital solution complies with all local and extraterritorial policies, standards, and procedures, including DPA ’18, GDPR, and Data Sharing Agreement.</li></ul><p><strong>Key takeaways</strong></p><ul><li>Focus on ensuring that the algorithm benefits the end customer, and is compliant with local and extraterritorial laws.</li></ul><h3>Conclusion</h3><p>There are no quick fixes for any of the ethical issues surrounding artificial intelligence, and sometimes that can feel paralysing. But the lesson is clear: organisations should ensure their system is fair, explainable to a non-technical audience, held accountable by their designers, respectful of users’ privacy, and socially beneficial. However, more importantly, by ensuring that organisations place ethics at the heart of all of their AI models, they can build trust with their customers. Consequently, this additional trust may make their customers feel more comfortable sharing additional data, which could improve— potentially more so than making the model less transparent — the AI model’s efficacy, and in turn, their customers’ experience. And that’s the mission of every organisation — to put the customer first.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=558db9895bd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/ai-ethics-558db9895bd">Directing your company towards ethical AI</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Techniques for Dimensionality Reduction]]></title>
            <link>https://medium.com/data-science/techniques-for-dimensionality-reduction-927a10135356?source=rss-df2bb6d31be1------2</link>
            <guid isPermaLink="false">https://medium.com/p/927a10135356</guid>
            <category><![CDATA[dimensionality-reduction]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[editors-pick]]></category>
            <dc:creator><![CDATA[Matthew Connelly]]></dc:creator>
            <pubDate>Sun, 13 Jun 2021 19:05:25 GMT</pubDate>
            <atom:updated>2021-07-07T08:51:09.893Z</atom:updated>
            <content:encoded><![CDATA[<h4>A guide for employing dimensionality reduction to improve an AI model’s efficacy</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GaGMsdXWsx4D9Bfnn3-FvA.jpeg" /><figcaption>Photo by <a href="https://gantlaborde.medium.com/">Gant Laborde</a></figcaption></figure><p>Currently, we’re on the edge of a wonderful revolution: Artificial Intelligence. In addition to this, the recent ‘Big Bang’ in large datasets across companies, organisation, and government departments has resulted in a large uptake in data mining techniques. So, what is data mining? Simply put, it’s the process of discovering trends and insights in high-dimensionality datasets (those with thousands of columns). On the one hand, the high-dimensionality datasets have enabled organisations to solve complex, real-world problems, such as reducing cancer patient waiting time, predicting protein structure associated with COVID-19, and analysing MEG brain imaging scans. However, on the other hand, large datasets can sometimes contain columns with poor-quality data, which can lower the performance of the model — more isn’t always better.</p><p>One way to preserve the structure of high-dimensional data in a low-dimensional space is to use a dimensional reduction technique. So, what’s the benefit of this? The answer is three-fold: first, it improves the model accuracy due to less misleading data; second, the model trains faster since it has fewer dimensions; and finally, it makes the model simpler for researchers to interpret. There are three main dimensional reduction techniques: (<em>1) </em>feature elimination and extraction, (<em>2</em>) linear algebra, and (<em>3) </em>manifold. Over the course of this article, we’ll look at a strategy for implementing dimensionality reduction into your AI workflow, explore the different dimensionality reductions techniques, and work through a dimensionality reduction example.</p><h3>How the best breakaway from the rest: a new strategy for AI modelling</h3><p>The generation of simple experimentation with analytics is over, and most organisation know it. Therefore, companies should place advanced analytics at the heart of their organisation, providing the information and insights required to build an effective, efficient, and successful company. Furthermore, companies should strive to become insight-driven organisations, supporting an informed and capable workforce. Ease to say, difficult to master.</p><p>Currently, most organisations operate large business and operation reporting functions, which supplies traditional and periodic reporting across the company. However, typically companies face challenges, such as maintaining data quality, a single version of the truth, and consistency of assumptions. Therefore, it’s vital that organisation address these challenges before attempting to implement large-scale artificial intelligence function. But, in the short-term, they could consider producing proof-of-concepts to create excitement amongst senior stakeholders about the benefits of advanced analytics, which would help the Chief Data Officer (CDO) push for greater funding to enhance the data literacy and quality across the organisation.</p><p>For the purpose of this article, we’re going to assume that you have an acceptable data-quality to undertake the more complex analytics techniques. There are three key stages an analyst should take to produce an AI model, including understanding the bigger picture, cleansing the data, and deploying the model. The dimensionality reduction technique comes into the cleansing stage of the process. Note, however, it’s vital that analysts understand the purpose of their analysis; otherwise, they may use their time inefficiently, or worse, produce a model that doesn’t meet the needs of the stakeholders.</p><p>Therefore, to produce, monitor, and maintain a production-ready model, organisation should work through the following stages: (<em>1</em>) produce a set of user stories, (<em>2</em>) gather the data, (<em>3</em>) verify the data, (<em>4</em>) consider the ethics associated with deploying your model, (<em>5</em>) leverage a range of dimensionality reduction techniques, (<em>6</em>) model the data, (<em>7</em>) evaluate the model, and (<em>8</em>) deploy model.</p><h3>Most dimensionality reduction techniques fall into one of three categories: feature extraction and elimination, linear algebra, and manifold</h3><h3>Feature extraction and elimination</h3><p>The first stage within the dimensionality reduction process is feature extraction and elimination, which process of selecting a subset of columns for use in the model. A few of the common feature extraction and elimination techniques include:</p><p>· <strong>Missing values ratio. </strong>Columns with too many missing values will unlikely add additional value to a machine learning model. Therefore, when a column exceed a given threshold for missing values it can be excluded for the training set.</p><p>· <strong>Low-variance filter. </strong>Columns that have a small variance are unlikely to add as much value to a machine learning model. Thus, when a column goes below a given threshold for variance it can be excluded from the training set.</p><p>· <strong>High-correlation filter. </strong>If, for example, multiple columns contain similar trends, then it’s enough to feed the machine learning algorithm just one of the columns. To identify these columns, an analyst can use a Pearson’s Product Momentum Coefficient.</p><p>· <strong>Random forest. </strong>One way to eliminate features is to use a random forest technique, which creates, against the target attributes, a decision tree, and then leverage the usages statistics to identify the most informative subset of features.</p><p>· <strong>Backwards-feature elimination</strong>. The backwards feature elimination, a top down approach, starts off with all the features within the dataset, progressively removes one feature at a time, until the algorithm has reached the maximum tolerable error.</p><p>· <strong>Forward-feature construction</strong>. The forward feature construction, unlike the backwards feature elimination technique, takes a bottom up approach, where it starts with one feature, progressively adding the next feature with the highest increase in performance.</p><h3>Linear algebra methods</h3><p>The most well-known dimensionality-reduction technique are ones that implement the linear transformation, such as:</p><p>· <strong>Principal component analysis (PCA)</strong>. PCA, an unsupervised machine learning algorithm, reduces the dimensions of a dataset whilst retaining as much information as possible. To do this, the algorithm creates a new set of features from an existing set of features. Note, however, to avoid a feature with large values dominating the results, all variables should be on the same scale. In Python’s scikit-learn, to achieve this, you can use the ‘StandardScaler’ function to ensure all of the variables are on the same scale.</p><p>· <strong>Linear Discriminatory Analysis (LDA). </strong>LDA, a supervised technique, seeks to retain as much as possible of the discriminatory power for the dependent variables. To do this, first, the LDA algorithm computes the separability between classes; second, it computes the distance between the sample of each class and the mean; and lastly, it produces the dataset in a lower-dimensionality space.</p><p>· <strong>Singular Value Composition. </strong>SVD extracts the most important features from the dataset. This method is particularly popular because it’s based on simple, interpretable linear algebra models.</p><h3>Manifold</h3><p>One approach to non-linear dimensionality reduction is manifold learning. So, what is Manifold learning? Simply put, manifold learning, using geometric properties, projects points into a lower dimensional space whilst preserving its structure. A few of the common manifold learning techniques, include:</p><p>· <strong>Isomap embedding. </strong>Isomaps attempts to preserve the relationships within the dataset by producing an embedded dataset. To achieve this, isomaps begin with producing neighborhood network. Next, it estimates the geodesic distance, the shortest path between two points on a curved surface, between all pairs of points. And lastly, using eigenvalue decomposition of the geodesic distance matrix, it identifies a low-dimensional embedding of the dataset.</p><p>· <strong>Locally linear embedding (LLE). </strong>Also, like isomaps, LLE attempts to preserve the relationship within the dataset by producing an embedded dataset. To do this, first, it finds the k-nearest neighbours (kNN) of the points; second, it estimates each data vector as a combination of it’s kNN; and lastly, it creates low-dimensional vectors that best reproduce these weights. There are two benefits of this algorithm: first, LLE is able to detect more features that the linear algebra methods; and second, in comparison to other algorithms, it’s more efficient.</p><p>· <strong>t-Distributed Stochastic Neighbour. </strong>t-SNE is particularly sensitive to local structures. This is approach is one of the best for visualisation purposes, and it’s helpful for understanding theoretical properties of a dataset. Note, however, it’s one of the most computationally expensive approaches, and other techniques, such as missing values ratio, should be used before applying this technique. Also, all the features should be scaled before applying this technique.</p><p>No single dimensionality reduction technique consistently provides the ‘best’ results. Therefore, the data analysts should explore a range of options and combinations of different dimensionality-reduction techniques, so they move their model closer to the optimal solution.</p><h3>In this worked example, we’ll explore how Principal Component Analysis (PCA) can be used to reduce the dimensions of a dataset, whilst retaining the important features</h3><p>For the following example, we’re going to use the well-known ‘Iris’ dataset (see Table 1), which has been provided by the UCI machine learning repository. This dataset has, from three different species, 150 flowers. The dataset has three unique classes: (<em>1</em>) Iris-setosa; (<em>2</em>) Iris-versicolour; and (<em>3</em>) Iris-virginica. Also, it has four unique features: (<em>1</em>) sepal length; (<em>2</em>) sepal width; (<em>3</em>) petal length; and (<em>4</em>) petal width. To do this, we’re going to import the dataset using pandas, then drop the blank rows (see Figure 1).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5cde8f1a66df87d04838852855a92ed/href">https://medium.com/media/f5cde8f1a66df87d04838852855a92ed/href</a></iframe><p>Once this is done, you should see the following data (see Table 1).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8fe07ffc08464bcc059f88f5ce2dbd7/href">https://medium.com/media/c8fe07ffc08464bcc059f88f5ce2dbd7/href</a></iframe><p>After this, we’re going to assign the first four feature columns to the ‘X’ variable (from left to right), then we’re going to assign the class column, the column furthest to the right, to variable ‘y’ (see Figure 2).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3548ab9e1968466fdb5974007eda1151/href">https://medium.com/media/3548ab9e1968466fdb5974007eda1151/href</a></iframe><p>Datasets frequently contain numerical values that have different features with varying units, such height (m) and weight (kg). However, a machine learning algorithm would place additional emphasis on the weight feature instead of the height feature, because the weight values are larger than the height. But we want to ensure that the machine learning algorithm treats each column with equal importance. So, how do we do this? One way is to scale the features using a technique called standardisation.</p><p>Therefore, in this example, we’re going to apply the ‘StandardScaler’ function built into scikit-learn, so equal importance is placed on each column (see Figure 3). Consequently, the standardisation will ensure that each feature has a mean of zero and a standard deviation of one.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fec1bc639e7d7505e062143d8eca3a78/href">https://medium.com/media/fec1bc639e7d7505e062143d8eca3a78/href</a></iframe><p>Then, we’re going to import, initialise, and fit the PCA algorithm, built into scikit-learn, to the ‘X’ variable (see Figure 4), which we defined earlier.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/09bc3f544fe99565238e64eb92f6d100/href">https://medium.com/media/09bc3f544fe99565238e64eb92f6d100/href</a></iframe><p>Now, to get an understanding of how the classes are spread across the features, let’s produce a few histograms (see Figure 5).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/81fffcc8eec1e1e50e1145e9ca213d0e/href">https://medium.com/media/81fffcc8eec1e1e50e1145e9ca213d0e/href</a></iframe><p>After running the code above (see Figure 5), you should see a series graphs similar to the set below (see Figure 6).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*mYCCALrKk6cgv1lkr4FFyA.png" /><figcaption>Figure 6: histogram of each numerical column by iris class</figcaption></figure><p>Next, we’re going to call the scikit-learn’s PCA function, then visualise the resulting principal components via a scatterplot (see Figure 7).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a96cbb61593f1fc5196bd61029bb45d9/href">https://medium.com/media/a96cbb61593f1fc5196bd61029bb45d9/href</a></iframe><p>Lastly, we can see the PCA algorithm has effectively and efficiently grouped our three unique classes across two principle components (see Figure 8); the two principal components have the most spread. In the graph below we can see three distinct clusters, which are now in a format that are better for an AI algorithm to process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*RIyYmDJhWvi4NIhdml1IBg.png" /><figcaption>Figure 8: scatter plot of the two principal components</figcaption></figure><h3>Organisation should ensure dimensionality reduction is included within their AI workflow</h3><p>In the generation of Advanced Analytics, where more data is automatically considered better, we have rediscovered the value of removing outliers, low-quality data, and missing values from the dataset to improve the model’s accuracy and time-to-train. Although there is no silver bullet for reducing the dimensions of a dataset, a data analyst should consider employing and experimenting with a combination of different feature extraction and elimination, linear algebra, and manifold techniques in order to optimise the algorithm’s efficacy.</p><h3>Bibliography</h3><p>Judy, R. (2019) <em>A Beginner’s Guide to Dimensionality Reduction in Machine Learning</em>. Towards Data Science. Available from: <a href="https://towardsdatascience.com/dimensionality-reduction-for-machine-learning-80a46c2ebb7e">https://towardsdatascience.com/dimensionality-reduction-for-machine-learning-80a46c2ebb7e</a> [Accessed 15 April 2020].</p><p>Prerna, S. (2020) <em>Dimensionality Reduction Approaches</em>. Towards Data Science. Available from: <a href="https://towardsdatascience.com/dimensionality-reduction-approaches-8547c4c44334">https://towardsdatascience.com/dimensionality-reduction-approaches-8547c4c44334</a> [Accessed 15 April 2020].</p><p>Hinton, G. and Maaten, L. (2008) <em>Visualizing Data Using t-SNE</em>. Toronto University. Available from: <a href="http://www.cs.toronto.edu/~hinton/absps/tsne.pdf">http://www.cs.toronto.edu/~hinton/absps/tsne.pdf</a> [Accessed 16 April 2021].</p><p>Dataman. (2019) <em>Dimension Reduction Techniques with Python</em>. Towards Data Science. Available from: <a href="https://towardsdatascience.com/dimension-reduction-techniques-with-python-f36ca7009e5c">https://towardsdatascience.com/dimension-reduction-techniques-with-python-f36ca7009e5c</a> [Accessed 16 April 2021].</p><p>Wattenberg, et al. (2016) <em>How to Use t-SNE Effectively</em>. Distill. Available from: <a href="https://distill.pub/2016/misread-tsne/">https://distill.pub/2016/misread-tsne/</a> [Accessed 16 April 2021].</p><p>Dataman. (2019) <em>Anomaly Detection with Autoencoders Made Easy</em>. Towards Data Science. Available from: <a href="https://towardsdatascience.com/anomaly-detection-with-autoencoder-b4cdce4866a6">https://towardsdatascience.com/anomaly-detection-with-autoencoder-b4cdce4866a6</a> [Accessed 26 April 2021].</p><p>Fefferman, C. et al<em>.</em> (2016) <em>Testing the Manifold Hypothesis</em>. Journal of the American Mathematical Society. Available from: <a href="http://www.mit.edu/~mitter/publications/121_Testing_Manifold.pdf">http://www.mit.edu/~mitter/publications/121_Testing_Manifold.pdf</a> [Accessed 16 April 2021].</p><p>Belkin, M. and Niyogi, P. (2013) <em>Laplacian Eigenmaps for Dimensionality Reduction and Data Representation</em>. MIT. Available from: <a href="http://www2.imm.dtu.dk/projects/manifold/Papers/Laplacian.pdf">http://www2.imm.dtu.dk/projects/manifold/Papers/Laplacian.pdf</a> [Accessed 16 April 2021].</p><p>Silipo, R. (2015) <em>Seven Techniques for Data Dimensionality Reduction</em>. KD Nuggets. Available from: <a href="https://www.kdnuggets.com/2015/05/7-methods-data-dimensionality-reduction.html">https://www.kdnuggets.com/2015/05/7-methods-data-dimensionality-reduction.html</a> [Accessed 17 April 2021].</p><p>Brownlee, J. (2020) <em>Six Dimensionality Reduction Algorithms with Python.</em> Machine Learning Mastery. Available from: <a href="https://machinelearningmastery.com/dimensionality-reduction-algorithms-with-python/">https://machinelearningmastery.com/dimensionality-reduction-algorithms-with-python/</a> [Accessed 17 April 2021].</p><p>Scikit Learn (n.d.) <em>Manifold Learning</em>. Scikit Learn. Available from: <a href="https://scikit-learn.org/stable/modules/manifold.html">https://scikit-learn.org/stable/modules/manifold.html</a> [Accessed 17 April 2021].</p><p>Brems, M. (2017) <em>A One-Stop Shop for Principal Component Analysis</em>. Available from: <a href="https://towardsdatascience.com/a-one-stop-shop-for-principal-component-analysis-5582fb7e0a9c">https://towardsdatascience.com/a-one-stop-shop-for-principal-component-analysis-5582fb7e0a9c</a> [Accessed 17 April 2021].</p><p>University of Duke. (n.d.) <em>Linear Regression Models</em>. Available from: <a href="http://people.duke.edu/~rnau/testing.htm">http://people.duke.edu/~rnau/testing.htm</a> [Accessed 17 April 2021].</p><p>Powell, V. (n.d.) <em>Principal Component Analysis: Explained Visually</em>. Available from: <a href="https://setosa.io/ev/principal-component-analysis/">https://setosa.io/ev/principal-component-analysis/</a> [Accessed 17 April 2021].</p><p>Gormley, M. (2017) <em>PCA + Neural Network</em>. Available from: <a href="https://www.cs.cmu.edu/~mgormley/courses/10601-s17/slides/lecture18-pca.pdf">https://www.cs.cmu.edu/~mgormley/courses/10601-s17/slides/lecture18-pca.pdf</a> [Accessed 17 April 2021].</p><p>Mohamed, O. (2021) <em>The Power of Democracy in Feature Selection</em>. Available from: <a href="https://towardsdatascience.com/the-power-of-democracy-in-feature-selection-dfb75f970b6e">https://towardsdatascience.com/the-power-of-democracy-in-feature-selection-dfb75f970b6e</a> [Accessed 03 May 2021].</p><p>Palaniappan, V. (2021) <em>Manifold Learning: The Theory Behind it</em>. Available from: <a href="https://towardsdatascience.com/manifold-learning-the-theory-behind-it-c34299748fec">https://towardsdatascience.com/manifold-learning-the-theory-behind-it-c34299748fec</a> [Accessed 03 May 2021].</p><p>Desarda, A. (2021) <em>Getting Data Ready for Modelling: Feature engineering, Feature Selection, Dimension Reduction (Part Two).</em> Available from: <a href="https://towardsdatascience.com/getting-data-ready-for-modelling-feature-engineering-feature-selection-dimension-reduction-39dfa267b95a">https://towardsdatascience.com/getting-data-ready-for-modelling-feature-engineering-feature-selection-dimension-reduction-39dfa267b95a</a> [Accessed 03 May 2021].</p><p>Raschka, S. (2015) <em>Principle Component Analysis in Three Simple Steps.</em> Available from: <a href="https://sebastianraschka.com/Articles/2015_pca_in_3_steps.html">https://sebastianraschka.com/Articles/2015_pca_in_3_steps.html</a> [Accessed 03 May 2021].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=927a10135356" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/techniques-for-dimensionality-reduction-927a10135356">Techniques for Dimensionality Reduction</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>