{"id":146,"date":"2019-12-06T17:32:49","date_gmt":"2019-12-06T17:32:49","guid":{"rendered":"http:\/\/localhost\/wordpress\/?p=146"},"modified":"2021-05-29T17:47:11","modified_gmt":"2021-05-29T17:47:11","slug":"dimensionality-reduction-feature-extraction-techniques-in-python","status":"publish","type":"post","link":"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/","title":{"rendered":"Dimensionality Reduction & Feature Extraction Techniques in Python: Part one"},"content":{"rendered":"\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

TLDR: you can apply functions on data to make it easier to handle, to see the code click here<\/a>\u00a0<\/p>

Over the past 30 years, the amount of data that has been produced has grown exponentially. When there is a large set of multidimensional data, the chance that some data might overlap can occur. In this post, we will be talking about Dimensional Reduction and Feature Extraction.\u00a0 These are needed in Machine Learning\/ Deep Learning to allow the Neural Networks an easier way to map the data.\u00a0<\/p>

Dimensional reduction is typically choosing a basis or mathematical representation within which you can describe most but not all of the variance within your data, thereby retaining the relevant information, while reducing the amount of information necessary to represent it.\u00a0 Feature Selection is hand-selecting features that are highly discriminating. This has a lot more to do with feature engineering than analysis and requires significantly more work on the part of the data scientist. It requires an understanding of what aspects of your dataset are important in whatever predictions you’re making, and which aren’t. Feature extraction usually involves generating new features which are composites of existing features\u00a0<\/p>

We will be looking at the iris dataset, which is relatively small but has four dimensions.If you where to take the raw data and try to parse it, it would be visualized as such:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\"\"\t\t\t\t\t\t\t\t\t\t\t
Default visualization of the 4 columns for the Iris dataset<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

Now if you were to look at this and try to determine how to classify a new data point that might prove difficult. This is with only four features, imagine going up to 10 features or even hundreds? Because of this, we need to have Dimensionality Reduction and Feature Extraction. If we took the data and applied a Principle Component Analysis<\/a> to the data we can reduce the dimensions to two! Now we have data that look like this<\/a>:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\"\"\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t
Applying the Principal Component Analysis (PCA) to the Dataset<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

By using mathematics we can reduce the number of features and make it easier to visualize and separate the data. However, there are different ways to reduce the features of a dataset! The next one we will look at is the Single Value Decomposition (SVD)<\/a>. Now we can have data that looks like this<\/a>:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

Looking at these two newly formed datasets that reduce the dimensionality of the original dataset we can see that it would be much easier for a neural network to classify points based on these reduced dimensions compared to the original. It is always preferred when working with data to reduce the dimensions and make it easier to classify or visualize the data. Using these methods we can do exactly that!<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"

TLDR: you can apply functions on data to make it easier to handle, to see the code click<\/p>\n

Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":153,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[15,16,17],"tags":[],"yoast_head":"\nDimensionality Reduction & Feature Extraction Techniques in Python: Part one - Jamil Gafur<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dimensionality Reduction & Feature Extraction Techniques in Python: Part one - Jamil Gafur\" \/>\n<meta property=\"og:description\" content=\"TLDR: you can apply functions on data to make it easier to handle, to see the code clickRead More\" \/>\n<meta property=\"og:url\" content=\"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Jamil Gafur\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-06T17:32:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-29T17:47:11+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/localhost\/wordpress\/wp-content\/uploads\/2019\/12\/qtq80-gECrYv.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1525\" \/>\n\t<meta property=\"og:image:height\" content=\"1440\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"jamilgafur\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"jamilgafur\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t \"@context\": \"https:\/\/schema.org\",\n\t \"@graph\": [\n\t {\n\t \"@type\": \"WebPage\",\n\t \"@id\": \"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/\",\n\t \"url\": \"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/\",\n\t \"name\": \"Dimensionality Reduction & Feature Extraction Techniques in Python: Part one - Jamil Gafur\",\n\t \"isPartOf\": {\n\t \"@id\": \"http:\/\/localhost\/wordpress\/#website\"\n\t },\n\t \"primaryImageOfPage\": {\n\t \"@id\": \"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/#primaryimage\"\n\t },\n\t \"image\": {\n\t \"@id\": \"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/#primaryimage\"\n\t },\n\t \"thumbnailUrl\": \"http:\/\/localhost\/wordpress\/wp-content\/uploads\/2019\/12\/qtq80-gECrYv.jpeg\",\n\t \"datePublished\": \"2019-12-06T17:32:49+00:00\",\n\t \"dateModified\": \"2021-05-29T17:47:11+00:00\",\n\t \"author\": {\n\t \"@id\": \"http:\/\/localhost\/wordpress\/#\/schema\/person\/04ca32a459db6faaa256ee48a444ce34\"\n\t },\n\t \"breadcrumb\": {\n\t \"@id\": \"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/#breadcrumb\"\n\t },\n\t \"inLanguage\": \"en-US\",\n\t \"potentialAction\": [\n\t {\n\t \"@type\": \"ReadAction\",\n\t \"target\": [\n\t \"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/\"\n\t ]\n\t }\n\t ]\n\t },\n\t {\n\t \"@type\": \"ImageObject\",\n\t \"inLanguage\": \"en-US\",\n\t \"@id\": \"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/#primaryimage\",\n\t \"url\": \"http:\/\/localhost\/wordpress\/wp-content\/uploads\/2019\/12\/qtq80-gECrYv.jpeg\",\n\t \"contentUrl\": \"http:\/\/localhost\/wordpress\/wp-content\/uploads\/2019\/12\/qtq80-gECrYv.jpeg\",\n\t \"width\": 1525,\n\t \"height\": 1440\n\t },\n\t {\n\t \"@type\": \"BreadcrumbList\",\n\t \"@id\": \"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/#breadcrumb\",\n\t \"itemListElement\": [\n\t {\n\t \"@type\": \"ListItem\",\n\t \"position\": 1,\n\t \"name\": \"Home\",\n\t \"item\": \"http:\/\/localhost\/wordpress\/\"\n\t },\n\t {\n\t \"@type\": \"ListItem\",\n\t \"position\": 2,\n\t \"name\": \"Dimensionality Reduction & Feature Extraction Techniques in Python: Part one\"\n\t }\n\t ]\n\t },\n\t {\n\t \"@type\": \"WebSite\",\n\t \"@id\": \"http:\/\/localhost\/wordpress\/#website\",\n\t \"url\": \"http:\/\/localhost\/wordpress\/\",\n\t \"name\": \"Jamil Gafur\",\n\t \"description\": \"\",\n\t \"potentialAction\": [\n\t {\n\t \"@type\": \"SearchAction\",\n\t \"target\": {\n\t \"@type\": \"EntryPoint\",\n\t \"urlTemplate\": \"http:\/\/localhost\/wordpress\/?s={search_term_string}\"\n\t },\n\t \"query-input\": \"required name=search_term_string\"\n\t }\n\t ],\n\t \"inLanguage\": \"en-US\"\n\t },\n\t {\n\t \"@type\": \"Person\",\n\t \"@id\": \"http:\/\/localhost\/wordpress\/#\/schema\/person\/04ca32a459db6faaa256ee48a444ce34\",\n\t \"name\": \"jamilgafur\",\n\t \"image\": {\n\t \"@type\": \"ImageObject\",\n\t \"inLanguage\": \"en-US\",\n\t \"@id\": \"http:\/\/localhost\/wordpress\/#\/schema\/person\/image\/\",\n\t \"url\": \"http:\/\/0.gravatar.com\/avatar\/9f97972d46c614454c7669f656485e67?s=96&d=mm&r=g\",\n\t \"contentUrl\": \"http:\/\/0.gravatar.com\/avatar\/9f97972d46c614454c7669f656485e67?s=96&d=mm&r=g\",\n\t \"caption\": \"jamilgafur\"\n\t },\n\t \"url\": \"http:\/\/localhost\/wordpress\/author\/jamilgafur\/\"\n\t }\n\t ]\n\t}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Dimensionality Reduction & Feature Extraction Techniques in Python: Part one - Jamil Gafur","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/","og_locale":"en_US","og_type":"article","og_title":"Dimensionality Reduction & Feature Extraction Techniques in Python: Part one - Jamil Gafur","og_description":"TLDR: you can apply functions on data to make it easier to handle, to see the code clickRead More","og_url":"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/","og_site_name":"Jamil Gafur","article_published_time":"2019-12-06T17:32:49+00:00","article_modified_time":"2021-05-29T17:47:11+00:00","og_image":[{"width":1525,"height":1440,"url":"http:\/\/localhost\/wordpress\/wp-content\/uploads\/2019\/12\/qtq80-gECrYv.jpeg","type":"image\/jpeg"}],"author":"jamilgafur","twitter_card":"summary_large_image","twitter_misc":{"Written by":"jamilgafur","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/","url":"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/","name":"Dimensionality Reduction & Feature Extraction Techniques in Python: Part one - Jamil Gafur","isPartOf":{"@id":"http:\/\/localhost\/wordpress\/#website"},"primaryImageOfPage":{"@id":"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/#primaryimage"},"image":{"@id":"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/#primaryimage"},"thumbnailUrl":"http:\/\/localhost\/wordpress\/wp-content\/uploads\/2019\/12\/qtq80-gECrYv.jpeg","datePublished":"2019-12-06T17:32:49+00:00","dateModified":"2021-05-29T17:47:11+00:00","author":{"@id":"http:\/\/localhost\/wordpress\/#\/schema\/person\/04ca32a459db6faaa256ee48a444ce34"},"breadcrumb":{"@id":"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/#primaryimage","url":"http:\/\/localhost\/wordpress\/wp-content\/uploads\/2019\/12\/qtq80-gECrYv.jpeg","contentUrl":"http:\/\/localhost\/wordpress\/wp-content\/uploads\/2019\/12\/qtq80-gECrYv.jpeg","width":1525,"height":1440},{"@type":"BreadcrumbList","@id":"http:\/\/localhost\/wordpress\/dimensionality-reduction-feature-extraction-techniques-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/localhost\/wordpress\/"},{"@type":"ListItem","position":2,"name":"Dimensionality Reduction & Feature Extraction Techniques in Python: Part one"}]},{"@type":"WebSite","@id":"http:\/\/localhost\/wordpress\/#website","url":"http:\/\/localhost\/wordpress\/","name":"Jamil Gafur","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/localhost\/wordpress\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/localhost\/wordpress\/#\/schema\/person\/04ca32a459db6faaa256ee48a444ce34","name":"jamilgafur","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/localhost\/wordpress\/#\/schema\/person\/image\/","url":"http:\/\/0.gravatar.com\/avatar\/9f97972d46c614454c7669f656485e67?s=96&d=mm&r=g","contentUrl":"http:\/\/0.gravatar.com\/avatar\/9f97972d46c614454c7669f656485e67?s=96&d=mm&r=g","caption":"jamilgafur"},"url":"http:\/\/localhost\/wordpress\/author\/jamilgafur\/"}]}},"_links":{"self":[{"href":"http:\/\/localhost\/wordpress\/wp-json\/wp\/v2\/posts\/146"}],"collection":[{"href":"http:\/\/localhost\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/localhost\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/localhost\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/localhost\/wordpress\/wp-json\/wp\/v2\/comments?post=146"}],"version-history":[{"count":8,"href":"http:\/\/localhost\/wordpress\/wp-json\/wp\/v2\/posts\/146\/revisions"}],"predecessor-version":[{"id":287,"href":"http:\/\/localhost\/wordpress\/wp-json\/wp\/v2\/posts\/146\/revisions\/287"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/localhost\/wordpress\/wp-json\/wp\/v2\/media\/153"}],"wp:attachment":[{"href":"http:\/\/localhost\/wordpress\/wp-json\/wp\/v2\/media?parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/localhost\/wordpress\/wp-json\/wp\/v2\/categories?post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/localhost\/wordpress\/wp-json\/wp\/v2\/tags?post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}