<?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 Praveen kumar Arja on Medium]]></title>
        <description><![CDATA[Stories by Praveen kumar Arja on Medium]]></description>
        <link>https://medium.com/@praveen.arja?source=rss-5a8072fc6d55------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*wEeK13eqIQ59IV8H</url>
            <title>Stories by Praveen kumar Arja on Medium</title>
            <link>https://medium.com/@praveen.arja?source=rss-5a8072fc6d55------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 20:48:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@praveen.arja/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[Data Pre-Processing with Google Cloud Dataprep]]></title>
            <link>https://blog.searce.com/data-pre-processing-with-google-cloud-dataprep-dd2a50d23f19?source=rss-5a8072fc6d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd2a50d23f19</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Praveen kumar Arja]]></dc:creator>
            <pubDate>Thu, 14 Jun 2018 08:01:47 GMT</pubDate>
            <atom:updated>2018-06-14T11:11:56.289Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the most important things while building an Machine Learning based model is to prepare/cleanse the raw data. Working on one such project gave me a chance to explore one of Google’s product — <a href="https://cloud.google.com/dataprep/">Cloud Dataprep</a>. After a preliminary analysis of this dataset, my senior quickly realized that the dataset we are dealing with can leverage full capabilities of Google Cloud Dataprep for quicker data cleansing. I had just tested Cloud Dataprep at a high level before, and this was the opportunity to learn as much as I could about the application of Cloud Dataprep.</p><p>One of the main reasons to choose Dataprep is to reduce efforts of cleaning the dataset significantly. Another advantage of Dataprep is that it loads only sample of records from original dataset, increasing responsiveness while cleaning the dataset.</p><p>I thought I’d share my learning here using a sample dataset ‘USA Presidential Campaign Donations’ (<a href="https://clouddataprep.com/flows">link</a>) and try to understand Dataprep in-depth.</p><p>DataPreP can be launched from the Big Data part of <a href="https://console.cloud.google.com/">google cloud console</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*39I00kEkfwpies4GjylzMA.png" /></figure><p>There are some public datasets available here for practising. To create your own flow, click on Create Flow on the home page of Dataprep. Once the flow is created, I had to add datasets and import them on to this flow, which can be achieved in multiple ways:</p><ol><li>Upload datasets (CSV, JSON, or relational table formats) from your PC to the console</li><li>Import the datasets from Google cloud Data storage</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VccE8kWeqj0aeggke63ZhA.png" /><figcaption>Fig 2: Import datasets and add to the flow with the available options</figcaption></figure><p>As I was learning, I have loaded the available flow USA Presidential Campaign Donations, which has two pre-loaded datasets. Each flow has a ‘recipe’ which has the steps to clean/process the dataset. Click on edit recipe option (as shown in below screenshot) to preview samples (fig:4) from the original dataset.</p><h3><em>Dataset selection by Dataprep</em></h3><p>Dataprep selects a sample of records from the original dataset proportionally from the original distribution of the dataset. For example, if the original dataset has 200,000 records, Dataprep samples approximately 10,000 to 20,000 records for adding/editing a recipe. The picture in below shows the sample dataset on the console of Dataprep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OpbzAT8juJw_TVYH14nw4w.png" /><figcaption>Fig 3: User Interface of Dataprep once the dataset is loaded</figcaption></figure><p>Once the dataset is loaded, I was able to see the sample records as shown in above picture. Here we see the type of data for each column and a histogram of its distribution. Once I had an understanding of the dataset and data types, I’ve proceeded on adding the recipe to make changes on this sample of records. Below are the steps I have implemented to process the dataset.</p><p>I wanted to remove the unnecessary columns or rename columns or change the data type (like changing string to number). I have clicked on add step on Dataprep as shown in the screenshot below (the transformation is on the right side of the picture). I have selected ‘Rename columns’ transformation and selected the column8 to change it’s name to ‘party_Affliation’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jQVf1_qW9-4apRTO9W__Tw.png" /><figcaption>Fig 4: Renamed column8 to ‘Party_Affliation’</figcaption></figure><p>Another important step of data cleaning is to remove the columns with majority of missing values i.e. more than 50%. In order to check the percentage of missing values from each column, or analyse the column , I just had to click on any column dropdown menu (next to the column name) and click on column details. To go back to the previous screen, click on the grid tab on the top left. The screenshot in below shows the all details of column5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2AzSMWbcG7l6z_KH27k3yw.png" /><figcaption>Fig 4: Detailed description of a column, 59 % of missing records</figcaption></figure><p>The above picture shows about 59% missing records and it is ideal to drop these type of columns. I have dropped this column by adding a new step to the recipe and select the transformation ‘delete columns’ and select the columns as shown in the screenshot in below. I have removed up to 14 columns which are sparse and irrelevant for modelling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*5WFIn8D_ayveHUyqPsCNVg.png" /><figcaption>Fig 6: Deleting columns</figcaption></figure><p>Next important step in cleaning the dataset, is filling the missing values in the columns. We can either fill them with ‘NULL’ or fill with custom values. For ex: I wanted to fill the missing values in column7 (numerical column) with the column’s average value as shown in the picture below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H5JgZXZkft7m40IJe4GbXg.png" /><figcaption>Fig 7: Fill/replace missing values by apply formulae. The light orange column is a preview of the transformation.</figcaption></figure><p>Below picture shows processing of column 14. Column14 is a categorical column (string type) with 15,710 unique values. Using Dataprep, I could reduce them to 5 main categories with the help of conditional transformations. The detailed steps are provided after the below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*CnrJ1sUYmIQZvf9GFqTasw.png" /><figcaption>Fig 8: Original column14 had 15,000 plus categories. Post transformation it has come down to 5 categories — column14_new</figcaption></figure><p>Steps added to recipe to reduce categories in column 14:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*p8acKJXu12fvpAo7PkiXhg.png" /></figure><p>Steps 11 to 16 has big regular expression queries which helped me to reduce the number of categories significantly. Here, I have implemented if/else condition to check for the matched pattern. The set function will transform the entire record if it finds single match pattern. Eg: one of the record has ‘fire station office’, I have queried for ‘fire’ and used set function to transform the record with ‘fire station office’ to ‘fire’ and subsequently transform all the records in the column which has word ‘fire’ in it.</p><p>Once the set of steps are completed, I have run the job on the entire dataset by clicking on ‘Run Job’ button on the top right corner of the console. The processed dataset is saved in Google Cloud Storage bucket after the job is completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*srtbFnBt9_gqOhl3vrun8w.png" /><figcaption>Fig 10: The execution of Run job starts the job as seen on the left side of the image</figcaption></figure><p>To replicate the recipe on some other dataset, download the wrangle/csv for the recipe (which can be opened with any text editor) and copy the steps one by one into the recipe of new flow. Whilst copying the steps, one needs to carefully ensure the correct column names (from the source data set) are specified, to avoid errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0Ec8fq9Hl_j-m2p0_KM3w.png" /><figcaption>Fig 11: Downloading recipe</figcaption></figure><p>Thank you for reading this and I hope this helped you get started with DataPrep. Check out the rest of interesting stuff from our engineering blog <a href="https://medium.com/searce/tagged/data">here</a></p><p>Happy ‘Dataprep’ing. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd2a50d23f19" width="1" height="1" alt=""><hr><p><a href="https://blog.searce.com/data-pre-processing-with-google-cloud-dataprep-dd2a50d23f19">Data Pre-Processing with Google Cloud Dataprep</a> was originally published in <a href="https://blog.searce.com/">Searce</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>