<?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 Dipanwita Basak on Medium]]></title>
        <description><![CDATA[Stories by Dipanwita Basak on Medium]]></description>
        <link>https://medium.com/@dipanwitaiim?source=rss-944c02fddcc0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fCHHRw-Y3Hgaruq0PQVERw.jpeg</url>
            <title>Stories by Dipanwita Basak on Medium</title>
            <link>https://medium.com/@dipanwitaiim?source=rss-944c02fddcc0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:54:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dipanwitaiim/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[Application Programming Interface: API- Complete Guide 1-0-1]]></title>
            <link>https://medium.com/@dipanwitaiim/application-programming-interface-api-complete-guide-1-0-1-b064aebc917b?source=rss-944c02fddcc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b064aebc917b</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[xml]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[soap-api]]></category>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[Dipanwita Basak]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 17:20:28 GMT</pubDate>
            <atom:updated>2026-01-06T17:12:17.986Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Application Programming Interfaces, commonly known as APIs, are one of the most critical building blocks of modern software systems. Almost every digital service today relies on APIs to function correctly. Whether it is a mobile application fetching data from a server, a payment gateway processing transactions, or two backend services exchanging information, APIs enable these interactions. API is nothing but a set of protocols that allow different software applications to communicate and exchange data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*rAVl0g5ELFS7uB_ct7ZBvA.png" /></figure><p>In earlier generations of software, applications were often built as monolithic systems where all components were tightly coupled. As software systems grew larger and more complex, this approach became difficult to maintain. APIs emerged as a solution that allowed systems to be broken down into smaller, manageable, and reusable components. Today, APIs are not just a technical concept. They are strategic assets that power ecosystems, enable partnerships, and create new business models. Companies like Google, Amazon, Meta, and Stripe have built entire platforms around APIs</p><h3>What is an API?</h3><p>An API, or Application Programming Interface, is a formal contract that defines how one software application can interact with another. This contract specifies the available operations, the required input parameters, and the structure of the responses. At its core, an API hides the internal complexity of a system and exposes only what is necessary for interaction. This abstraction allows developers to use functionality without understanding how it is implemented internally. A key aspect of APIs is consistency. Once an API contract is published, consumers rely on it. Breaking changes can disrupt multiple applications, which is why careful API design and versioning are essential.</p><p>In simple words, an API is a <strong>messenger</strong> that takes a request from one system, delivers it to another system, and brings back the response.</p><h3>Real World Analogy for APIs</h3><p>A commonly used analogy to explain APIs is that of a restaurant. When you visit a restaurant, you do not enter the kitchen or interact with the chefs directly. Instead, you communicate your request through a waiter. The waiter takes your order, ensures it is valid, and returns with the prepared food. In this analogy, the customer represents the client application, the waiter represents the API, and the kitchen represents the backend system. The menu corresponds to API documentation, and the food served is the API response. This analogy highlights key API characteristics such as abstraction, validation, and controlled access</p><p>Imagine you are sitting in a restaurant:</p><p><em>You (customer) → Client</em></p><p><em>Menu → API documentation</em></p><p><em>Waiter → API</em></p><p><em>Kitchen → Server / Backend system</em></p><p><em>Food → Response</em></p><p>You:</p><ol><li>Choose an item from the menu</li><li>Tell the waiter</li><li>Waiter passes request to kitchen</li><li>Kitchen prepares food</li><li>Waiter delivers food back</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*y-Mv-YujkFnFT_AS6tg9xA.png" /></figure><p>You <strong>never enter the kitchen</strong>, and you <strong>don’t care how food is cooked</strong>.<br> Similarly, clients never access backend logic directly — they only interact through APIs.</p><h3>Why APIs Are Needed</h3><p>APIs exist to solve several fundamental problems in software engineering. Without APIs, applications would need direct access to databases or internal services, leading to tight coupling. Tightly coupled systems are fragile. A small change in one part of the system can cause failures in multiple dependent applications. APIs decouple systems by providing a stable interface. Additionally, APIs improve security by acting as a controlled gateway. Instead of exposing databases directly, APIs enforce authentication, authorization, and validation rules.</p><h3>Key Benefits of APIs</h3><p><strong>Abstraction- </strong>Internal logic hidden, Only interface exposed</p><p><strong>Reusability- </strong>Same API used by web, mobile, partners</p><p><strong>Scalability- </strong>Backend and frontend scale independently</p><p><strong>Speed of Development- </strong>Teams work in parallel</p><p><strong>Security- </strong>Controlled access via authentication</p><p><strong>Ecosystem Creation- </strong>Third-party developers build on top of APIs</p><h3>API Architecture Overview</h3><p>a) <strong>Client Server Architecture</strong>-In a typical API-based architecture, a client application communicates with an API layer over HTTP or HTTPS. The API layer handles request validation, authentication, and routing. Behind the API layer, one or more backend services process business logic and interact with databases or external systems. The response is then sent back to the client in a standardized format. This layered architecture improves scalability, maintainability, and fault isolation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/0*s74GeAAqWCEjRdHz.jpeg" /></figure><p>b) <strong>Stateless Architecture- </strong>Most APIs (especially REST APIs) are <strong>stateless</strong>.</p><p>Stateless means:</p><ul><li>Server does not store client session</li><li>Each request contains all required information</li><li>Improves scalability and reliability</li></ul><h3>A Brief History of APIs</h3><ul><li><strong>1960s–1970s: Early Interfaces</strong> APIs began as libraries and system calls in early operating systems. They were not networked but allowed programs to reuse code.</li><li><strong>1980s–1990s: Software Libraries &amp; Protocols</strong> APIs expanded into standardized libraries (like Windows API or POSIX). They defined how applications interacted with operating systems.</li><li><strong>2000s: Web APIs &amp; SOAP</strong> With the rise of the internet, APIs became networked. SOAP (Simple Object Access Protocol) was one of the first widely adopted standards, using XML for structured communication.</li><li><strong>2010s: REST &amp; JSON Revolution</strong> REST (Representational State Transfer) became dominant because it was lightweight, stateless, and used human-readable JSON. This era saw the explosion of public APIs (Twitter, Facebook, Google Maps).</li><li><strong>2020s: GraphQL, gRPC, and AI APIs</strong> GraphQL introduced flexible querying, while gRPC optimized performance with binary protocols. AI APIs (like Copilot’s) emerged, enabling natural language interaction with complex systems.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*QW5cVkyRQt3gEKmWhfsu4A.png" /></figure><h3>HTTP Fundamentals for APIs</h3><p>Most modern APIs are built using the HTTP protocol. HTTP is a request-response protocol that operates over the internet. Its simplicity and wide adoption make it ideal for APIs. An HTTP request consists of a method, a URL, headers, and an optional body. The server processes the request and returns an HTTP response containing a status code, headers, and a body. HTTPS is the secure version of HTTP and uses encryption to protect data in transit. All production APIs should use HTTPS.</p><h3>API Protocols and Styles</h3><p><strong>REST API Principles- </strong>REST, or Representational State Transfer, is an architectural style rather than a strict standard. They are the most widely used style.REST APIs are stateless, meaning each request contains all necessary information. Resources are identified by URLs, and standard HTTP methods are used to operate on them. REST APIs commonly use JSON as the data exchange format.</p><ol><li>Stateless</li><li>Resource-based</li><li>Uses HTTP</li><li>Cacheable</li><li>Client–server separation</li></ol><p>Example-</p><p>/users<br>/orders<br>/products/123</p><p><strong>SOAP API Principles- </strong>SOAP, or Simple Object Access Protocol, use XML and rely on strict contracts defined by WSDL files. They are commonly found in legacy enterprise systems.</p><ul><li>XML based</li><li>Strict standards</li><li>Heavy and verbose</li><li>Used in banking and legacy systems</li></ul><p>SOAP uses:</p><ul><li>WSDL</li><li>XML</li><li>Strict schemas</li></ul><p><strong>GraphQL API</strong>- GraphQL APIs allow clients to specify exactly what data they need, reducing over-fetching. However, they introduce complexity in caching and monitoring.</p><ul><li>Developed by Facebook</li><li>Client decides what data it needs</li><li>Single endpoint</li></ul><p>{<br> user {<br> name<br> email<br> }<br>}</p><p><strong>gRPC- </strong>These APIs use binary protocols and are optimized for high-performance communication between microservices</p><ul><li>Developed by Google</li><li>High-performance</li><li>Uses Protocol Buffers</li><li>Mostly for microservices</li></ul><h3>HTTP Fundamentals of API</h3><p>Most modern APIs are built using the HTTP protocol. HTTP is a request-response protocol that operates over the internet. Its simplicity and wide adoption make it ideal for APIs. An HTTP request consists of a method, a URL, headers, and an optional body. The server processes the request and returns an HTTP response containing a status code, headers, and a body. HTTPS is the secure version of HTTP and uses encryption to protect data in transit. All production APIs should use HTTPS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*SgLxjnTWMIpSvz_sO4ellw.png" /></figure><p>API Example-</p><p>POST /users<br>Headers:<br>Authorization: Bearer token<br>Content-Type: application/json</p><p>Body:<br>{<br> “name”: “Dipanwita”,<br> “email”: “<a href="/service/mailto:test@email.com">test@email.com</a>”<br>}</p><p><strong>HTTP Methods-</strong></p><p>HTTP methods, also known as verbs, define the type of action the client wants to perform. The GET method is used to retrieve data and should not modify server state. POST is used to create new resources. It is not idempotent, meaning repeated requests may create multiple resources. PUT replaces an existing resource entirely, while PATCH updates only specific fields. DELETE removes a resource from the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/183/1*Zp7PizWhce8hvsNxT-d_jA.png" /></figure><p><strong>HTTP Status Codes-</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*hXEOLe5g-1v0TsGGJ4HZrQ.png" /></figure><h3><strong>How to Write in Different API Data Formats</strong></h3><p><strong>API Contract Overview-</strong></p><p>An API contract defines how clients and servers exchange data. It must be agreed upon before implementation.</p><p>API Contract Flow Client → Request Format → Validation → Business Logic → Response Format → Client</p><p><strong>JSON Data Format-</strong></p><p>JSON is the most common API data format due to its simplicity and readability.</p><p><strong><em>JSON Request Example:</em></strong></p><p>{ “userId”: 101,</p><p>“fullName”: “Dipanwita Basak”,</p><p>“email”: “dipanwita@example.com”,</p><p>“isActive”: true }</p><p><strong><em>JSON Response Example:</em></strong></p><p>{</p><p>“status”: “success”,</p><p>“data”: { “userId”: 101,</p><p>“createdAt”: “2026–01–06T10:30:00Z” }</p><p>}</p><p><strong>Error Response Design-</strong></p><p>Error responses should be predictable and standardized across all APIs.</p><p>The flow: Request → Validation Failed → Error Code → Error Message → Client</p><p>Error Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*vu1nv9O_etD1Dr8CMjEoVA.png" /></figure><p><strong>Writing XML Data</strong></p><p>XML uses a tag-based structure and is common in legacy and enterprise systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*_-6_HSCSG-J_sKmpWw3CLg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b064aebc917b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Development 101: Building a Counter App Using HTML, CSS, and JavaScript: A Beginner’s Guide]]></title>
            <link>https://medium.com/@dipanwitaiim/web-development-101-building-a-counter-app-using-html-css-and-javascript-a-beginners-guide-23f8b4e9dfd9?source=rss-944c02fddcc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/23f8b4e9dfd9</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[js]]></category>
            <dc:creator><![CDATA[Dipanwita Basak]]></dc:creator>
            <pubDate>Sun, 04 Jan 2026 18:04:53 GMT</pubDate>
            <atom:updated>2026-01-05T07:38:23.492Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rp3vpLDuvupDC3lleM0L7A.png" /></figure><h3>Introduction:</h3><p>One of the simplest and most illustrative projects for someone learning web development is a <strong>Counter App</strong>. This project demonstrates the core functionality of web development: creating structure using <strong>HTML</strong>, styling it using <strong>CSS</strong>, and adding dynamic behavior with <strong>JavaScript</strong>.</p><p>A Counter App is essentially a small webpage with a number displayed on the screen and two buttons: one to <strong>increase</strong> the number and one to <strong>decrease</strong> it. This app introduces beginners to <strong>variables, functions, events, and DOM manipulation in JavaScript </strong>— all essential skills for any web developer.</p><h3>1. Understanding the Core Concepts:</h3><ul><li><strong>HTML (Hyper Text Markup Language)</strong><br> HTML is used to define the <strong>structure</strong> of your webpage. For a Counter App, we need: A place to <strong>display the number, </strong>Buttons to <strong>increase</strong> and <strong>decrease</strong> the number</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*2pUXzm3y0IywGUPFxXjplw.png" /><figcaption>Fig- HTML is the structure of the building just as pillars to the building</figcaption></figure><ul><li><strong>CSS (Cascading Style Sheets)</strong><br> CSS is used to define the <strong>appearance</strong> of elements. This includes colors, fonts, button sizes, alignment, and spacing.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lLFR3rF9Qv9MQaR4ukyBxA.png" /><figcaption>Fig- Adding cement, tiles, design adds the style to the structure just like CSS</figcaption></figure><ul><li><strong>JavaScript</strong><br> JavaScript brings the webpage to life. It allows the Counter App to <strong>respond to user actions</strong> like clicking buttons and updating the number dynamically.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IzTu6fi0D8akytE7.png" /><figcaption>Fig- Adding electricity and wiring provides the lighting layout/ logic (JS)</figcaption></figure><ul><li><strong>DOM (Document Object Model)</strong><br> The DOM is a <strong>representation of the webpage</strong> that JavaScript can interact with. Using the DOM, we can <strong>find elements</strong> like the number display and <strong>change their values</strong>.</li><li><strong>Events</strong><br> Events are actions that occur on a webpage, like clicks or keypresses. In the Counter App, <strong>click events</strong> trigger JavaScript functions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h_kVBBMDmiPoSPKi.png" /><figcaption>Fig- Clicking on the light bulb is when an event of switching on/ off the light occurs</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3lOgl8ylACLmbOJ1wo2LRA.png" /></figure><h3>2. Setting up the Project:</h3><p>To keep things simple, we will create three files using <strong>Notepad</strong>:</p><ol><li>index.html → Structure</li><li>style.css → Styling</li><li>script.js → Behavior</li></ol><p>We also created a folder called counter-app and save all three files inside it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*u8EmvaNYHU7ncNw7SRKmhw.png" /></figure><h3>3. HTML Core Code Snippets:</h3><ul><li>&lt;!DOCTYPE html&gt; → Declares the document type as HTML5.</li><li>&lt;h1&gt; → Displays the title “Counter App”. (Heading 1)</li><li>&lt;h2 id=&quot;count&quot;&gt;0&lt;/h2&gt; → Shows the number. The id=&quot;count&quot; allows JavaScript to access it.</li><li>&lt;button onclick=&quot;decrease()&quot;&gt;-&lt;/button&gt; → Button to <strong>decrease</strong> the number. The onclick attribute calls the decrease() function in JavaScript.</li><li>&lt;button onclick=&quot;increase()&quot;&gt;+&lt;/button&gt; → Button to <strong>increase</strong> the number.</li><li>&lt;script src=&quot;script.js&quot;&gt;&lt;/script&gt; → Links the JavaScript file to the HTML page.</li></ul><h3>4. Styling the App with CSS:</h3><p>CSS improves the appearance and layout: CSS does not affect functionality but makes the app visually appealing and user-friendly.</p><ul><li>body { text-align: center; } → Centers the content horizontally.</li><li>margin-top: 100px; → Moves the content slightly down the page.</li><li>background-color: #f0f0f0; → Gives a light gray background.</li><li>h2 { font-size: 48px; } → Makes the counter number large and readable.</li><li>button { cursor: pointer; } → Changes the cursor when hovering over buttons to indicate they are clickable</li></ul><h3>5. Adding the functionality/ logic with Javascript:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*hx-8FaHS9p2kTpKhk53M1A.png" /></figure><p><strong>DOM manipulation</strong> is key here: document.getElementById() allows JS to interact with HTML elements.</p><h3>6. Running the Application:</h3><ul><li>Open the folder counter-app.</li><li>Double-click index.html.</li><li>The browser opens your Counter App.</li><li>Click <strong>+</strong> → number increases.</li><li>Click — → number decreases.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23f8b4e9dfd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploratory Data Analysis (EDA) of the Wine Quality Dataset]]></title>
            <link>https://medium.com/@dipanwitaiim/exploratory-data-analysis-eda-of-the-wine-quality-dataset-925586d46da2?source=rss-944c02fddcc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/925586d46da2</guid>
            <category><![CDATA[eda]]></category>
            <dc:creator><![CDATA[Dipanwita Basak]]></dc:creator>
            <pubDate>Sun, 04 Jan 2026 16:36:18 GMT</pubDate>
            <atom:updated>2026-01-04T16:57:25.295Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*pyAWiPq4zfCklA6qhFV9DA.png" /><figcaption>When we say that grapes are sour, data says how sour?</figcaption></figure><h3>Introduction</h3><p>Exploratory Data Analysis (EDA) is a foundational process in any data science workflow. Through EDA, we aim to understand the <strong>structure, patterns, distributions, </strong>and<strong> relationships</strong> within a dataset before applying advanced modeling or prediction techniques.</p><p>In this project, the focus is on the <strong>Wine Quality dataset</strong>, which contains physicochemical measurements of wines accompanied by sensory quality ratings. The objective is to uncover<strong> insights about the data, examine relationships</strong> between features and quality, and identify properties that influence the perceived quality of wine.</p><h3>Dataset Overview</h3><p>The Wine Quality dataset consists of data collected from wine samples with attributes describing physicochemical properties and an output variable representing the wine’s quality score. Originally sourced from the UCI Machine Learning Repository and popularized through Kaggle, this dataset includes <strong>red and white wine samples</strong> that measure chemical features such as acidity, sulphates, alcohol content, density, and residual sugar</p><p>Key Features/ Variables-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*jPXStu7xi6pfWB4k6X9tiA.png" /></figure><p>These features are numerical and span different scales. During EDA, each feature’s distribution, summary statistics, and correlation with quality are examine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aYuD2T1Zf_lNKciCWVKc5A.png" /></figure><h3>Data Cleaning + Pre-processing</h3><p>Data Loading- The first step is loading the dataset into a Data Frame and inspecting the data types, rows, and columns. An initial check confirms that:</p><p><em>a) All features are numeric.</em></p><p><em>b) There are no missing values.</em></p><p><em>c) No further preprocessing is required for data types</em></p><p><em>d) No Missing values (hence no imputation handling of missing values)</em></p><h3>Univariate Analysis</h3><p>Univariate analysis involves examining each variable independently to understand its distribution.</p><p><strong>Quality Score Distribution</strong></p><p>The target variable, <strong>quality</strong>, typically ranges from <strong>3 to 9</strong> in this dataset, despite the theoretical 0–10 scale. A histogram of quality reveals: Most wines are rated between <strong>5 and 7</strong>. The distribution is roughly normal but skewed slightly left due to fewer high-quality wines. This suggests that average wines are more common, while extremely low or high scores are rare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*JQ5ljeshs0k3XqzDqEolUg.png" /></figure><p><strong>Feature Distributions:</strong></p><p>Histograms and boxplots for each physicochemical variable show interesting patterns:</p><p><strong>Alcohol</strong> levels vary widely, with most observations between moderate values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*R1f8RU723ATrDPBS4mrnuA.png" /></figure><p><strong>Volatile acidity</strong> shows right skew, indicating extremes are less common.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*7HcTx6ZqxMf6grLPyugJxA.png" /></figure><p><strong>Residual sugar</strong> has heavy tails, highlighting some wines with higher sugar content.</p><p><strong>Density</strong> values cluster tightly because wine density is close to water for most samples.</p><h3>Bivariate &amp; Correlation Analysis:</h3><ul><li><strong>Alcohol</strong> tends to have a <strong>positive correlation</strong> with quality (wines with higher alcohol often score higher).</li><li><strong>Volatile acidity</strong> shows a <strong>negative correlation</strong> with quality — high volatile acidity tends to correspond with poorer quality due to vinegary notes.</li><li><strong>Sulphates</strong> and <strong>citric acid</strong> also show mild positive correlation with quality.</li><li>Some features like <strong>density</strong> and <strong>pH</strong> show weak relationships with quality</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*BPIsiB5uIbk84-G0-ilMdQ.png" /></figure><p>This means that higher alcohol content often signifies better fermentation and balance, whereas higher volatile acidity can indicate spoilage or imbalance.</p><h4>Feature Interactions</h4><p>Pairwise scatterplots and correlation calculations can reveal multicollinearity between features:</p><p><strong>Density</strong> and <strong>residual sugar</strong> often correlate, as more sugar increases density.</p><p><strong>Fixed acidity</strong> and <strong>pH</strong> relate due to their shared role in acidity profiles.</p><h3>Insights from Visualizations/ EDA</h3><ol><li>Higher <strong>alcohol</strong> groups tend to have median higher <strong>quality</strong> ratings. This suggests alcohol content is an important predictor.</li><li>As volatile<strong> acidity</strong> increases, <strong>quality</strong> tends to decrease.</li><li>High <strong>residual sugar </strong>often aligns with higher density. Histograms reinforced that high values are outliers and can be trimmed in visualization to focus on trends.</li></ol><h3>Outliers</h3><p>Outliers can impact modeling by skewing estimates. Boxplots show that variables like <strong>total sulfur dioxide</strong> and <strong>residual sugar</strong> have outliers at the upper range, which may require consideration in modeling or transformation (e.g., log scaling) if model assumptions require normality.</p><h3>Feature Engineering &amp; Target Transformation</h3><p>Quality scores can be categorized into bins:</p><ul><li><strong>Low quality</strong>: ≤ 5</li><li><strong>Medium quality</strong>: 6–7</li><li><strong>High quality</strong>: ≥ 8</li></ul><h3>Summary &amp; Key Insights</h3><ul><li><strong>Quality is roughly normally distributed</strong>, with most wines scoring average.</li><li><strong>Alcohol content is a strong positive indicator</strong> of wine quality.</li><li><strong>Volatile acidity negatively impacts quality</strong>, aligning with sensory expectations.</li><li>Many physicochemical features exhibit <strong>multicollinearity</strong>, necessitating careful modeling.</li><li>Binning quality values introduces useful categorical analysis in classification scenarios.</li></ul><h3>Next Steps</h3><p>After EDA, typical next steps include:</p><ul><li><strong>Feature scaling and transformation</strong></li><li><strong>Model training</strong> (e.g., regression to predict quality score)</li><li><strong>Model evaluation</strong> (cross-validation, RMSE, classification accuracy)</li><li><strong>Feature importance analysis</strong> to quantify which properties most influence quality.</li></ul><blockquote>Github- <a href="https://github.com/DipanwitaBasak9/Wine-Quality-Analysis/blob/main/WineQuality_EDA.ipynb">Wine-Quality-Analysis/WineQuality_EDA.ipynb at main · DipanwitaBasak9/Wine-Quality-Analysis · GitHub</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=925586d46da2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transforming Diabetes Care in India: A Digital Twin Approach toMultivariate Risk Prediction Using…]]></title>
            <link>https://medium.com/@dipanwitaiim/transforming-diabetes-care-in-india-a-digital-twin-approach-tomultivariate-risk-prediction-using-cc9284539f52?source=rss-944c02fddcc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc9284539f52</guid>
            <category><![CDATA[knn-classification]]></category>
            <category><![CDATA[knn-algorithm]]></category>
            <dc:creator><![CDATA[Dipanwita Basak]]></dc:creator>
            <pubDate>Wed, 13 Aug 2025 17:32:03 GMT</pubDate>
            <atom:updated>2025-08-13T17:32:03.467Z</atom:updated>
            <content:encoded><![CDATA[<h3>Transforming Diabetes Care in India: A Digital Twin Approach to Multivariate Risk Prediction Using KNN</h3><p><strong>Background</strong></p><p>Diabetes — both Type 1 and Type 2 — has emerged as a global epidemic, affecting millions of individuals across age groups,with nearly half of the population undiagnosed. While Type 1 is autoimmune and often diagnosed early in life, in this document we focus on the symptoms of Type 2 diabetes which is primarily lifestyle-driven and could be manageable or preventable via lifestyle modifications . Traditional monitoring and treatment strategies are often reactive and generalized, lacking personalization, and are insufficient for early detection or precision intervention more so in a country such as India where doctor: patient ratio is 1:1511 in urban and even worse 1:10000 in rural areas as per 2024 data Via Digital doppelgangers, or real-time digital replicas of individuals created using behavioral and biometric data, offer a paradigm shift in how chronic conditions like diabetes can be understood, monitored, and managed. These AI-driven models can simulate individual disease progression, and recommend personalized interventions with higher accuracy than static models or simple rule-based techniques.</p><p><strong>How Big is the Market?</strong></p><p>To be realistic, this is still a very untapped market in India and provides opportunities for scale with minimum infrastructure unit economics (since we can use the data to connect with the already set up expanse of medical facilities) The Targetable Market in the Diabetes capital of the world-’ India’ consists of 240 million (100 diabetic and even more pre-diabetic who would turn diabetic in next 2–3 years with no lifestyle modifications). Of those serviceable available market is 135 million Indian smart phone users. Of these SAM we can safely predict diabetes health platforms including BeatO has not even captured 5% of TAM and can likely capture 10–15% in next 5 years.This makes early detection, risk prediction, and personalized interventions like digital doppelgangers critical to managing the burden.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*y-s0UVIN-kmc12C-Aveq7Q.png" /><figcaption>Fig 1 — SOM Market Calculation for the use case</figcaption></figure><p><strong>Input Data</strong></p><p>BeatO’s platform provides an excellent case study for this research. The company uses connected glucometers and lifestyle tracking to offer digital coaching The data points that we can get from the data lake/warehouse and the different data sources are as below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l_eH7BKqSDTXWc7g0Ca6wA.png" /><figcaption>Table 1- Data Inputs and the data sources along with the data type used in the classification which can be obtained via apps like BeatO</figcaption></figure><p>Against these labels we have target labels as 0,1,2,3 as healthy to high co-morbidity risk</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*3YZmGxR4OrUiII7nKhZSyA.png" /><figcaption>Table 2- The labels used in the classification against which the KNN classification was run</figcaption></figure><p><strong>Research Methodology</strong></p><p>The K-Nearest Neighbors (KNN) algorithm is a supervised machine learning technique used for classification. It predicts the class of a new input (in this case the label name) based on its similarity to the “K” most similar data points (neighbors/ patients) in the training set.</p><p>In the BeatO digital health ecosystem, each patient generates a feature vector from various data sources:</p><p>1.Smart Glucometer (CURV) provides fasting and postprandial glucose,</p><p>2.BP Monitors record systolic/diastolic pressure,</p><p>3.Fitness trackers (e.g., Google Fit, Fitbit) track heart rate, steps, and sleep,</p><p>4.Nutrition and medication logs offer carb meal scores and compliance,</p><p>5.Health coach and symptom logs contribute symptom scores.</p><p>KNN uses these combined features to position each patient in a multi-dimensional health space. When a new patient’s data is entered, the algorithm calculates the distance (commonly Euclidean) to existing records. It then selects the top K closest data points and assigns the most frequent label such as 0 (healthy) or 3 (high co-morbidity risk). This enables the patients across 3 to come back to 2 or those in 1 to 0 and those in 0 or 2 to maintain their health indicator range The next steps in KNN classification is</p><p><strong>Calculate Euclidean distances </strong>between the new data point (e.g., Patient B) and every point in the training dataset (each representing a patient with known health status/label)</p><p>Mathematical Formula (Euclidean Distance)</p><p>For two points <strong>P </strong>and <strong>Q </strong>in <em>n</em>-dimensional space, where:</p><p>● P=(p1,p2,…,pn)P = (p_1, p_2, …, p_n)P=(p1,p2,…,pn)</p><p>● Q=(q1,q2,…,qn)Q = (q_1, q_2, …, q_n)Q=(q1,q2,…,qn)</p><p>The Euclidean distance d(P,Q)d(P, Q)d(P,Q) is given by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*ckRsONuSL0k8FakbmKqHEQ.png" /></figure><p>Equation 1- Euclidean distance</p><p>In the context of BeatO for diabetes it can be applied as below</p><p>If we have two patients with the systolic and diastolic data only and no information of HbA1C,</p><p>then this distance is calculated as below</p><p>Patient A: (120 mg/dL,80 mmHg) and Patient B: (100 mg/dL,70 mmHg). Then the distance is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*gCbVv0IvprzcUw9UFnYQGA.png" /></figure><p>~ 22.36</p><p><strong>Ranking of all training points </strong>in ascending order of distance — the lower the distance, the more similar the data point.</p><p><strong>Selection of the top 33 (k) nearest neighbors </strong>— i.e., those with the 33 lowest distances (Ranks 1 to 33).</p><p><strong>Counting of the labels </strong>among these 33 neighbors and note their frequencies</p><p>The label with the highest frequency becomes the <strong>predicted class </strong>for Patient B.</p><p>Now, if we take k nearest neighbours as 33 and the greatest number of those 33 nearest</p><p>neighbours in which above distance falls within the rank of 1 to 33 (lower the distance better / lower is the rank) have majority of the labels as say 2 then the final label assigned to the patient B will be 2</p><p><strong>Results of the Data</strong></p><p>A K-Nearest Neighbors (KNN) classifier was trained on 25,000 health records (out of 2.5 million app downloads) to predict chronic disease risk using inputs like glucose levels, blood pressure, sleep, heart rate, and medication adherence. To minimize feature bias and reduce overfitting, all data was normalized using scaling techniques, ensuring uniform contribution from all input variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*Z27FsXpIZR0xnCYofqeLew.png" /><figcaption>Fig 2- Code snippet where the data points were scaled</figcaption></figure><p>The model’s performance varied significantly with k, the number of neighbors during the first run</p><p>Accuracy Trends with Different K:</p><p>● K = 33 → 100% accuracy: Strong clustering, high local agreement</p><p>● K = 111+ → 75% accuracy: More diverse neighbors, some label dilution</p><p>● K = 1000 → 50% accuracy: Over-smoothing; averaging across dissimilar records</p><p>Importantly, analysis revealed that several users marked as Label 1 (low risk) were actually closer to Label 2 (high risk) clusters, indicating possible label inaccuracies or evolving health profiles. This highlights KNN’s potential in uncovering misclassified patients in digital twin systems like BeatO, enhancing precision care.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-tyx7uG1lzl1aKWqmwaHA.png" /><figcaption>Fig 3- How the results look for added labels vs. the predicted labels with the accuracy % correct to 2 decimal points</figcaption></figure><p>Notably, when the model was re-trained on the same data, accuracy unexpectedly dropped to 25% even at k = 13, suggesting label inconsistency, possible overfitting, or increased noise. Several profiles initially labeled as low risk (Label 1) were in fact closer to high-risk (Label 2) clusters. This suggests that KNN can reveal underlying misclassifications, offering strong potential for dynamic label correction in digital twin platforms like BeatO</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VcKqN5mq2I0jBpeW82z5Rw.png" /><figcaption>Fig 4- Accuracy on 4th run and k=13</figcaption></figure><p><strong>Applications of the data</strong></p><ol><li><strong>Chronic Disease Risk Prediction</strong>- Based on the final labels and accuracy of prediction we can predicts diabetes, hypertension, and metabolic risks for early intervention. One example could be to allocate triggers of 1–3 (with 3 as most severe) for any derangement that is based on the value and the type of derangement (say +1 for less than 2000 steps a day for +2 for &gt;180 glucose post meal). Basis this we can allocate a cumulative score to indicate high diabetes (say &gt;6) or high co-morbidity risk (say &gt;8). This is also useful for multivariate feature combinations as well such as -</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*jX6fbAYD6GP7TONqgctuXg.png" /><figcaption>Fig 5- How other diseases can also be used under labelling accuracy and the role of multivariate features using the same data points</figcaption></figure><p>2. <strong>Personalized Health Dashboards- </strong>Shows users clear “Predicted vs Actual” status to help track progress or detect issues in real-time</p><p>3. <strong>Increased Progress Monitoring- </strong>Run weekly/monthly to show health improvement or decline for better patient tracking and coaching. This is going to aid in customer experience and better user journey/ CSAT scores</p><p>4. <strong>Targeted Health Campaigns and Nudges- </strong>Segment population based on prediction and collaborate with insurers, wellness providers, or public health teams for possible cross-selling of health care services, medicines, wearables and devices and earn commission based income for all stakeholders in the supply chain while providing early intervention and convenience to users/ patients</p><p>5. <strong>Explainable AI in Healthcare- </strong>Transparent output builds trust with doctors &amp; users and therefore easier to adopt in clinical or regulated settings</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc9284539f52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[KNN Classification based on Iris Data]]></title>
            <link>https://medium.com/@dipanwitaiim/knn-classification-based-on-iris-data-f05db2ea0bf0?source=rss-944c02fddcc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f05db2ea0bf0</guid>
            <category><![CDATA[sklearn]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[numpy]]></category>
            <category><![CDATA[knn-classification]]></category>
            <dc:creator><![CDATA[Dipanwita Basak]]></dc:creator>
            <pubDate>Sun, 27 Jul 2025 10:50:13 GMT</pubDate>
            <atom:updated>2025-07-27T12:41:37.522Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Data</h3><p>The Iris dataset comprises measurements of iris flowers from three different species: Setosa, Versicolor, and Virginica. Each sample consists of four features: sepal length, sepal width, petal length, and petal width. Additionally, each sample is labeled with its corresponding species.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*Pism3rKLUwsTb4_2hgsZkg.png" /></figure><h3><strong>What is the objective here is-</strong></h3><p>The goal when using this dataset is to classify an unknown Iris flower into one of the three species based on its ‘known’ sepal and petal measurements</p><p>K= how many nearest neighbours to look at for calculating the distance</p><p>KNN Clustering-</p><h3><strong>Concept Explanation-&gt;</strong></h3><p>Now lets understand using the example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*6iR5dvvoewlS40SXtG4nIA.png" /></figure><p>This is a snippet of the Iris data wherein we have taken length and width for one of the features sepal and basis these 2 knowns we try to calculate the unknown category- species</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*dhQ-_cuhP6B_OgQp7rXbOg.png" /></figure><p>First we calculate distance of each row considering the species Is the first row setosa</p><p>So Distance =sqrt[ (x-a)² +(y-b)²]</p><p>Where a, b is the given value and x, y is the value of length and width per row</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*j608_07esPfDcc_M4TpgzQ.png" /></figure><p>Once we have distance of every row we calculate rank, so lower the distance (i.e. closer it is to the given sample), higher the rank i.e; least distance is rank 1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*7ewk3bEYdlOwXVwKKcNRlQ.png" /></figure><p>Now we take the number of nearest neighbors for which we compare as say k=5. Basis the species that has maximum occurrence between ranks 1 to k, we determine the sample species</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*r6pnNJby4IYjfuGM1BbjkA.png" /></figure><p>Here Setosa has 3 occurences out of 5, so Setosa is the species</p><h3>Let’s run the algorithm-</h3><h4><strong>1.</strong> <strong>Load the data and view the first few rows</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*Xd_rsw3yWBeBoHHC0G4Gbw.png" /></figure><p><strong>2. Get ready for KNN</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*n3p5WHNE9-lZEeF7hUULNw.png" /></figure><p><strong>3.</strong> <strong>Divide Iris data into train &amp; test data to create the model &amp; then train/ fit it</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*QHHAf_ULZQM8PGgVsaaS3Q.png" /></figure><p><strong>4.</strong> <strong>Now using the created model, predict for a sample and then compare the accuracy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*R7tpILHIAD-oQO1IQDJmxg.png" /></figure><p><strong>5.</strong> <strong>This is optional: enter the values via keyboard and find the predicted species</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*J9k5ZFELi6Rygl23an3H8w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f05db2ea0bf0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Solve Sudoku in Python?]]></title>
            <link>https://medium.com/@dipanwitaiim/how-to-solve-sudoku-in-python-06189b56889b?source=rss-944c02fddcc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/06189b56889b</guid>
            <category><![CDATA[leetcode-hard]]></category>
            <category><![CDATA[sudoku-solver]]></category>
            <category><![CDATA[first-principles-thinking]]></category>
            <category><![CDATA[problem-solving]]></category>
            <dc:creator><![CDATA[Dipanwita Basak]]></dc:creator>
            <pubDate>Fri, 25 Jul 2025 20:46:59 GMT</pubDate>
            <atom:updated>2025-07-25T20:46:59.841Z</atom:updated>
            <content:encoded><![CDATA[<p>I have always been an avid Sudoku solver since quite some years now so much so that I had solved this book in 10 days flat J</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*PZgNLRbo8aE_kyml7Lk68A.png" /></figure><p>It gave me so much joy to solve a puzzle, so now let me bring one of the puzzles to you:-</p><p><strong>Medium Puzzle 191</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*M9Gu2BVzs7HFA89OFYuE2A.png" /></figure><p>All numbers which are originally empty are marked orange /0</p><p>Lets try to solve cell B2</p><p><strong>Check 1-&gt; Every number in a row should be unique</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*pO54i-v4eCpxlsE4L5ynYA.png" /></figure><p>So B2 cannot be 2,9, 7: possible solutions-&gt; [1,2,3,4,5,6,7,8,9]</p><p>This check is from (A,1) to (I,1)</p><p>So updated possibilities include the unstruck numbers</p><p>Or another approach-&gt;</p><p>if I run a for loop for numbers between 1 to 9, it returns false as possible solutions for 1,2,3,6,7 (These numbers are excluded as possibilities)</p><p>Lets go by this alternative approach in below checks</p><p><strong>Check 2 -&gt; Every column in a column should be unique</strong></p><p>This check is from (B,1) to (B,9)</p><p>The list of possibilities return false for 3, 4, 9,2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/59/1*yDgu5ywIyUODDxj0IKsJXg.png" /></figure><p>Now the check 3</p><p><strong>Check 3-&gt; Every cell in a given square should be unique</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/173/1*RUkyMimt6BhS95LHaauxxQ.png" /></figure><p>Check is from x1,y1 to x3,y3 in Square 1</p><p>The false is returned for 3,6,2,9,4</p><p>Check 1 False-&gt;1,2,3,6,7</p><p>Check 2 False-&gt;3,4,9,2</p><p>Check 3 False-&gt;3,6,2,9,4</p><p>So possibilities could be-&gt;5,8</p><p>Now the task is what is x1 and y1, x3 and y3 (Remember we have known values for row, column and the number we are checking) (Also A=row 1, D=row 4, G=row 7 etc.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*CpQ6-68gMVIBnXpxaHmntg.png" /></figure><p>So X1 = 1 (for square numbers 1 to 3)</p><p>X1= 4 (for square numbers 4 to 6)</p><p>X1= 7 ( for squares 7 to 9)</p><p>So xi=i+ 3* (square number-1) or square no= (xi-i)/3 +1</p><p>Yi= (Square number-1)*3 + i</p><p>Then traverse from x1 to x3 by adding +1 to +2 row and similarly for y1, y2, y3 etc.</p><p>Or calculate xi equation using row and columns only ie, given column find the row for xi and vice versa for yi</p><p>Xi=(column//3)*3</p><p>Yi=(row//3)*3</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iVBmpl7ykZiarTHtV_ScFA.png" /></figure><p><strong>Now after getting false for non-possibilities, let’s try to solve</strong></p><p>Number is given to possible function</p><p>If it returns false for that no for all checks; go to next number (number+1 in 1 to 9)</p><p>If every thing is exhausted till 9 mark that grid 0 (not solved)</p><p>Go to previous step and put next possibility in previous step and so on ( ie if number is repeating in current step, back track error in previous steps)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TL7oqOaksdRomCTkn1IoMA.png" /></figure><h3><strong>Fin.</strong></h3><p>You can go on calling solve to get further combinations!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06189b56889b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Matplotlib in Python- Part 1 Line Plot, Scatter Plot, Bar Graph]]></title>
            <link>https://medium.com/@dipanwitaiim/matplotlib-in-python-part-1-b05baa7f20eb?source=rss-944c02fddcc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b05baa7f20eb</guid>
            <category><![CDATA[line-plot]]></category>
            <category><![CDATA[scatter-plots]]></category>
            <category><![CDATA[pyplot]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[matplotlib]]></category>
            <dc:creator><![CDATA[Dipanwita Basak]]></dc:creator>
            <pubDate>Fri, 25 Jul 2025 13:43:42 GMT</pubDate>
            <atom:updated>2025-07-25T18:03:15.429Z</atom:updated>
            <content:encoded><![CDATA[<p>Who is this article for?</p><p>Well anyone who works on Python would have to come across libraries soon. This is also essential if you would like to have an online notes to come back and refer before a quick interview or to include in your coding, I have tried to keep the language very simple and yet elaborative to understand all the fundamental concepts minus the frills — So let’s get started!</p><p><strong>So what is matplotlib</strong>-</p><p>Matplotlib is quite a popular data visualization tool in Python and you can use it to create all sorts of graphs such as histogram, scatter plot, bar charts etc. to create graphs that are static yet interactive in nature.</p><p>So step 1 is <strong>import matplotlib</strong></p><p><strong>Now what about pyplot?</strong></p><p>Now once we have imported matplotlib we need pyplot because the set of functions or we can say that it is a sub-module that make the graphs work under matplotlib. How? Each pyplot function makes some change to a figure: e.g., creates a figure, creates a plotting area in a figure, plots some lines in a plotting area, decorates the plot with labels, etc. This is exactly what I meant by saying that matplotlib can create functions that are interactive in nature</p><p><strong>Calling function using plt</strong></p><p>Plt is a common way of calling matplotlib.pyplot function, because we can call the function again and again to manipulate graphs as it isan efficient way of doing so</p><p><em>What is numpy library- Another library used for working with arrays (we’ll discuss about this in later articles)</em></p><p>Basically we will create thsese type of graphs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*UMDdhihtxt0LujqnrriSzA.png" /></figure><p>Additional add ons can be added on top of it via labels, colors, grids etc.</p><p><strong>Creating a Line Plot-</strong></p><p>So we import the libraries matplotlib and numpy to work on arrays for creating line plots. Now we plot using the points xpoints as x-xo ordinates and similarly ypoints. Now to <strong>show </strong>the graph we will now show the graph</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*74nxMP3TpPtHY6kol2GFgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*_AlHqdJ-xvAJzHyIKp2MzA.png" /></figure><p><strong>Adding Colors</strong></p><p>Now on this base we can modify the graph by adding colors (‘b’ as blue or ‘g’ as green)</p><p>So the other letters and what color they signify is as below-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*qkxB8zklHFdkvENnyOWQVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*UBu35THsrG1FscmVzWPytA.png" /></figure><p><strong>Creating a Scatter Plot</strong></p><p>Now there are two ways to do it</p><p>A) Lets create line plot without the line itself and it can be done in a very similar way by adding ‘o’- command in Matplotlib is used to create a scatter plot where the individual data points are represented by circular markers.</p><p>B) We use the scatter function</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*EziK79UCeJNDXpWsoopWDg.png" /></figure><p><strong>Creating subplots</strong></p><p>Subplot is not actually used to create a plot but just like html is used to create the structure of a website similarly subplot creates the layout where the graphs will be plotted. It takes 3 arguments in the order row, column and this is the nth graph (nth is counted as r*c)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*zIML_Je6Z_jJcd2zI3IyMQ.png" /></figure><p>This creates the space for 4 rows 3 columns and any plot will be created in the second part</p><p>Lets see the practical example using line plot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*BvKbbRAWcr8dCPex_N4P4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*JNJepRW6jsM-kYXwGStckQ.png" /></figure><p><strong>Create a Bar Graph</strong></p><p>Bar graphs are horizontal or vertical in nature and are used to draw graphs for categorical nature (definedby x co-ordinate and each category having height defined by y co-ordinate) wherein categories could be either in string format or have names else could be say category no 23 or sku 20 could also be a category defined by xpoints above</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*FhDjDXO0gZL4yOE4B2GN0g.png" /></figure><p>Now if both x and y co-ordinates by a fixed number then it will create a square because it is one category having just one height value</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*Ehue4Rin_vrm1ov4eSyIJg.png" /></figure><p>To add horizontal bars just use barh instead of bar (vertical bars)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*EoJwpdsFvlMRgf5vAEHQvQ.png" /></figure><p>We can add more variety and add ons on above types of graphs as well as talk about pie charts and 3D in next articles as this would require much more details in depth</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b05baa7f20eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The City of Data-polis !]]></title>
            <link>https://medium.com/@dipanwitaiim/the-city-of-data-polis-cfae80d83b37?source=rss-944c02fddcc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfae80d83b37</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-warehouse]]></category>
            <category><![CDATA[data-mart]]></category>
            <dc:creator><![CDATA[Dipanwita Basak]]></dc:creator>
            <pubDate>Sun, 15 Jun 2025 17:08:47 GMT</pubDate>
            <atom:updated>2025-06-17T10:55:45.675Z</atom:updated>
            <content:encoded><![CDATA[<h3>The City of Data-nagar !</h3><p>All about Data (Data Mart, Data Mesh, Data Warehouse, Data Lakehouse)</p><p>Let’s explain the concepts of <strong>Data Lake</strong>, <strong>Data Warehouse</strong>, <strong>Data Mart</strong>, and <strong>Data Mesh</strong> using a simple, relatable <strong>story</strong> — set in a <strong>city library system</strong>. This analogy helps visualize how each architecture functions in real life</p><h3>1. The Central Library (Data Warehouse)</h3><p>The city started with the <strong>Central Library</strong>. It was clean, quiet, and incredibly organized. All books were cataloged, summarized, and placed in specific shelves.</p><ul><li><strong>Only finalized, accurate books</strong> could be stored here.</li><li><strong>Readers</strong> (business analysts) came here to find <strong>structured information</strong> for <strong>research and reports</strong>.</li><li>The <strong>librarians</strong> (data engineers) spent a lot of time <strong>filtering and summarizing</strong> books before putting them on the shelves.</li></ul><blockquote><em>✅ Great for precision. ❌ Not ideal for storing raw materials or fast-changing information.</em></blockquote><h3>🌊 2. The Book Lake (Data Lake)</h3><p>Next, Datapolis created the <strong>Book Lake</strong> — a massive reservoir of all types of content: old manuscripts, raw notes, images, audio interviews, even TikTok scripts.</p><ul><li>No strict formatting was needed.</li><li><strong>Writers and researchers</strong> (data scientists) could dive in and pull out whatever raw materials they wanted.</li><li>But without proper labeling and governance, some areas became a <strong>book swamp</strong> — full of unreadable junk.</li></ul><blockquote><em>✅ Great for creativity and experimentation. ❌ Needs care to avoid chaos.</em></blockquote><h3>🏢 3. Department Libraries (Data Marts)</h3><p>Soon, each department — like Health, Education, and Sports — built its own <strong>mini-library</strong>. These were <strong>Data Marts</strong>.</p><ul><li>They took <strong>just the relevant books</strong> from the Central Library.</li><li>They were faster and more <strong>convenient for local staff</strong>.</li><li>But if not coordinated, they sometimes <strong>duplicated or conflicted</strong> with the main library’s records.</li></ul><blockquote><em>✅ Fast and focused. ❌ Risk of inconsistent information.</em></blockquote><h3>🕸️ 4. Neighborhood Libraries with Their Own Rules (Data Mesh)</h3><p>As the city grew, waiting for the Central Library to process everything caused <strong>delays</strong>. So Datapolis switched to a <strong>Data Mesh</strong> model.</p><ul><li>Each <strong>neighborhood</strong> (team or domain) built its own <strong>small library</strong>, with its own librarians and standards.</li><li>They followed <strong>city-wide rules</strong> (governance), but handled their <strong>own data products</strong>.</li><li>The <strong>citizens</strong> could request access and get what they needed faster, directly from each source.</li></ul><blockquote><em>Decentralized, scalable, promotes ownership. Needs coordination and cultural shift.</em></blockquote><h3>Conclusion!</h3><p>Every architecture — Data Lake, Data Warehouse, Data Mart, or Data Mesh — has its strengths. Like libraries, each serves a different reader, goal, and type of content. The best cities (and companies) often <strong>use a mix of all</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfae80d83b37" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Communication in APIs: Real-Time Solutions via a Payments Use Case (NFR- Real-Time Visibility)…]]></title>
            <link>https://medium.com/@dipanwitaiim/communication-in-apis-real-time-solutions-via-a-payments-use-case-nfr-real-time-visibility-2a784c1b32e7?source=rss-944c02fddcc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a784c1b32e7</guid>
            <category><![CDATA[product-backlog]]></category>
            <category><![CDATA[webhooks]]></category>
            <category><![CDATA[writing-user-stories]]></category>
            <category><![CDATA[product-kpis]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Dipanwita Basak]]></dc:creator>
            <pubDate>Thu, 12 Jun 2025 15:58:47 GMT</pubDate>
            <atom:updated>2025-06-12T17:05:21.668Z</atom:updated>
            <content:encoded><![CDATA[<h3>Communication in APIs: - Creating The Product Backlog!</h3><p>Part 2 of 2</p><p>Continued from <a href="https://medium.com/@dipanwitaiim/communication-in-apis-real-time-solutions-via-a-payments-use-case-nfr-real-time-visibility-a2b196e5874e">Communication in APIs: Requirement Analysis! | by Dipanwita Basak | Jun, 2025 | Medium</a></p><p><strong>Introduction</strong></p><p>In this series we go ahead and post the requirement analysis in Part 1, we create the product backlog here</p><p><em>(</em><strong><em>Pre-reads</em></strong><em> would include understanding the concepts of creation of user stories and backlogs and the related terminologies such as epic , initiatives, components of a Jira user story and understanding of basic Jira concepts. This article would be very useful in understanding of practical application of creating a product backlog for the next few quarters- an essential skill for all Product managers</em></p><p><em>Another important point to note is just creation and implementation of stories does not mean feature completion, it is also imperative to measure </em><strong><em>product success</em></strong><em> via functional and non-functional requirement KPIs</em></p><p><em>A sprint is defined as 2 working week consisting of 5 days/ week and 1 SP is a 8 hour working day- this is just an indicative example and can be changed</em></p><p><em>Also note stories are written in Jergin’s format and scope does not include other components of user stories such as Acceptance Criteria, Labels etc.)</em></p><h3>Lets Start!</h3><p>Any epic or feature for a backlog can be divided generally into below steps which might run in parallel or sequence as below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*GLmUo1iAaT40fcghiOjHRw.png" /><figcaption>Fig- ‘General’ Steps in creation of a Backlog</figcaption></figure><p><strong>Lets Translate into Actual Backlog!</strong></p><p>(spanning across next few quarters)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*ZX587gyih3PAUD4MlFkfZg.png" /><figcaption>Fig- Tentative planning of the Initiative at hand</figcaption></figure><h3>Initiative</h3><p><strong>“Enable Real-Time Payments Visibility via APIs”</strong></p><ul><li>Phased breakdown of stories and tasks: <em>Discovery / Spike → Build → Implementation → Test → Maintenance</em></li><li>Structure backlog by: <em>Initiative → Epics → User Stories → Tasks</em></li></ul><h3><strong>Phase Wise Details</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*rJPaceGaorR5Vd6YrkfcKw.png" /><figcaption>Fig- Summary of Product Roadmap for the Initiative at epic level</figcaption></figure><h3><strong>Phase 0: Discovery / Spike (Weeks 1–3)</strong></h3><ul><li><strong>Epic D1: Explore API communication patterns</strong></li><li>Story D1.1: Research REST vs. WebSockets, Pub/Sub, SSE usage in payments</li><li>Tasks: Identify pros/cons for performance, reliability, scalability</li><li>Story D1.2: Analyze open banking integrations (UPI, SCT Inst, FedNow)</li><li>Tasks: Compare messaging formats (ISO 20022, JSON), latency expectations</li><li><strong>Epic D2: Define Non-Functional Requirements</strong></li><li>Story D2.1: Survey stakeholders to set latency threshold, target uptime, concurrency</li><li>Story D2.2: Perform load and fraud-risk analytics</li><li>Tasks: Simulate spikes to define burst capacity, monitor fraud vectors</li></ul><p><strong>KPIs for Phase 0:</strong></p><p>· Spike outcomes completed in time</p><p>Latency and capacity thresholds clearly documented</p><p>· NFRs defined: latency &lt;200ms, 99.9% uptime, 1000 TPS concurrency, ISO‑20022 compliance</p><h3><strong>Phase 1: Build (Weeks 4–12)</strong></h3><ul><li><strong>Epic B1: Core Real-Time API Layer (WebSockets + Pub/Sub)</strong></li><li>Story B1.1: Implement real-time event bus (Pub/Sub queue + WebSocket service)</li><li>Story B1.2: Build Payment Execution API endpoint(s) with real-time notifications</li><li>Story B1.3: Add authentication (OAuth2/JWT) and authorization</li><li>Story B1.4: Integrate IS020022 payload enrichment, delivery confirmation</li><li><strong>Epic B2: Monitoring &amp; Alerts</strong></li><li>Story B2.1: Real-time dashboard for transaction latency/errors</li><li>Story B2.2: Alert system for threshold breaches (latency, TPS, error-rate)</li></ul><p><strong>KPIs for Phase 1:</strong></p><ul><li>API response &lt;200 ms 95% of the time</li><li>System handles 1k TPS burst with zero message loss</li><li>99.9% API uptime</li><li>Real-time dashboard coverage ≥90% of flows</li></ul><h3><strong>Phase 2: Implementation (Weeks 13–18)</strong></h3><ul><li><strong>Epic I1: End-to-End Integration</strong></li><li>Story I1.1: Hook core APIs into payment provider backends</li><li>Story I1.2: Onboarding flow with real-time status updates</li><li>Story I1.3: UI/UX: real-time status on client dashboard</li><li><strong>Epic I2: Data Security &amp; Compliance</strong></li><li>Story I2.1: End-to-end encryption, tokenization</li><li>Story I2.2: Fraud control (multi‑factor auth, payee confirmation, sanction screening)</li><li>Story I2.3: Audit logging and compliance archiving</li></ul><p><strong>KPIs for Phase 2:</strong></p><ul><li>End-to-end path latency</li><li>Zero data leakage incidents in QA</li><li>Fraud screening accuracy &gt;99%</li><li>100% audit log coverage</li></ul><h3><strong>Phase 3: Test (Weeks 19–22)</strong></h3><ul><li><strong>Epic T1: Reliability &amp; Performance Testing</strong></li><li>Story T1.1: Load/stress tests to 2k TPS</li><li>Story T1.2: Failover drills, retry logic validation</li><li><strong>Epic T2: Security &amp; Compliance Validation</strong></li><li>Story T2.1: Penetration testing + vulnerability scanning</li><li>Story T2.2: Confirm encryption at rest and transit</li></ul><p><strong>KPIs for Phase 3:</strong></p><ul><li>Stable operation at 150% expected load</li><li>Zero critical severity vulnerabilities</li><li>All automated tests pass (≥90% coverage)</li></ul><h3><strong>Phase 4: Maintenance (Weeks 23–24, ongoing)</strong></h3><ul><li><strong>Epic M1: M&amp;M (Monitoring &amp; Maintenance)</strong></li><li>Story M1.1: Implement SLO-based alerting</li><li>Story M1.2: Monthly performance reviews</li><li><strong>Epic M2: Feedback &amp; Enhancement</strong></li><li>Story M2.1: Deploy feedback widget and SLA tracker</li><li>Story M2.2: Run user interviews; log feature requests</li></ul><p><strong>KPIs for Phase 4:</strong></p><ul><li>SLA: respond to incidents within 30 mins, resolve in 4 hrs</li><li>Monthly uptime ≥99.9%</li><li>User satisfaction ≥4/5</li></ul><p><strong>User Feedback Story &amp; SLA</strong></p><ul><li><strong>Epic F1: User Feedback Collection</strong></li><li>Story F1.1: As a payments ops user, I see “Rate this experience” prompt post-transaction</li><li>Tasks: Design prompt, collect score + comments</li><li>Story F1.2: As product owner, I get notified of negative scores within 1 business day (SLA)</li><li>Tasks: Setup alerting, tracking dashboard</li></ul><h3>Effort Estimate Calculation</h3><h3><strong>Phase 0: Discovery / Spike</strong> (13 SP)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*J2FaJwurPIUq9ac183SJYg.png" /></figure><h3>Phase 1: Build (25 SP)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*EWMKkJhRCboN7VqAUpHvxQ.png" /></figure><h3>Phase 2: Implementation (23 SP)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*nuAJRFmfrewPN3BZNKXtRA.png" /></figure><h3>Phase 3: Test (14 SP)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*nOpcEbUIrxyLm9kLa_8QnQ.png" /></figure><h3>Phase 4: Maintenance (9 SP)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*EzE3TSf0cNo957JX6sfd9Q.png" /></figure><h3>User Feedback &amp; SLA (included as part of Phase 4)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*GpczYch1_g2cTTDg27V5hw.png" /></figure><p>Hope this helps! you can also look into the Gantt Chart again!-Fig- Tentative planning of the Initiative at hand</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a784c1b32e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Communication in APIs: Requirement Analysis!]]></title>
            <link>https://medium.com/@dipanwitaiim/communication-in-apis-real-time-solutions-via-a-payments-use-case-nfr-real-time-visibility-a2b196e5874e?source=rss-944c02fddcc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2b196e5874e</guid>
            <category><![CDATA[webhooks]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[payments-technology]]></category>
            <dc:creator><![CDATA[Dipanwita Basak]]></dc:creator>
            <pubDate>Thu, 12 Jun 2025 12:06:44 GMT</pubDate>
            <atom:updated>2025-06-12T16:03:34.033Z</atom:updated>
            <content:encoded><![CDATA[<p>Part 1 of 2</p><h3>Real-Time Solutions via a Payments Use Case (NFR- Real-Time Visibility)</h3><h3>Introduction</h3><p>APIs are the silent engines behind our digital experiences. It describes how clients request data and servers respond. But what happens when data changes on the server and the client needs to be updated in real-time?</p><p>There are two Types of API-Driven Integrations</p><ol><li>Client-Driven Integration- This is triggered by <strong>user actions</strong> on the client. Example: Placing a pizza order via a mobile app .The client knows exactly when something changes, so it instantly communicates with the server.</li><li>Server-Driven Integration- This is triggered by <strong>changes on the server</strong> (e.g., pizza status update).Problem: Servers can’t initiate contact with clients. So how do we keep clients updated?</li></ol><p>Visual Real Time Communication Technique:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GSTZyOF0u9hUg4RTCxY00A.png" /><figcaption>Fig- Real Time Solutions for Communication in Webhooks</figcaption></figure><p>Real Time Communication Modes:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*zm8NxLO0l1Z9DOFON8qA3A.png" /><figcaption>Table1-Fig- Details of the various Real Time Solutions</figcaption></figure><p>Let us understand with a case study at hand-</p><h3>Real-Time Payment Updates: A Case Study in API Design</h3><h3>Background:</h3><p><strong>PayX</strong> is a growing fintech startup offering a unified payment solution for e-commerce businesses. Their clients want <strong>real-time visibility</strong> into the status of each transaction: initiated, authorized, settled, or failed.</p><h3>Problem Statement:</h3><blockquote>A POS Vendor makes the statement that “Our merchant customers often complain about delayed status updates after a customer checks out. They want to notify customers instantly or take conditional actions based on payment success/failure.”</blockquote><h3>Phase 1: Polling (Basic)</h3><p><strong>Action:</strong><br> Exposed a GET /transactions/:id endpoint that merchants could poll.</p><p><strong>Outcome (Edge Conditions)</strong></p><ol><li>Server load increased drastically during high traffic.</li><li>Merchants either missed updates or overwhelmed the system.</li></ol><h3>Phase 2: Long Polling (Optimized but Fragile)</h3><p><strong>Action:</strong><br> Enabled long polling on GET /transactions/:id?wait=true.</p><p><strong>Outcome (Edge Conditions)</strong></p><ol><li>Although it reduced unnecessary requests, still some clients (especially on mobile) dropped connections.</li><li>Not scalable for 10K+ concurrent merchants.</li></ol><h3>Phase 3: Webhooks (Real-Time Breakthrough)</h3><p><strong>Actions:</strong><br> Enabled merchants to register webhook endpoints via:</p><blockquote><em>POST /webhooks<br>{<br> “url”: “</em><a href="https://merchant.com/payment-events"><em>https://merchant.com/payment-events</em></a><em>&quot;,<br> “event”: “transaction.status.changed”<br>}</em></blockquote><p>Server Push Example</p><blockquote>POST /payment-events<br>{<br> “transaction_id”: “tx_18203”,<br> “status”: “authorized”,<br> “timestamp”: “2025–06–12T10:15:00Z”<br>}</blockquote><p><strong>Outcome (happy flow):</strong></p><ol><li>Real-time updates within seconds.</li><li>Enabled merchants to send instant confirmation emails and start shipping.</li><li>Server load decreased significantly.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*C9jQL-NJIlsDrjgHds8CNg.png" /></figure><p>Fig- Visual Representation of Webhooks</p><p><strong>Takeaways</strong>-</p><p>In a payment system, real-time updates are not just a tech upgrade — they’re a competitive advantage. Using webhooks or subscription-based event APIs ensures reliability, scalability, and customer satisfaction</p><p><strong>How would you design a Product Backlog for the Upcoming Sprints as a PM? </strong><em>Lets discuss this in Part 2 of 2 of the series- </em><a href="https://medium.com/p/2a784c1b32e7/edit">Editing Communication in APIs: Real-Time Solutions via a Payments Use Case (NFR- Real-Time Visibility)… — Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2b196e5874e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>