<?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 Shlok Mittal on Medium]]></title>
        <description><![CDATA[Stories by Shlok Mittal on Medium]]></description>
        <link>https://medium.com/@shlok6368?source=rss-2a69ae9ec9d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mE1EwDigxu3x2xXvM3UMOg.jpeg</url>
            <title>Stories by Shlok Mittal on Medium</title>
            <link>https://medium.com/@shlok6368?source=rss-2a69ae9ec9d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 00:13:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shlok6368/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[Capturing Google Spreadsheet Edits (Change Log/ Audit Trail)]]></title>
            <link>https://medium.com/@shlok6368/capturing-google-spreadsheet-edits-change-log-with-apps-script-390a7aaa5d73?source=rss-2a69ae9ec9d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/390a7aaa5d73</guid>
            <category><![CDATA[edit-log]]></category>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[audit-trail]]></category>
            <category><![CDATA[google-app-script]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Shlok Mittal]]></dc:creator>
            <pubDate>Sun, 09 Jul 2023 18:32:04 GMT</pubDate>
            <atom:updated>2023-07-09T18:45:10.949Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*K_GFTHJpnGQ4YRhexggvHw.png" /></figure><h3>Introduction</h3><p>Google Spreadsheets is a popular tool for collaborative work, allowing multiple users to edit and update data simultaneously. However, keeping track of changes made to a spreadsheet can be challenging, especially when multiple people are involved. In this post, we’ll explore a solution using Google Apps Script to capture and log edits made to a spreadsheet. This solution can be valuable in scenarios <strong>where it’s necessary to maintain an audit trail or monitor data modifications.</strong></p><h3>Use Case: Audit Trail and Data Monitoring</h3><p>Imagine a scenario where a team is working on a shared spreadsheet containing sensitive information, such as financial records or customer data. It’s essential to track any changes made to the spreadsheet to maintain accountability, ensure data integrity, and identify potential errors or unauthorized modifications.</p><p>By implementing a solution that captures the timestamp, user details, cell, old value, new value, and sheet name for each edit, you can easily maintain an audit trail and monitor data modifications.</p><h3>Step-by-Step Guidance</h3><p>To implement the solution, follow these step-by-step instructions:</p><h4>Step 1: Open the Google Spreadsheet</h4><p>First, open the Google Spreadsheet where you want to capture the edits. This solution can be applied to any existing spreadsheet or a new one.</p><h4>Step 2: Access the Apps Script Editor</h4><p>In the menu bar, click on “Extensions” and select “Apps Script.” This will open the Apps Script editor in a new tab.</p><h4>Step 3: Replace Existing Code</h4><p>In the Apps Script editor, remove any existing code and replace it with the following code, and hit save:</p><pre>function onEdit(e) {<br>  var timestamp = new Date();<br>  var user = e.user;<br>  var cell = e.range.getA1Notation();<br>  var oldValue = e.oldValue;<br>  var newValue = e.value;<br>  var sheetName = e.source.getActiveSheet().getName();<br><br>  var logSheet = e.source.getSheetByName(&quot;Edit Log&quot;);<br><br>  if (logSheet == null) {<br>    logSheet = e.source.insertSheet(&quot;Edit Log&quot;);<br>    logSheet.appendRow([&quot;Timestamp&quot;, &quot;User&quot;, &quot;Cell&quot;, &quot;Old Value&quot;, &quot;New Value&quot;, &quot;Sheet Name&quot;]);<br>  }<br><br>  logSheet.appendRow([timestamp, user, cell, oldValue, newValue, sheetName]);<br>}</pre><h4>Step 5: Enable the Script</h4><p>To enable the script and start capturing edits, simply make any edit to the spreadsheet. This will trigger the onEdit function, capturing the relevant information for the edit.</p><h4>Step 6: View the Edit Log</h4><p>To view the captured edits, navigate to the spreadsheet and locate the sheet named “Edit Log.” This sheet will contain a log of all the edits made to the spreadsheet, including the timestamp, user details, cell, old value, new value, and sheet name.</p><h3>Conclusion</h3><p>By implementing this simple solution using Google Apps Script, you can easily capture and log edits made to a Google Spreadsheet. This can be valuable in various scenarios, such as maintaining an audit trail, monitoring data modifications, or ensuring data integrity. Feel free to customize the script to suit your specific requirements and enhance the logging capabilities.</p><p>I hope this post helps you effectively track and monitor edits made to your Google Spreadsheets. Happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=390a7aaa5d73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[End to End Data Science Pipeline using Python and Tabpy (Data Scraping, Data Cleaning, Model…]]></title>
            <link>https://medium.com/@shlok6368/end-to-end-data-science-pipeline-using-python-and-tabpy-data-scraping-data-cleaning-model-41b2dcb63667?source=rss-2a69ae9ec9d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/41b2dcb63667</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[tableau]]></category>
            <category><![CDATA[tabpy]]></category>
            <dc:creator><![CDATA[Shlok Mittal]]></dc:creator>
            <pubDate>Wed, 24 Jul 2019 02:47:48 GMT</pubDate>
            <atom:updated>2020-10-19T10:53:06.476Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Science Pipeline using Python and Tableau (Tabpy Integration)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wf1fehQ3WjpU1pTRXFhcQg.gif" /></figure><p><em>Tableau workbook, Jupyter notebooks and data files are available at : </em><a href="https://github.com/shlok6368/App-Rating-Predictor-Model-and-Tabpy-Integration"><em>https://github.com/shlok6368/App-Rating-Predictor-Model-and-Tabpy-Integration</em></a></p><h3><strong>Hypothetical Use Case</strong></h3><blockquote>Let’s Play Growth Accelerators: As an external consulting company who supports app development firms, the biggest challenge we face is when the ratings of our client’s app start falling. Since there are multiple factors which drive the ratings of the app, it is getting difficult for us to understand what we should focus on (For e.g. position the app differently, reduce the size of the app, focus on getting more installs etc.). Our client gives us an extra bonus if we can drive their app rating above 4.5.</blockquote><h3><strong>The Ask</strong></h3><blockquote>Build a tool with an integrated machine learning model so that we can conduct scenario analysis for any app across categories based on following features: Category, Content Rating, Editor’s Choice or not, Free Or Paid, In App Purchases or not, Number of Installs, Price, Required Android Version, Number Reviews, Size(MB)</blockquote><h3><strong>The Solution</strong></h3><h4>Solution Introduction</h4><p>The developed Tableau dashboard predicts the probability of an app achieving a rating above 4.5 based on the scenario parameters. Users can test out scenarios on the fly by changing the parameters on the left hand side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*qtpD-lwPk9teYmxwouFBYA.png" /><figcaption>Solution’s UI (Tableau)</figcaption></figure><h4><strong>Solution Demo</strong></h4><p><strong>Initial Selection:</strong> Estimated number of reviews = 0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*qtpD-lwPk9teYmxwouFBYA.png" /></figure><p><strong>Change 1:</strong> Everything else remaining the same, Increase the estimated number of reviews from 0 to ~1 million. The probability of app making it to rating &gt; 4.5 <strong>increases from 10.3% to 60.6%</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*cIJT8C_355Iw2otcWwr7wg.png" /></figure><p><strong>Change 2:</strong> Everything else remaining the same, Increase the estimated number of reviews to ~2 million. The probability of app making it to rating &gt; 4.5 <strong>increases from 60.6% to 95.5%</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*TCqnXK0GlfeLpNJT2-QdjQ.png" /></figure><p>Pretty cool! We were able to hide all the complexities or technicalities from the user. They only see what they need to go about for their business.</p><p>Let’s see now how we can build this solution from scratch.</p><h3>Solution Building from Scratch</h3><h4>Data Collection</h4><p>Data about apps was collected by scraping Google play store using play_scraper library. Collections which were scrapped were <strong><em>Top Free, Top Paid and Trending</em></strong>. From each of these collections information about apps <strong><em>in first 5 pages of 49 categories</em></strong>.</p><p><em>49 Google Play store Categories:</em></p><blockquote>Android Wear, Art And Design, Auto And Vehicles, Beauty, Books And Reference, Business, Comics, Communication, Dating, Education, Entertainment, Events, Family, Family Action, Family Brain games, Family Create, Family Education, Family Music Video, Family Pretend, Finance, Food And Drink, Game, Game Action, Game Adventure, Game Arcade, Game Board, Game Card, Game Casino, Game Casual, Game Educational, Game Music, Game Puzzle, Game Racing, Game Role Playing, Game Simulation, Game Sports, Game Strategy, Game Trivia, Game Word, Health And Fitness, House And Home, Libraries And Demo, Lifestyle, Maps And Navigation, Medical, Music And Audio, News And Magazines, Parenting, Personalization, Photography, Productivity, Shopping, Social, Sports, Tools, Travel And Local, Video Players, Weather.</blockquote><p><em>Python code:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*6TY3hVpYNsuvKPyrYtt-nA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*LRe1KHWrHmid-Upu8mFTqg.png" /></figure><h4>Data Cleaning</h4><blockquote><em>Remove non informative columns</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*nVr09LjX-NFU1P997WTyDQ.png" /></figure><blockquote><em>Check for missing values and impute/ exclude</em></blockquote><p>Missing values were found in Rating score, required android version, developer and number of installs. In our case we excluding these records.</p><p><em>Python Code:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*zF5aeOzRATVIZAprklUnXw.png" /></figure><blockquote>Cleanup field values</blockquote><p>· Remove ‘[],’ from Category and Content Rating fields</p><p>· Remove ‘$’ from Price field and converted the field to numeric</p><p>· Remove ‘+’ from Installs field and converted the field to numeric</p><p>· Clean up Required Android Version and impute 0 where it was not available</p><p>· Clean up Size ( Impute 0 where Size was not available, Convert KBs to MBs, Convert the field to numeric)</p><p><em>Python Code:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*ozuOeWmZVeDpXabseHPhKQ.png" /></figure><h4>Outlier Removal</h4><p>Looking at the distribution of Installs, we know that the distribution is highly skewed. Since we are creating a model whose purpose is to generalize the relationship among variables, we will exclude the outliers (&lt;5th percentile and &gt;95th percentile) from out dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*K3GLKfpt4wjUc1MI16jQCw.png" /></figure><p>Cool! Now our dataset is ready to be trained. So let’s proceed.</p><h4>Model Development and Deployment on Tabpy server</h4><blockquote>Load necessary libraries and cleaned data</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*myc7MMMGDpYy-gKjObZPMA.png" /></figure><blockquote>Encoding categorical data so that it can be used in model input</blockquote><p>Convert the target variable ‘Rating Score’ to Binary variable with two values<strong><em>: “Good” if rating &gt; 4.5 and “Bad” if rating is &lt;= 4.5</em></strong>. Name the new variable as RATING_SCORE_CODED.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*9TioaOi0g6XW4vdcDbAonA.png" /></figure><blockquote>Split the data into Training and Test sets</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*8OZp6il85YRUiQ5484ajXg.png" /></figure><blockquote>Normalize the data</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*ZcN8UHWZBhyBJdGvIoz4Jw.png" /></figure><blockquote>Train a logistic regression model which predicts the rating category (good or bad) based on the explanatory variables</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*vxYkijr9kaBg10jdFK7T3w.png" /></figure><p>The accuracy on test set is <strong>~ 0.767. </strong>This accuracy is good enough for Iteration 1 of the model</p><blockquote>Create the function to be deployed</blockquote><p>For deployment of model on Tabpy server we need to put this model in a function which will take the values of explanatory variables as arguments and returns the probability of an app being Good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*uL2iDcrgeiMEqjsZ9cBMUQ.png" /></figure><blockquote>Model deployment</blockquote><p>· Start the server by executing the “startup.cmd” file located under your Tabpy folder. In my case its at “C:\Users\admin\Anaconda3\Lib\site-packages\TabPy-0.6.1”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*DcKN_D5PhWe30xesD4jMWw.png" /></figure><p>Now, with the server up and running, and the model deployed on server, Tableau will be able to pass on arguments and fetch the probability of an app being “Good” on the fly.</p><h4>Tableau calculated field</h4><p>This is the final step for us. In this step we will create a calculated field in Tableau workbook which will pass the parameter values to the deployed model and will fetch the model output as its value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*UarXJ1J8mIXGMGiVRefl4A.png" /></figure><p>Woah! Too much to take in for one article. But I hope you find this tutorial somewhat useful.</p><p>If you read this till here that itself means you are interested in learning more about such use cases. Feel free to like, share and comment.</p><p>P.S. This is my first post, so your constructive feedback will be much appreciated.</p><p>Keep Exploring,</p><p>Shlok Mittal</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41b2dcb63667" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>