{"id":4635,"date":"2020-01-29T12:14:41","date_gmt":"2020-01-29T12:14:41","guid":{"rendered":"https:\/\/prwatech.in\/blog\/?p=4635"},"modified":"2024-03-15T10:54:40","modified_gmt":"2024-03-15T10:54:40","slug":"categorical-data-encoding","status":"publish","type":"post","link":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/","title":{"rendered":"Categorical Data Encoding"},"content":{"rendered":"<h1><strong>Approaches for Categorical Data Encoding<\/strong><\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4636\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1.jpg\" alt=\"Approaches for Categorical Data Encoding\" width=\"850\" height=\"567\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1.jpg 939w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1-300x200.jpg 300w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1-768x512.jpg 768w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><strong>Categorical Data Encoding<\/strong>, Are you the one who is looking forward to knowing the types of categorical data encoding in machine learning? Or the one who is looking forward to knowing <strong>Categorical Data Encoding<\/strong> concepts in Machine Learning or Are you dreaming to become to certified Pro Machine Learning Engineer or <a title=\"Data Scientist\" href=\"https:\/\/prwatech.in\/data-science-training-institutes-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Data Scientist<\/a>, then stop just dreaming, get your Data Science certification course from India\u2019s Leading <a title=\"Data Science Training Institute\" href=\"https:\/\/prwatech.in\/data-science-training-institutes-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Data Science training institute<\/a>.<\/p>\n<p>Many Machine Learning algorithms need to covert categorical data into numerical data as they cannot handle categorical variables. Also, the performance of algorithms will vary based on how the categorical variables are encoded. In this blog, we will learn types of categorical data encoding and how to convert categorical data to numerical data with detailed information. Do you want to know categorical data encoding in machine learning, So follow the below mentioned Python <strong>categorical data encoding<\/strong> guide from <a title=\"Prwatech\" href=\"http:\/\/prwatech.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Prwatech<\/a> and take advanced <a title=\"Data Science Training\" href=\"https:\/\/prwatech.in\/data-science-training-institutes-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Data Science training<\/a> like a pro from today itself under 10+ Years of hands-on experienced Professionals.<\/p>\n<h2>Advantages of Data Encoding<\/h2>\n<p>In practical datasets, there is a variety of categorical variables. These variables represent different characteristics which are generally stored in text values. For example: In some cases, the gender category like Male, Female, weather can have categories like \u2018sunny\u2019, \u2018rainy\u2019 or \u2018cold\u2019, size having categories like \u2018Small\u2019, \u2018Medium\u2019, \u2018Large\u2019. We have to utilize this kind of data for analysis. Many machine learning algorithms can process these categorical values without further manipulation or encoding, but there are many algorithms too that do not support these formats. So in those cases, it is mandatory that, the data set should be manipulated to get these text attributes into numerical values for further processing.<\/p>\n<h2>Types of Categorical Data Encoding<\/h2>\n<p>There cannot be a single answer about how to approach this problem. Different approaches come with different potential impact on the result of the analysis. So here an overview is given for data encoding approaches used mostly for categorical data.<\/p>\n<h3><strong>Label Encoding in Machine Learning<\/strong><\/h3>\n<p>It is one of the popular techniques used to encode categorical data. It is nothing but converting each text value in a column to a number. Label encoding means to convert the labels into some machine-readable values format. For example, if the column named \u2018Intensity\u2019 contains categorical values like LOW, MEDIUM, HIGH. Then with label encoding, a unique number is assigned to each one alphabetically as.<\/p>\n<p>HIGH=0<\/p>\n<p>LOW =1<\/p>\n<p>MEDIUM =2<\/p>\n<p>From here we come to know the weightage of a particular category.<\/p>\n<h3>How to convert Categorical Data to Numerical Data on Label Encoding?<\/h3>\n<p>Let\u2019s see an example on Label Encoding:<\/p>\n<table width=\"495\">\n<tbody>\n<tr>\n<td width=\"62\"><strong>age<\/strong><\/td>\n<td width=\"113\"><strong>Gender<\/strong><\/td>\n<td width=\"89\"><strong>BMI<\/strong><\/td>\n<td width=\"111\"><strong>Diabetes<\/strong><\/td>\n<td width=\"120\"><strong>region<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"62\">19<\/td>\n<td width=\"113\">female<\/td>\n<td width=\"89\">27.9<\/td>\n<td width=\"111\">yes<\/td>\n<td width=\"120\">southwest<\/td>\n<\/tr>\n<tr>\n<td width=\"62\">18<\/td>\n<td width=\"113\">male<\/td>\n<td width=\"89\">33.77<\/td>\n<td width=\"111\">no<\/td>\n<td width=\"120\">southeast<\/td>\n<\/tr>\n<tr>\n<td width=\"62\">28<\/td>\n<td width=\"113\">male<\/td>\n<td width=\"89\">33<\/td>\n<td width=\"111\">no<\/td>\n<td width=\"120\">southeast<\/td>\n<\/tr>\n<tr>\n<td width=\"62\">33<\/td>\n<td width=\"113\">male<\/td>\n<td width=\"89\">22.705<\/td>\n<td width=\"111\">yes<\/td>\n<td width=\"120\">northwest<\/td>\n<\/tr>\n<tr>\n<td width=\"62\">32<\/td>\n<td width=\"113\">male<\/td>\n<td width=\"89\">28.88<\/td>\n<td width=\"111\">no<\/td>\n<td width=\"120\">northwest<\/td>\n<\/tr>\n<tr>\n<td width=\"62\">31<\/td>\n<td width=\"113\">female<\/td>\n<td width=\"89\">25.74<\/td>\n<td width=\"111\">no<\/td>\n<td width=\"120\">southeast<\/td>\n<\/tr>\n<tr>\n<td width=\"62\">46<\/td>\n<td width=\"113\">female<\/td>\n<td width=\"89\">33.44<\/td>\n<td width=\"111\">yes<\/td>\n<td width=\"120\">southeast<\/td>\n<\/tr>\n<tr>\n<td width=\"62\">37<\/td>\n<td width=\"113\">female<\/td>\n<td width=\"89\">27.74<\/td>\n<td width=\"111\">no<\/td>\n<td width=\"120\">northwest<\/td>\n<\/tr>\n<tr>\n<td width=\"62\">37<\/td>\n<td width=\"113\">male<\/td>\n<td width=\"89\">29.83<\/td>\n<td width=\"111\">no<\/td>\n<td width=\"120\">northeast<\/td>\n<\/tr>\n<tr>\n<td width=\"62\">60<\/td>\n<td width=\"113\">female<\/td>\n<td width=\"89\">25.84<\/td>\n<td width=\"111\">no<\/td>\n<td width=\"120\">northwest<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Let\u2019s go step by step:<\/strong><\/p>\n<h3>First, we have to check the columns, which contain dtype as a category. For that:<\/h3>\n<p>df=pd.read_csv (\u201c<em>Your File Path<\/em>\u201d)<\/p>\n<p>df<\/p>\n<p><strong>Output:<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4637\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod2.jpg.png\" alt=\"Categorical Data Encoding - Label encoding in Machine Learning\" width=\"850\" height=\"917\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod2.jpg.png 353w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod2.jpg-278x300.png 278w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Then check the data types of columns in df<\/h3>\n<p>df.dtypes<\/p>\n<p><strong>Output:<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4638\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod3.png\" alt=\"Categorical Data Encoding - Label encoding object in Machine Learning\" width=\"850\" height=\"425\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod3.png 310w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod3-300x150.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>It shows that although columns \u2018Gender\u2019, \u2019Diabetes\u2019 and \u2018region\u2019 are of categorical type, their data type is \u2018object\u2019. Let\u2019s test on the field \u2018Gender\u2019. We will convert its type to category.<\/h3>\n<p>df[\u2018Gender\u2019]=df[\u2018Gender\u2019].astype(\u2018category\u2019)<\/p>\n<p>df.[\u2018Gender\u2019].dtype<\/p>\n<p><strong>Output:<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4639\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod4.jpg.png\" alt=\"Categorical Data Encoding - Label encoding output in Machine Learning\" width=\"850\" height=\"159\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod4.jpg.png 498w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod4.jpg-300x56.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Now we can apply <strong>codes<\/strong> on the column named \u2018Gender\u2019 to convert its text values into numerical values.<\/h3>\n<p>df[\u2018Gender\u2019]=df[\u2018Gender\u2019].cat.codes<\/p>\n<p>df<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4640\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod5.jpg.png\" alt=\"Categorical Data Encoding - Label encoding example in Machine Learning\" width=\"850\" height=\"871\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod5.jpg.png 373w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod5.jpg-293x300.png 293w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>As we can see in the result the column has been converted into 0 and 1 (female &#8211; 0, male &#8211; 1). In this manner, we can apply the <strong><em>cat.codes<\/em><\/strong> to all columns.<\/p>\n<p>In the above case, the columns were limited and we could count the categories in each column easily. But the solution gets critical if the number of columns and categories gets increased. So in that case scikit-learn&#8217;s Label Encoder comes in picture.<\/p>\n<p>For this, we have to import LabelEncoder from sklearn.preprocessing<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4641\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod6.jpg.png\" alt=\"Categorical Data Encoding - Label encoder from sklearn in Machine Learning\" width=\"850\" height=\"105\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod6.jpg.png 395w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod6.jpg-300x37.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>And now we can select and encode the expected columns as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4642\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod7.png\" alt=\"Categorical Data Encoding - Label encoder in Machine Learning\" width=\"850\" height=\"755\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod7.png 547w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod7-300x267.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>Here we get all selected columns in the form of numerical values.<\/p>\n<p>But in the case of Label encoding, there is a problem of misinterpretation of numerical values while analysis and processing. For example, here region category is present, in that different regions are assigned with different numeric values. In further processing, the more weightage can be given to the category \u2018southwest\u2019 as it has value 4. This unwanted weight interpretation can miss guiding the machine learning algorithm.<\/p>\n<h3><strong>One Hot Encoding in Machine Learning:<\/strong><\/h3>\n<p>One hot encoding means a strategy to encode each category value into a new column and allocate a 1 or 0 (True\/False) value to the column. Unlike Label Encoding, it will not weight values improperly. Let\u2019s see the above example with one hot encoder. For that, we have to import Label Encoder as shown in the above example.\u00a0 Then we will apply function get_dummies as follows:<\/p>\n<p>df=pd.get_dummies(df,columns=[\u2018Gender\u2019,\u2018Dibetes\u2019,\u2018region\u2019])<\/p>\n<p>df<\/p>\n<p><strong>The result will be dummied columns with categories in those, for selected columns:<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4649\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/Table.jpg\" alt=\"Categorical Data Encoding - One hot encoding in Machine Learning\" width=\"850\" height=\"402\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/Table.jpg 688w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/Table-300x142.jpg 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>Although one-hot encoding solves the problem of unequal weights given to categories, it is not very useful when there are too many categories featuring a column, since that will result in the creation of new columns in the table leading to an increase in the total dataset.<\/p>\n<h3><strong>Binary Encoding in Machine Learning<\/strong><\/h3>\n<p>In this technique, first, the categories are encoded in integers, and then those integers are converted into binary code, then the digits from that binary string are split into separated columns. In comparison with one hot encoder, this technique encodes data with lower dimensionality.\u00a0 We can use a binary encoder by just installing category_encoders as follows:<\/p>\n<p>pip install category_encoders<\/p>\n<p>import category_encoders as ce<\/p>\n<p><strong>Now we can apply binary encoder as follows:<\/strong><\/p>\n<p>dfbin=df.copy()<\/p>\n<p>binencode=ce.BinaryEncoder(cols=[\u2018Gender\u2019, \u2018Dibetes\u2019,\u2018region\u2019])<\/p>\n<p>df_binary =binencode.fit_transform(dfbin)<\/p>\n<p>df_binary<\/p>\n<h3><strong>Result:<\/strong><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4643\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod8.jpg.png\" alt=\"Categorical Data Encoding - Binary Encoding in Machine Learning\" width=\"850\" height=\"421\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod8.jpg.png 636w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod8.jpg-300x149.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>We hope you understand Categorical Data Encoding in Machine Learning concepts and types of categorical data encoding, how to convert categorical data to numerical data. Get success in your career as a <a title=\"Data Scientist\" href=\"https:\/\/prwatech.in\/data-science-training-institutes-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Data Scientist<\/a> by being a part of the <a title=\"Prwatech\" href=\"http:\/\/prwatech.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Prwatech<\/a>, India&#8217;s leading <a title=\"Data Science training institute in Bangalore\" href=\"https:\/\/prwatech.in\/data-science-training-institutes-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Data Science training institute in Bangalore<\/a>.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/EGbyBqFlTcQ\" width=\"850\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Approaches for Categorical Data Encoding Categorical Data Encoding, Are you the one who is looking forward to knowing the types of categorical data encoding in machine learning? Or the one who is looking forward to knowing Categorical Data Encoding concepts in Machine Learning or Are you dreaming to become to certified Pro Machine Learning Engineer [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,1696],"tags":[411,1748,1749,412],"class_list":["post-4635","post","type-post","status-publish","format-standard","hentry","category-machine-learning","category-machine-learning-modules","tag-categorical-data-encoding","tag-categorical-data-encoding-techniques-by-krishnakanth-naik-jarapala","tag-feature-engineering-for-machine-learning-categorical-encoding","tag-how-to-convert-categorical-data-to-numerical-data"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A Complete Guide to Categorical Data Encoding - Prwatech<\/title>\n<meta name=\"description\" content=\"Learn about Categorical Data encoding advanaced tutorial &amp; learn types of Data encoding, how to convert categorical data to numerical data.\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Complete Guide to Categorical Data Encoding - Prwatech\" \/>\n<meta property=\"og:description\" content=\"Learn about Categorical Data encoding advanaced tutorial &amp; learn types of Data encoding, how to convert categorical data to numerical data.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/\" \/>\n<meta property=\"og:site_name\" content=\"Prwatech\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prwatech.in\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-29T12:14:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-15T10:54:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1.jpg\" \/>\n<meta name=\"author\" content=\"Prwatech\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:site\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prwatech\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/\",\"url\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/\",\"name\":\"A Complete Guide to Categorical Data Encoding - Prwatech\",\"isPartOf\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1.jpg\",\"datePublished\":\"2020-01-29T12:14:41+00:00\",\"dateModified\":\"2024-03-15T10:54:40+00:00\",\"author\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\"},\"description\":\"Learn about Categorical Data encoding advanaced tutorial & learn types of Data encoding, how to convert categorical data to numerical data.\",\"breadcrumb\":{\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/#primaryimage\",\"url\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1.jpg\",\"contentUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1.jpg\",\"width\":939,\"height\":626},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/prwatech.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Categorical Data Encoding\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/prwatech.in\/blog\/#website\",\"url\":\"https:\/\/prwatech.in\/blog\/\",\"name\":\"Prwatech\",\"description\":\"Share Ideas, Start Something Good.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/prwatech.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\",\"name\":\"Prwatech\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"caption\":\"Prwatech\"},\"url\":\"https:\/\/prwatech.in\/blog\/author\/prwatech123\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Complete Guide to Categorical Data Encoding - Prwatech","description":"Learn about Categorical Data encoding advanaced tutorial & learn types of Data encoding, how to convert categorical data to numerical data.","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"A Complete Guide to Categorical Data Encoding - Prwatech","og_description":"Learn about Categorical Data encoding advanaced tutorial & learn types of Data encoding, how to convert categorical data to numerical data.","og_url":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/","og_site_name":"Prwatech","article_publisher":"https:\/\/www.facebook.com\/prwatech.in\/","article_published_time":"2020-01-29T12:14:41+00:00","article_modified_time":"2024-03-15T10:54:40+00:00","og_image":[{"url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1.jpg","type":"","width":"","height":""}],"author":"Prwatech","twitter_card":"summary_large_image","twitter_creator":"@Eduprwatech","twitter_site":"@Eduprwatech","twitter_misc":{"Written by":"Prwatech","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/","url":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/","name":"A Complete Guide to Categorical Data Encoding - Prwatech","isPartOf":{"@id":"https:\/\/prwatech.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/#primaryimage"},"image":{"@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/#primaryimage"},"thumbnailUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1.jpg","datePublished":"2020-01-29T12:14:41+00:00","dateModified":"2024-03-15T10:54:40+00:00","author":{"@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3"},"description":"Learn about Categorical Data encoding advanaced tutorial & learn types of Data encoding, how to convert categorical data to numerical data.","breadcrumb":{"@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/#primaryimage","url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1.jpg","contentUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/01\/dataencod1.jpg","width":939,"height":626},{"@type":"BreadcrumbList","@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/categorical-data-encoding\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prwatech.in\/blog\/"},{"@type":"ListItem","position":2,"name":"Categorical Data Encoding"}]},{"@type":"WebSite","@id":"https:\/\/prwatech.in\/blog\/#website","url":"https:\/\/prwatech.in\/blog\/","name":"Prwatech","description":"Share Ideas, Start Something Good.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prwatech.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3","name":"Prwatech","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","caption":"Prwatech"},"url":"https:\/\/prwatech.in\/blog\/author\/prwatech123\/"}]}},"_links":{"self":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/4635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/comments?post=4635"}],"version-history":[{"count":16,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/4635\/revisions"}],"predecessor-version":[{"id":10189,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/4635\/revisions\/10189"}],"wp:attachment":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media?parent=4635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/categories?post=4635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/tags?post=4635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}