<?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 Daralavanya on Medium]]></title>
        <description><![CDATA[Stories by Daralavanya on Medium]]></description>
        <link>https://medium.com/@daralavanya79?source=rss-8a735de70b5f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*enWgNLSa2Kfc8FVH</url>
            <title>Stories by Daralavanya on Medium</title>
            <link>https://medium.com/@daralavanya79?source=rss-8a735de70b5f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 07:47:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@daralavanya79/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[1. Understanding Weights and Bias in Artificial Neural Networks]]></title>
            <link>https://medium.com/@daralavanya79/1-understanding-weights-and-bias-in-artificial-neural-networks-e47a4fe3705f?source=rss-8a735de70b5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e47a4fe3705f</guid>
            <dc:creator><![CDATA[Daralavanya]]></dc:creator>
            <pubDate>Mon, 29 Jun 2026 09:34:27 GMT</pubDate>
            <atom:updated>2026-06-29T09:34:27.904Z</atom:updated>
            <content:encoded><![CDATA[<h3>Role of Weights</h3><p>Weights determine the importance of each input feature in a neural network.</p><h3>Example</h3><p>Suppose we want to predict whether a student will pass an exam.</p><p>Inputs:</p><ul><li>Hours Studied = 8</li><li>Attendance = 90%</li></ul><p>Weights:</p><ul><li>Hours Studied Weight = 0.8</li><li>Attendance Weight = 0.2</li></ul><p>Since the weight for studying is higher, it has more influence on the prediction.</p><h3>Mathematical Example</h3><p>z=w1x1+w2x2z = w_1x_1 + w_2x_2z=w1​x1​+w2​x2​</p><p>If:</p><ul><li>x1=8x_1 = 8x1​=8</li><li>x2=90x_2 = 90x2​=90</li><li>w1=0.8w_1 = 0.8w1​=0.8</li><li>w2=0.2w_2 = 0.2w2​=0.2</li></ul><p>z=(0.8×8)+(0.2×90)z = (0.8 \times 8) + (0.2 \times 90)z=(0.8×8)+(0.2×90) z=6.4+18=24.4z = 6.4 + 18 = 24.4z=6.4+18=24.4</p><h3>Importance of Bias</h3><p>Bias helps shift the activation function left or right.</p><p>Without bias, the model may not fit data properly.</p><h3>Formula</h3><p>z=w1x1+w2x2+bz = w_1x_1 + w_2x_2 + bz=w1​x1​+w2​x2​+b</p><p>where:</p><ul><li>bbb = bias</li><li>Example</li></ul><p>z=24.4+5=29.4z = 24.4 + 5 = 29.4z=24.4+5=29.4</p><p>The bias increases the final value before activation.</p><h3>Real-World Analogy</h3><p>Think of hiring employees:</p><p>Decision factors:</p><ul><li>Skills</li><li>Experience</li></ul><p>Weights:</p><ul><li>Importance given to each factor.</li></ul><p>Bias:</p><ul><li>Minimum preference already set by the company.</li></ul><p>Even if candidates have similar scores, the bias can influence the final decision.</p><h3>2. Why Neural Networks Need Activation Functions</h3><h3>What is an Activation Function?</h3><p>An activation function decides whether a neuron should be activated.</p><p>Output=f(z)Output = f(z)Output=f(z)</p><p>where:</p><p>z=∑wx+bz = \sum wx + bz=∑wx+b</p><h3>Linear vs Non-Linear Learning</h3><h3>Linear Function</h3><p>f(x)=xf(x)=xf(x)=x</p><p>Produces only straight-line relationships.</p><h3>Non-Linear Function</h3><p>Examples:</p><ul><li>Sigmoid</li><li>ReLU</li><li>Tanh</li></ul><p>Can learn complex patterns.</p><h3>Importance of Activation Functions</h3><p>Activation functions:</p><ul><li>Introduce non-linearity.</li><li>Enable learning of complex relationships.</li><li>Help classify complicated datasets.</li><li>Allow deep neural networks to work effectively.</li></ul><h3>Problems Without Activation Functions</h3><p>Without activation functions:</p><p>Output=W3(W2(W1X))Output = W_3(W_2(W_1X))Output=W3​(W2​(W1​X))</p><p>This simplifies to:</p><p>Output=WXOutput = WXOutput=WX</p><p>Multiple layers become equivalent to one layer.</p><h3>Result</h3><ul><li>Deep learning becomes useless.</li><li>Cannot solve complex problems like:</li><li>Image recognition</li><li>Speech recognition</li><li>Language translation</li></ul><h3>3. Single Layer Perceptron: Working, Architecture, and Applications</h3><h3>Architecture</h3><p>A single-layer perceptron consists of:</p><ul><li>Input layer</li><li>Output layer</li></ul><p>No hidden layers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/0*9AydG1Zv68DzzA7o" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SSlWuF7-ayvI70AN" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/0*M2-2IJfw6wOG7WbB" /></figure><p>5</p><h3>Structure</h3><pre>Inputs → Weights → Summation → Activation → Output</pre><h3>Learning Process</h3><h3>Step 1</h3><p>Initialize weights.</p><h3>Step 2</h3><p>Calculate output.</p><p>y=f(∑wx+b)y=f(\sum wx+b)y=f(∑wx+b)</p><h3>Step 3</h3><p>Compare prediction with actual output.</p><h3>Step 4</h3><p>Update weights.</p><h3>Step 5</h3><p>Repeat until error is minimized.</p><h3>Advantages</h3><ul><li>Simple architecture.</li><li>Easy to implement.</li><li>Fast training.</li><li>Works well for linearly separable problems.</li></ul><h3>Limitations</h3><ul><li>Cannot solve XOR problem.</li><li>Limited learning capability.</li><li>Only handles linear decision boundaries.</li></ul><h3>4. Multi-Layer Perceptron (MLP): Solving Complex Problems with Hidden Layers</h3><h3>Architecture</h3><p>An MLP contains:</p><ol><li>Input Layer</li><li>Hidden Layer(s)</li><li>Output Layer</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nNzE1kgDOjvklXrz" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/0*FeOzuTOh8lO-XZYP" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/0*xEhnhrd1lBy3welV" /></figure><h3>Input Layer</h3><ul><li>Receives data.</li><li>Passes information to hidden layers.</li></ul><p>Example:</p><ul><li>Age</li><li>Salary</li><li>Experience</li></ul><h3>Hidden Layer</h3><p>Performs feature extraction and pattern learning.</p><p>Functions:</p><ul><li>Detect hidden relationships.</li><li>Learn complex representations.</li></ul><h3>Output Layer</h3><p>Produces the final prediction.</p><p>Examples:</p><ul><li>Yes/No</li><li>Disease/No Disease</li><li>Cat/Dog</li></ul><h3>XOR Problem Solution</h3><h3>XOR Truth Table</h3><p>X1X2XOR000011101110</p><p>A single perceptron cannot solve XOR.</p><h3>Solution</h3><p>Add hidden neurons.</p><p>The hidden layer creates multiple decision boundaries that combine to solve XOR.</p><p>Thus:</p><p><strong>MLP + Hidden Layer = XOR Solved</strong></p><h3>5. Feedforward Neural Networks Explained with Examples</h3><h3>Information Flow</h3><p>A Feedforward Neural Network (FNN) passes information in one direction only:</p><pre>Input → Hidden Layer(s) → Output</pre><p>No loops or feedback connections.</p><h3>Forward Propagation</h3><h3>Step 1</h3><p>Input enters the network.</p><h3>Step 2</h3><p>Weighted sum is calculated.</p><p>z=∑wx+bz=\sum wx+bz=∑wx+b</p><h3>Step 3</h3><p>Activation function applied.</p><p>a=f(z)a=f(z)a=f(z)</p><h3>Step 4</h3><p>Output generated.</p><h3>Example</h3><p>Predict House Price</p><p>Inputs:</p><ul><li>Area</li><li>Bedrooms</li><li>Location Score</li></ul><p>Process:</p><ul><li>Hidden layers learn relationships.</li><li>Output layer predicts house price.</li></ul><h3>Real-World Applications</h3><ul><li>Image Classification</li><li>Handwriting Recognition</li><li>Spam Detection</li><li>Medical Diagnosis</li><li>Fraud Detection</li><li>Customer Churn Prediction</li></ul><h3>6. Understanding the Nomenclature of Multi-Layer Perceptrons</h3><h3>Neurons</h3><p>Basic processing units of a neural network.</p><p>Each neuron:</p><p>Output=f(∑wx+b)Output=f(\sum wx+b)Output=f(∑wx+b)</p><h3>Layers</h3><h3>Input Layer</h3><p>Receives data.</p><h3>Hidden Layer</h3><p>Learns patterns.</p><h3>Output Layer</h3><p>Produces predictions.</p><h3>Epochs</h3><p>One complete pass through the entire training dataset.</p><h3>Example</h3><p>Dataset:</p><ul><li>1000 records</li></ul><p>Training:</p><ul><li>10 epochs</li></ul><p>Meaning:</p><ul><li>The model sees all 1000 records 10 times.</li></ul><h3>Parameters</h3><p>Values learned during training.</p><p>Examples:</p><ul><li>Weights</li><li>Biases</li><li>Formula</li></ul><p>For a neuron with 3 inputs:</p><p>Parameters:</p><p>3 weights +1 bias =43 \text{ weights } + 1 \text{ bias } = 43 weights +1 bias =4</p><h3>Hyperparameters</h3><p>Values set before training.</p><p>Examples:</p><ul><li>Learning Rate</li><li>Number of Epochs</li><li>Batch Size</li><li>Number of Hidden Layers</li><li>Number of Neurons</li></ul><p>These are not learned automatically.</p><h3>Connections</h3><p>Links between neurons.</p><p>Each connection contains a weight.</p><p>Example:</p><pre>Input Neuron 1 ----\<br>                    &gt; Hidden Neuron<br>Input Neuron 2 ----/</pre><p>The strength of each connection is determined by its weight.</p><h3>Quick Exam Points</h3><ul><li><strong>Weight:</strong> Importance of an input.</li><li><strong>Bias:</strong> Extra adjustable value added to weighted sum.</li><li><strong>Activation Function:</strong> Introduces non-linearity.</li><li><strong>Perceptron:</strong> Single-layer neural network.</li><li><strong>MLP:</strong> Neural network with one or more hidden layers.</li><li><strong>Epoch:</strong> One complete pass through training data.</li><li><strong>Parameter:</strong> Weight or bias learned during training.</li><li><strong>Hyperparameter:</strong> User-defined training setting.</li><li><strong>Feedforward Network:</strong> Information flows only forward.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e47a4fe3705f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[1. Understanding the Biological Neuron: The Building Block of Human Intelligence]]></title>
            <link>https://medium.com/@daralavanya79/1-understanding-the-biological-neuron-the-building-block-of-human-intelligence-959f695db21c?source=rss-8a735de70b5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/959f695db21c</guid>
            <dc:creator><![CDATA[Daralavanya]]></dc:creator>
            <pubDate>Mon, 29 Jun 2026 09:30:00 GMT</pubDate>
            <atom:updated>2026-06-29T09:30:00.518Z</atom:updated>
            <content:encoded><![CDATA[<h3>Structure of a Neuron</h3><p>A biological neuron is the basic functional unit of the human nervous system. It receives, processes, and transmits information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/0*GuAIf2XCn2KykI1X" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8IXeoarU0GifMhsC" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/0*OUms3oyZnyZV_nee" /></figure><h3>Main Parts</h3><p><strong>1. Dendrites</strong></p><ul><li>Branch-like structures.</li><li>Receive signals from other neurons.</li><li>Carry information toward the cell body.</li></ul><p><strong>2. Cell Body (Soma)</strong></p><ul><li>Contains the nucleus.</li><li>Processes incoming signals.</li><li>Maintains neuron health.</li></ul><p><strong>3. Axon</strong></p><ul><li>Long fiber extending from the cell body.</li><li>Transmits electrical signals away from the neuron.</li><li>Ends in axon terminals that communicate with other neurons.</li></ul><h3>Signal Transmission</h3><p>Information travels through neurons in the form of electrical and chemical signals.</p><p>Steps</p><p>Dendrites receive signals.</p><ol><li>Cell body integrates the signals.</li><li>If the signal exceeds a threshold, an electrical impulse (action potential) is generated.</li><li>The impulse travels along the axon.</li><li>Neurotransmitters are released at the synapse.</li><li>The next neuron receives the signal.</li></ol><h3>How Learning Happens in the Brain</h3><p>Learning occurs by strengthening or weakening connections between neurons.</p><h3>Key Idea: Synaptic Plasticity</h3><p>Frequently used neural connections become stronger.</p><ul><li>Rarely used connections become weaker.</li><li>This process helps in memory formation and learning.</li></ul><p><strong>Example:</strong><br> When learning to ride a bicycle, repeated practice strengthens the neural pathways involved in balance and coordination.</p><h3>2. From Brain to Machine: Analogy Between Biological and Artificial Neurons</h3><h3>Comparison</h3><p>Biological NeuronArtificial NeuronDendritesInputs (x₁, x₂, …)SynapsesWeights (w₁, w₂, …)Cell BodySummation FunctionAxonOutputLearning by synaptic changesLearning by weight updates</p><h3>Artificial Neuron Model</h3><p>y=f(∑wixi+b)y = f(\sum w_i x_i + b)y=f(∑wi​xi​+b)</p><p>Where:</p><ul><li>x = input</li><li>w = weight</li><li>b = bias</li><li>f = activation function</li><li>y = output</li></ul><h3>Inputs, Weights, Summation, Output</h3><h3>Inputs</h3><p>Information fed into the neuron.</p><p>Example:</p><ul><li>x₁ = 1</li><li>x₂ = 0</li></ul><h3>Weights</h3><p>Importance assigned to each input.</p><p>Example:</p><ul><li>w₁ = 0.8</li><li>w₂ = 0.3</li></ul><h3>Summation</h3><p>Net=x1w1+x2w2Net = x_1w_1 + x_2w_2Net=x1​w1​+x2​w2​</p><p>Output</p><p>Activation function produces the final result.</p><h3>Why ANN Was Inspired by the Human Brain</h3><p>Researchers observed that:</p><ul><li>The brain solves complex problems using interconnected neurons.</li><li>Learning occurs through modification of connections.</li><li>Intelligence emerges from networks of simple processing units.</li></ul><p>This inspired the development of <strong>Artificial Neural Networks (ANNs)</strong>.</p><h3>3. The McCulloch-Pitts (MCP) Neuron Model: The First Artificial Neuron</h3><h3>History</h3><p>The MCP neuron was proposed in <strong>1943</strong> by:</p><ul><li>Warren McCulloch</li><li>Walter Pitts</li></ul><p>It is considered the first mathematical model of an artificial neuron.</p><h3>Two-Input Neuron Model</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*atNn8e95Ju04yRnk" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R5NRlwyihCtIDWpu" /></figure><p>6</p><p>Inputs:</p><ul><li>x₁</li><li>x₂</li></ul><p>Weights:</p><ul><li>w₁</li><li>w₂</li></ul><p>Output:</p><ul><li>y</li></ul><h3>Threshold Concept</h3><p>The MCP neuron produces output only when the weighted sum reaches a threshold.</p><p>y={1if ∑wixi≥θ0otherwisey = \begin{cases} 1 &amp; \text{if } \sum w_ix_i \ge \theta\\ 0 &amp; \text{otherwise} \end{cases}y={10​if ∑wi​xi​≥θotherwise​</p><p>Where:</p><ul><li>θ = threshold value</li></ul><h3>Mathematical Representation</h3><p>For two inputs:</p><p>y={1if w1x1+w2x2≥θ0otherwisey = \begin{cases} 1 &amp; \text{if } w_1x_1 + w_2x_2 \ge \theta\\ 0 &amp; \text{otherwise} \end{cases}y={10​if w1​x1​+w2​x2​≥θotherwise​</p><p>Example:</p><ul><li>x₁ = 1</li><li>x₂ = 1</li><li>w₁ = 1</li><li>w₂ = 1</li><li>θ = 2</li></ul><p>1(1)+1(1)=21(1)+1(1)=21(1)+1(1)=2</p><p>Since 2 ≥ 2,</p><p>Output = 1</p><h3>4. Implementing Logic Gates Using MCP Neurons</h3><h3>AND Gate</h3><h3>Configuration</h3><p>w₁ = 1</p><ul><li>w₂ = 1</li><li>θ = 2</li></ul><h3>Truth Table</h3><p>x₁x₂Output000010100111</p><p>Only when both inputs are 1 does the output become 1.</p><h3>OR Gate</h3><h3>Configuration</h3><p>w₁ = 1</p><ul><li>w₂ = 1</li><li>θ = 1</li></ul><h3>Truth Table</h3><p>x₁x₂Output000011101111</p><p>If any one input is 1, output becomes 1.</p><h3>NAND Gate</h3><h3>Configuration</h3><p>w₁ = -1</p><ul><li>w₂ = -1</li><li>θ = -1.5</li></ul><h3>Truth Table</h3><p>x₁x₂Output001011101110</p><p>NAND is the opposite of AND.</p><h3>Why XOR Cannot Be Implemented by a Single MCP Neuron</h3><h3>XOR Truth Table</h3><p>x₁x₂XOR000011101110</p><h3>Reason</h3><p>A single MCP neuron can only create a <strong>linear decision boundary</strong>.</p><p>The XOR problem is <strong>not linearly separable</strong>, meaning one straight line cannot separate the output classes.</p><p>Therefore:</p><ul><li>AND → Possible</li><li>OR → Possible</li><li>NAND → Possible</li><li>XOR → Not possible with a single MCP neuron</li></ul><p>To implement XOR, we need <strong>multiple neurons arranged in layers</strong>, which led to the development of <strong>Multi-Layer Perceptrons (MLPs)</strong> and modern neural networks.</p><h3>Key Point for Exams</h3><p><strong>XOR cannot be implemented by a single MCP neuron because XOR is not linearly separable. It requires multiple layers of neurons.”</strong> ✅</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=959f695db21c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K-Nearest Neighbors (KNN): A Simple Yet Powerful Machine Learning Algorithm.]]></title>
            <link>https://medium.com/@daralavanya79/k-nearest-neighbors-knn-a-simple-yet-powerful-machine-learning-algorithm-ac49b4d0e97b?source=rss-8a735de70b5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac49b4d0e97b</guid>
            <dc:creator><![CDATA[Daralavanya]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 10:46:05 GMT</pubDate>
            <atom:updated>2026-06-09T10:46:05.055Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Machine Learning offers various algorithms for solving prediction and classification problems. Among the simplest and most intuitive algorithms is <strong>K-Nearest Neighbors (KNN)</strong>. Despite its simplicity, KNN is widely used in practical applications such as recommendation systems, image recognition, medical diagnosis, and fraud detection.</p><p>Unlike many machine learning algorithms that build a mathematical model during training, KNN learns by storing data and making predictions based on the similarity between new and existing data points. This makes it an excellent algorithm for beginners who want to understand how machine learning works.</p><p>Understanding the Intuition Behind KNN</p><p>Imagine moving to a new neighborhood and wanting to know whether it is a safe place to live. One way to estimate this is by observing the nearby houses and residents. If most neighboring areas are safe, you may conclude that your area is also likely to be safe.</p><p>KNN follows the same principle:</p><p><strong>“Similar data points tend to belong to the same category.”</strong></p><p>When a new data point arrives, KNN looks for the most similar existing data points (neighbors) and uses their information to make a prediction.</p><h3>Similarity and Distance</h3><p>To identify similar neighbors, KNN measures the distance between data points.</p><h3>Euclidean Distance</h3><p>The most commonly used distance metric is Euclidean Distance, which represents the straight-line distance between two points.</p><p>Formula:</p><p>[<br>Distance = \sqrt{\sum_{i=1}^{n}(x_i-y_i)²}<br>]</p><p>Where:</p><ul><li>(x_i) = feature value of first point</li><li>(y_i) = feature value of second point</li></ul><p>(n) = number of features</p><h3>Other Distance Metrics</h3><p>Depending on the problem, KNN can use different distance measures:</p><ol><li><strong>Manhattan Distance</strong></li></ol><ul><li>Measures distance along grid lines.</li></ul><p>Useful when movement occurs in fixed directions.</p><ol><li>Minkowski Distance</li></ol><ul><li>Generalized form of Euclidean and Manhattan distances</li></ul><ol><li>Hamming Distance</li></ol><ul><li>Used for categorical or binary data.</li></ul><p>Choosing an appropriate distance metric significantly affects model performance.</p><p>How KNN Works</p><p>The KNN algorithm follows a straightforward process:</p><h3>Step 1: Choose the Value of K</h3><p>K represents the number of nearest neighbors considered during prediction.</p><p>Example:</p><ul><li>K = 3 → consider the 3 nearest neighbors.</li><li>K = 5 → consider the 5 nearest neighbors.</li></ul><h3>Step 2: Calculate Distances</h3><p>Compute the distance between the new data point and every point in the training dataset.</p><h3>Step 3: Find the Nearest Neighbors</h3><p>Sort distances and select the K closest points.</p><h3>Step 4: Make a Prediction</h3><p>The prediction method depends on the problem type.</p><h3>KNN for Classification</h3><p>In classification problems, KNN predicts the class that appears most frequently among the nearest neighbors.</p><p>Example</p><p>Suppose a new fruit needs classification.</p><p>Nearest neighbors:</p><ul><li>Apple</li><li>Apple</li><li>Orange</li><li>Apple</li><li>Orange</li></ul><p>With K = 5:</p><ul><li>Apple = 3 votes</li></ul><p>Orange = 2 votes</p><p>Prediction: <strong>Apple</strong></p><p>This process is known as <strong>majority voting</strong>.</p><h3>KNN for Regression</h3><p>In regression problems, KNN predicts a numerical value.</p><p>Instead of voting, it calculates the average value of the nearest neighbors.</p><h3>Example</h3><p>Neighbor house prices:</p><ul><li>₹20 lakh</li><li>₹22 lakh</li><li>₹24 lakh</li></ul><p>Predicted price:</p><p>[<br>(20 + 22 + 24) / 3 = 22<br>]</p><p>Prediction: <strong>₹22 lakh</strong></p><h3>Choosing the Right Value of K</h3><p>Selecting the correct K value is critical.</p><p>Small K</p><p>Advantages:</p><ul><li>Captures local patterns.</li></ul><p>Disadvantages:</p><ul><li>Sensitive to noise.</li><li>May overfit the data.</li><li>Large K</li></ul><p>Advantages:</p><ul><li>More stable predictions.</li></ul><p>Disadvantages:</p><ul><li>May ignore important local patterns.</li><li>Can underfit the data.</li></ul><p>A common practice is to test multiple K values and choose the one that provides the best validation accuracy.</p><h3>Importance of Feature Scaling</h3><p>KNN relies heavily on distance calculations.</p><p>Consider the following features:</p><p>FeatureRangeAge18–60Salary20,000–1,000,000</p><p>Salary values are much larger and can dominate distance calculations.</p><p>To prevent this issue, features should be scaled using techniques such as:</p><p><strong>Standardization</strong></p><p>Transforms data to have:</p><ul><li>Mean = 0</li><li>Standard Deviation = 1</li></ul><h3>Normalization</h3><p>Scales values to a fixed range, typically:</p><ul><li>0 to 1</li></ul><p>Feature scaling is almost always recommended before applying KNN.</p><h3>Key Hyperparameters in KNN</h3><h3>1. Number of Neighbors (K)</h3><p>Controls how many nearby points influence predictions.</p><h3>2. Distance Metric</h3><p>Options include:</p><ul><li>Euclidean</li><li>Manhattan</li><li>Minkowski</li><li>Hamming</li></ul><h3>3. Weight Function</h3><ul><li>Uniform Weights: Every neighbor contributes equally.</li><li>Distance Weights: Closer neighbors receive more importance.</li></ul><p>Careful tuning of these hyperparameters can improve model performance significantly.</p><h3>Advantages of KNN</h3><h3>Easy to Understand</h3><p>KNN is one of the most intuitive machine learning algorithms.</p><h3>No Training Phase</h3><p>Since KNN stores data instead of building a model, training is extremely fast.</p><h3>Flexible</h3><p>Can be used for both:</p><ul><li>Classification</li><li>Regression</li></ul><h3>Effective for Small Datasets</h3><p>Performs well when the dataset size is manageable and patterns are clear.</p><h3>Limitations of KNN</h3><h3>Computationally Expensive During Prediction</h3><p>Distance calculations are performed for every new prediction.</p><h3>Sensitive to Irrelevant Features</h3><p>Unimportant features can negatively affect distance measurements.</p><h3>Requires Feature Scaling</h3><p>Without scaling, results may become inaccurate.</p><h3>Struggles with Large Datasets</h3><p>Prediction speed decreases significantly as dataset size grows.</p><h3>Curse of Dimensionality</h3><p>Performance often declines when the number of features becomes very large.</p><h3>Real-World Applications of KNN</h3><h3>1. Recommendation Systems</h3><p>Suggest products, movies, or songs based on users with similar preferences.</p><h3>2. Medical Diagnosis</h3><p>Identify diseases by comparing patient records with historical cases.</p><h3>3. Image Recognition</h3><p>Classify images by analyzing similarities between visual features.</p><h3>4. Fraud Detection</h3><p>Detect suspicious transactions by comparing them with known fraud patterns.</p><h3>5. Credit Risk Assessment</h3><p>Assist financial institutions in evaluating loan applicants.</p><h3>6. Customer Segmentation</h3><p>Group customers with similar purchasing behavior for targeted marketing.</p><h3>Simple KNN Workflow Diagram</h3><pre>New Data Point<br>       |<br>       v<br>Calculate Distance<br>       |<br>       v<br>Find K Nearest Neighbors<br>       |<br>       v<br>-----------------------<br>| Classification      |<br>| Majority Voting     |<br>-----------------------<br>       OR<br>-----------------------<br>| Regression          |<br>| Average Value       |<br>-----------------------<br>       |<br>       v<br>Prediction</pre><p><strong><em>.</em>Conclusion</strong></p><p>K-Nearest Neighbors (KNN) is one of the simplest yet most effective machine learning algorithms. It operates on the idea that similar data points are likely to produce similar outcomes. By identifying the nearest neighbors and using their information, KNN can solve both classification and regression problems with impressive effectiveness.</p><p>Although KNN may become computationally expensive for large datasets and requires careful feature scaling, its simplicity, interpretability, and versatility make it an excellent starting point for anyone learning machine learning. Understanding KNN also provides a strong foundation for exploring more advanced machine learning techniques in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac49b4d0e97b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Preprocessing:Encoding and Feature Scaling in Machine Learning.]]></title>
            <link>https://medium.com/@daralavanya79/data-preprocessing-encoding-and-feature-scaling-in-machine-learning-120e77e5e20e?source=rss-8a735de70b5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/120e77e5e20e</guid>
            <dc:creator><![CDATA[Daralavanya]]></dc:creator>
            <pubDate>Mon, 08 Jun 2026 18:51:39 GMT</pubDate>
            <atom:updated>2026-06-08T18:51:39.136Z</atom:updated>
            <content:encoded><![CDATA[<p>Machine Learning models cannot directly understand raw data. Before training a model, the data must be cleaned, transformed, and prepared properly. This process is called <strong>Data Preprocessing</strong>.</p><p>Two of the most important preprocessing techniques are:</p><ol><li><strong>Encoding</strong> — Converting categorical data into numerical format.</li><li><strong>Feature Scaling</strong> — Bringing numerical features to a common scale.</li></ol><p>These techniques improve model accuracy, training speed, and overall performance.</p><h3>Data Preprocessing Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*PmmAYZAttVCu-qb4" /></figure><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*vktbDLrywYfbyGEw" /></figure><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*5UuZZjSmvRcIC6vV" /></figure><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/0*kHC1N0nSN-BvqsLv" /></figure><p>Data preprocessing is the process of transforming raw data into a suitable format for machine learning algorithms.</p><h3>Why is Data Preprocessing Important?</h3><ul><li>Improves model performance</li><li>Reduces training time</li><li>Handles inconsistencies in data</li><li>Prevents bias caused by different feature scales</li><li>Converts non-numeric data into machine-readable format</li></ul><h3>1. Encoding</h3><p>Encoding is the process of converting categorical (text) data into numerical values so that machine learning algorithms can understand and process the data effectively.</p><p><strong>Types of Encoding in Machine Learning</strong></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*oktcEwdi2qzP-0vd.jpeg" /></figure><h3>What is Label Encoding?</h3><p><strong>Label Encoding</strong> is a data preprocessing technique used to convert categorical (text) data into numerical values. Each unique category is assigned a unique integer value.</p><p>Machine learning algorithms cannot directly understand text data, so Label Encoding helps transform categorical features into a format that models can process.</p><p>Here:</p><ul><li>Female → 0</li><li>Male → 1</li></ul><p>The categorical values are replaced with numerical labels.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/0*rzQoCwSzHJbQGoHq" /></figure><h3>Why Use Label Encoding?</h3><ul><li>Converts categorical data into numeric form.</li><li>Easy and fast to implement.</li><li>Requires less memory compared to One-Hot Encoding.</li><li>Suitable for binary categorical variables</li></ul><h3>What is One-Hot Encoding?</h3><p><strong>One-Hot Encoding</strong> is a data preprocessing technique used to convert categorical data into numerical format by creating a separate binary column for each category.</p><p>Unlike Label Encoding, One-Hot Encoding does not assign numbers directly to categories, which helps avoid creating a false order among categories.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*Wwg8HmyIrNf6QLHm" /></figure><h3>What is Ordinal Encoding?</h3><p><strong>Ordinal Encoding</strong> is a data preprocessing technique used to convert categorical data into numerical values while preserving the natural order or ranking of the categories.</p><p>Unlike One-Hot Encoding, Ordinal Encoding is specifically designed for features where the categories have a meaningful sequence.</p><h3>Why Do We Need Ordinal Encoding?</h3><p>Some categorical variables naturally follow an order.</p><p>Use Ordinal Encoding when categories have a meaningful ranking.</p><h3>When Not to Use Ordinal Encoding?</h3><p>Avoid Ordinal Encoding for categories without any order.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*mGFKiTMAk4ZgyKlj" /></figure><h3>What is Binary Encoding?</h3><p><strong>Binary Encoding</strong> is a categorical data encoding technique that combines the advantages of <strong>Label Encoding</strong> and <strong>One-Hot Encoding</strong>. It converts categories into numerical values and then transforms those values into binary (0s and 1s) representations.</p><p>Binary Encoding is especially useful when a feature contains a large number of unique categories (high cardinality).</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*NZT8FnOm-3oHXd7J" /></figure><p>When to Use Binary Encoding?</p><p>Use Binary Encoding when:</p><ul><li>The dataset contains many unique categories.</li><li>One-Hot Encoding creates too many columns.</li><li>Memory efficiency is important.</li><li>You are working with large datasets.</li></ul><h3>What is Frequency Encoding?</h3><p><strong>Frequency Encoding</strong> is a categorical data preprocessing technique in which each category is replaced by the number of times it appears in the dataset.</p><p>Instead of creating new columns like One-Hot Encoding, Frequency Encoding uses the frequency count of each category as its numerical representation.</p><h3>Why Do We Need Frequency Encoding?</h3><p>Machine learning algorithms require numerical input. When a dataset contains categorical variables with many unique categories, One-Hot Encoding can create a large number of columns.Frequency Encoding solves this problem by replacing each category with its occurrence count.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*01O5XSJPz76HdbQR" /></figure><p>When to Use Frequency Encoding?</p><p>Use Frequency Encoding when:</p><ul><li>The dataset contains high-cardinality categorical features.</li><li>Memory usage is a concern.</li><li>One-Hot Encoding creates too many columns.</li><li>You want a simple numerical representation of categories.</li></ul><h3>What is Target Encoding?</h3><p><strong>Target Encoding</strong> is a categorical data encoding technique in which each category is replaced with the <strong>mean (average) value of the target variable</strong> for that category.</p><p>Unlike Label Encoding or One-Hot Encoding, Target Encoding uses information from the target column to create meaningful numerical representations of categories.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*RY2nEgajkfQH9xqE" /></figure><h3>When to Use Target Encoding?</h3><p>Use Target Encoding when:</p><ul><li>The dataset contains high-cardinality categorical features.</li><li>One-Hot Encoding creates too many columns.</li><li>You want to capture category-target relationships.</li><li>Working with large datasets.</li></ul><h3>Conclusion</h3><p>Encoding is a crucial preprocessing step in machine learning because algorithms require numerical input. Different encoding techniques are suitable for different types of categorical data. Label Encoding works well for binary variables, One-Hot Encoding is ideal for nominal categories, Ordinal Encoding preserves category order, while Binary, Frequency, and Target Encoding are useful for handling high-cardinality features. Choosing the right encoding technique improves model accuracy, reduces complexity, and helps machine learning algorithms learn meaningful patterns from the data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=120e77e5e20e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linear Regression:]]></title>
            <link>https://medium.com/@daralavanya79/linear-regression-e8441a9a12b3?source=rss-8a735de70b5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8441a9a12b3</guid>
            <dc:creator><![CDATA[Daralavanya]]></dc:creator>
            <pubDate>Thu, 28 May 2026 14:43:28 GMT</pubDate>
            <atom:updated>2026-05-28T14:43:28.220Z</atom:updated>
            <content:encoded><![CDATA[<p>Linear Regression is one of the simplest and most widely used algorithms in machine learning and statistics. It helps us understand the relationship between variables and make predictions based on that relationship.<br>In this article, we will break it down in a simple way with intuition, math, and visuals.</p><p><strong>What is Linear Regression?</strong><br>Linear Regression is a supervised learning algorithm used to predict a continuous value.<br>It finds the best-fitting straight line between input (independent variable) and output (dependent variable).<br>For example:<br>Predicting house price based on area<br>Predicting salary based on experience<br>Predicting sales based on advertising spend</p><p><strong>Equation of Linear Regression</strong><br>The mathematical form is:<br>Where:<br>y → predicted value<br>x → input feature<br>m → slope (weight)<br>b → intercept (bias)<br>In machine learning terms:<br>m = coefficient (learned from data)<br>b = intercept (learned from data)</p><p><strong>How Linear Regression Works</strong><br>The goal is to find the best values of m and b such that prediction error is minimized.<br><strong>Step-by-step process:</strong><br>Start with random line<br>Calculate error between predicted and actual values<br>Adjust line to reduce error<br>Repeat until best fit line is found</p><p><strong>Cost Function (Error Measurement)</strong><br>Linear Regression uses Mean Squared Error (MSE):</p><p>Where:<br>yi= actual value<br>yi^n = predicted value<br>n = number of data points<br>The goal is to minimize this error.</p><p><strong>Residuals (Errors in Prediction)</strong></p><p>The vertical distance between actual data points and the regression line is called residual error.</p><p><strong>Types of Linear Regression<br>1. Simple Linear Regression</strong><br>One input variable<br>One output variable<br>Example: Salary vs Experience<br><strong>2. Multiple Linear Regression</strong><br>Multiple input variables<br>One output variable<br>Example: House price depends on:<br>Area<br>Location<br>Number of rooms</p><p><strong>Conclusion</strong><br>Linear Regression is the foundation of machine learning. It teaches how models learn relationships between variables and make predictions.<br>Even though it is simple, it is extremely powerful when data follows a linear pattern.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8441a9a12b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hyper-parameter Tuning using GridSearchCV and RandomizedSearchCV.]]></title>
            <link>https://medium.com/@daralavanya79/hyper-parameter-tuning-using-gridsearchcv-and-randomizedsearchcv-8e4c1d775b31?source=rss-8a735de70b5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e4c1d775b31</guid>
            <dc:creator><![CDATA[Daralavanya]]></dc:creator>
            <pubDate>Thu, 28 May 2026 14:24:28 GMT</pubDate>
            <atom:updated>2026-05-28T14:24:28.596Z</atom:updated>
            <content:encoded><![CDATA[<h3>Machine Learning models contain two types of parameters:</h3><ul><li><strong>Model Parameters</strong> → Learned automatically from data<br>Example: weights in Linear Regression</li><li><strong>Hyperparameters</strong> → Set manually before training<br>Example:</li><li>Number of neighbors in KNN</li><li>Depth of Decision Tree</li><li>Learning rate in XGBoost</li></ul><p>Choosing the correct hyperparameters can greatly improve model performance.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*TiSkz_miuLiJ1DYi.jpeg" /></figure><h3>What is Hyperparameter Tuning?</h3><p>Hyperparameter Tuning is the process of finding the <strong>best combination of hyperparameters</strong> for a machine learning model.</p><p>Goal:</p><ul><li>Improve accuracy</li><li>Reduce overfitting</li><li>Increase model performance</li></ul><p><strong>Why Hyperparameter Tuning is Important</strong></p><p>Without tuning:</p><ul><li>Model may underfit</li><li>Model may overfit</li><li>Accuracy may be low</li></ul><p>With tuning:</p><ul><li>Better predictions</li><li>Optimized performance</li><li>More reliable model</li></ul><h3>Common Hyperparameters:</h3><p>Hyperparameters are configuration settings used to control the learning process of a machine learning algorithm. Unlike model parameters, hyperparameters are not learned automatically from the data. They are set before training begins and play a major role in determining how well a model performs.</p><p>Different machine learning algorithms have different hyperparameters. Selecting the correct values can improve model accuracy, reduce overfitting, and increase overall efficiency.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*eBiIB_TsY3X5kF95.png" /></figure><h3>1. K-Nearest Neighbors (KNN)</h3><p>Machine Learning KNN predicts the class of a data point based on its nearest neighbors.</p><h3>n_neighbors</h3><p>Defines how many nearby points are considered.</p><ul><li>Small values may lead to overfitting.</li><li>Large values may lead to underfitting.</li></ul><p>Determines the distance calculation method.</p><p>In algorithms like K-Nearest Neighbors, the metric hyperparameter decides<strong> </strong>how the distance between data points is measured.</p><p>KNN works by finding the nearest neighbors of a new data point.<br>To identify which points are “nearest,” the algorithm needs a distance formula. This formula is called the <strong>distance metric</strong>.</p><p>Common metrics:</p><p>1.Euclidean Distance</p><p>This is the most common distance metric.</p><p>It calculates the direct straight-line distance between two points</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/0*9E_fEtyB_4hHEAdC.png" /></figure><p>2.Manhattan Distance</p><p>Manhattan Distance is a distance measurement method used in machine learning algorithms like KNN.</p><p>It calculates the distance between two points by moving only:</p><ul><li>Horizontally</li><li>Vertically</li></ul><p>instead of using a straight-line path.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/0*4nhkh5Uue5mGHoyZ.png" /></figure><p>3.Minkowski Distance</p><p>Minkowski Distance is a generalized distance measurement method used in machine learning algorithms like KNN.</p><p>It combines both:</p><ul><li>Euclidean Distance</li><li>Manhattan Distance</li></ul><p>into a single formula.</p><p>The type of distance depends on the value of <strong>p</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/0*G3zw5vsc9ZyrJkfV.png" /></figure><h3>Decision Tree</h3><p>Decision Tree is a supervised learning algorithm used for:</p><ul><li>Classification</li><li>Regression</li></ul><p>It works like a flowchart where:</p><ul><li>Internal nodes represent conditions</li><li>Branches represent decisions</li><li>Leaf nodes represent final output</li></ul><h3>Random Forest</h3><p>Random Forest is an ensemble learning method that combines multiple decision trees.</p><p>Instead of using one tree, Random Forest:</p><ul><li>Builds many trees</li><li>Combines their predictions</li><li>Produces more accurate results</li></ul><h3>Logistic Regression</h3><p>Logistic Regression is a supervised machine learning algorithm mainly used for classification problems.</p><p>It predicts probabilities between:</p><ul><li>0 and 1</li></ul><p>Common uses:</p><ul><li>Spam detection</li><li>Disease prediction</li><li>Customer churn prediction</li></ul><h3>Support Vector Machine (SVM)</h3><p>Support Vector Machine is a powerful algorithm used for:</p><ul><li>Classification</li><li>Regression</li></ul><p>It works by finding the best boundary (hyperplane) that separates classes.</p><h3>How SVM Works</h3><p>Finds optimal hyperplane</p><ol><li>Maximizes margin between classes</li><li>Uses support vectors for classification</li></ol><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*XsRnZaHJRU1DLimV.png" /></figure><h3>GridSearchCV</h3><p>Scikit-learn GridSearchCV is a hyperparameter tuning technique used in machine learning to find the best combination of hyperparameters automatically.</p><p>It tests:</p><ul><li>Multiple parameter combinations</li><li>Using Cross Validation</li><li>And selects the best-performing model</li></ul><h3>Why GridSearchCV is Used</h3><p>Machine learning models contain hyperparameters such as:</p><ul><li>max_depth in Decision Tree</li><li>C in Logistic Regression</li></ul><p>Choosing the correct values improves:</p><ul><li>Accuracy</li><li>Performance</li><li>Reliability</li></ul><p>GridSearchCV automates this process.</p><h3>What is RandomizedSearchCV?</h3><p><strong>RandomizedSearchCV</strong> selects <strong>random combinations</strong> of hyperparameters instead of checking all combinations.</p><ul><li>Faster</li><li>Efficient for large datasets</li><li>Useful when parameter space is huge</li></ul><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*aSRJHscQH9bGIFyJ.jpeg" /></figure><h3>Conclusion</h3><p>Hyperparameter Tuning is an essential step in Machine Learning that helps improve model accuracy and overall performance by selecting the best hyperparameter values.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e4c1d775b31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evaluation metrics for regression and classification.]]></title>
            <link>https://medium.com/@daralavanya79/evaluation-metrics-for-regression-and-classification-315a97297fe8?source=rss-8a735de70b5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/315a97297fe8</guid>
            <dc:creator><![CDATA[Daralavanya]]></dc:creator>
            <pubDate>Wed, 27 May 2026 10:05:53 GMT</pubDate>
            <atom:updated>2026-05-27T10:05:53.304Z</atom:updated>
            <content:encoded><![CDATA[<p>Creating a Machine Learning model is not the final goal. After training a model, we must evaluate how accurately and effectively it performs on unseen data. Evaluation metrics provide a way to measure model performance and determine whether the predictions are reliable.</p><p>These metrics are important because they help data scientists and developers:</p><ul><li>Understand prediction quality</li><li>Compare multiple models</li><li>Identify model weaknesses</li><li>Reduce prediction errors</li><li>Improve overall system accuracy</li><li>Build dependable AI applications</li></ul><p>Without proper evaluation, it becomes impossible to know whether a model is useful in real-world situations.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*MdotQpmmCu1mLAZz.png" /></figure><h3>Evaluation Metrics for Regression Models</h3><p>Regression models are used when the target output is a continuous numerical value.</p><h3>Examples of Regression Applications</h3><p>Predicting house prices</p><p>Estimating employee salaries</p><p>Forecasting weather conditions</p><p>Predicting stock market prices</p><p>Estimating sales revenue</p><p>To measure the performance of regression models, several evaluation metrics are commonly used:</p><ul><li>Mean Absolute Error (MAE)</li><li>Mean Squared Error (MSE)</li><li>Root Mean Squared Error (RMSE)</li><li>R² Score (Coefficient of Determination)</li></ul><p>Each metric evaluates model performance in a different way.</p><p><strong>Regression Prediction Example</strong></p><p><strong>Mean Absolute Error (MAE)</strong></p><p>MAE measures the average absolute difference between actual and predicted values. A lower MAE indicates better model performance.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*kR9_JkCNc_jZOOde.png" /></figure><p><strong>Mean Squared Error (MSE)</strong></p><p>MSE squares the errors before averaging them. Large errors receive more penalty, making it useful for optimization problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/0*E66qIL8z97r53Syi.png" /></figure><p><strong>Root Mean Squared Error (RMSE)</strong></p><p>RMSE is the square root of MSE and is easy to interpret because it uses the same unit as the target variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/0*aD97BRd6yXSa6NYb.png" /></figure><p><strong>R² Score</strong></p><p>R² measures how much variance in the data is explained by the model. Values closer to 1 indicate stronger performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/0*j_M9oSMjW5n9Vzz1.png" /></figure><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*hYg8rNQ3U_McsQF_.png" /></figure><h3>2. Evaluation Metrics for Classification Models</h3><p><strong>Classification models predict categories or labels such as:</strong></p><ul><li>Spam or Not Spam</li><li>Disease or No Disease</li><li>Fraud or Legitimate Transaction</li><li>Pass or Fail</li></ul><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/0*492oOWBLGcC3Dcu1.png" /></figure><p><strong>Accuracy</strong></p><p>Accuracy measures the percentage of correct predictions. It works well when the dataset is balanced.</p><p>Press enter or click to view image in full size</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/0*uzSDyCAucP8bkjxK.png" /></figure><h3>Interpretation</h3><ul><li>67% predictions are correct</li><li>Higher accuracy means better performance</li></ul><p><strong>Precision</strong></p><p>Precision measures how many predicted positive values are actually positive. Important when false positives are costly.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*UYJlnjlW-0Nitfbj.png" /></figure><h3>Interpretation</h3><ul><li>Out of all predicted Disease cases, 67% are correct</li><li>High Precision means low False Positives</li></ul><h3>Recall</h3><p>Recall measures how many actual positive cases are correctly identified. Important in medical diagnosis and fraud detection.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*O4VjCsO0lBDZ-WCm.png" /></figure><h3>Interpretation</h3><p>Model identified 67% of actual disease patients</p><p>High Recall means low False Negatives</p><p><strong>F1 Score</strong></p><p>F1 Score balances precision and recall. It is highly useful for imbalanced datasets.</p><p>Press enter or click to view image in full size</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*FgEf8Z7o1ubITvjd.png" /></figure><h3>Interpretation</h3><p>Combines Precision and Recall into a single score</p><p>Useful when dataset is imbalanced</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*3z2_10Hd7f-iSacI.png" /></figure><h3>4. Conclusion</h3><p>Evaluation metrics are one of the most important concepts in Machine Learning because they help us understand model quality and performance. Regression metrics focus on prediction error for numerical problems, while classification metrics evaluate prediction quality for categorical problems. Choosing the right evaluation metric helps build accurate, reliable, and intelligent machine learning systems</p><p>·</p><h3><a href="https://medium.com/@sridurgathogiti268/text-preprocessing-in-nlp-bag-of-words-bow-and-tfidf-dcba9f117916?source=post_page---author_recirc--81c8f69babf6----0---------------------2b3e83ba_a2a1_498c_87c4_52f1ba32acd1--------------">machine learning algorithm can analyze text, the textual data must first be converted into a numerical format. Techniques like Bag of Words…</a></h3><p><a href="https://medium.com/@sridurgathogiti268/text-preprocessing-in-nlp-bag-of-words-bow-and-tfidf-dcba9f117916?source=post_page---author_recirc--81c8f69babf6----0---------------------2b3e83ba_a2a1_498c_87c4_52f1ba32acd1--------------">5</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/0*JYQbF9XC5J6kFBkk.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/25/0*MRVLdeIWH47Z27Yj" /></figure><p><a href="https://medium.com/@sridurgathogiti268?source=post_page---author_recirc--81c8f69babf6----1---------------------2b3e83ba_a2a1_498c_87c4_52f1ba32acd1--------------">Sri Durga Thogiti</a></p><p>·</p><p>6d ago</p><h3><a href="https://medium.com/@sridurgathogiti268/the-complete-guide-to-feature-selection-techniques-in-machine-learning-cc9fb1c76b42?source=post_page---author_recirc--81c8f69babf6----1---------------------2b3e83ba_a2a1_498c_87c4_52f1ba32acd1--------------">The Complete Guide to Feature Selection Techniques in Machine Learning</a></h3><h3><a href="https://medium.com/@sridurgathogiti268/the-complete-guide-to-feature-selection-techniques-in-machine-learning-cc9fb1c76b42?source=post_page---author_recirc--81c8f69babf6----1---------------------2b3e83ba_a2a1_498c_87c4_52f1ba32acd1--------------">How to choose the right features, reduce dimensionality, and build models that actually generalize — with practical Python examples.</a></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/0*ISKby_m8BKvTeXv2.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/25/0*_vRZe0jEM3dVQfB1" /></figure><p><a href="https://medium.com/@sridurgathogiti268?source=post_page---author_recirc--81c8f69babf6----2---------------------2b3e83ba_a2a1_498c_87c4_52f1ba32acd1--------------">Sri Durga Thogiti</a></p><p>·</p><p>5d ago</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=315a97297fe8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Naive Bayes Algorithm]]></title>
            <link>https://medium.com/@daralavanya79/naive-bayes-algorithm-77f0ea6c0d3c?source=rss-8a735de70b5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/77f0ea6c0d3c</guid>
            <dc:creator><![CDATA[Daralavanya]]></dc:creator>
            <pubDate>Wed, 27 May 2026 09:36:10 GMT</pubDate>
            <atom:updated>2026-05-27T09:36:10.167Z</atom:updated>
            <content:encoded><![CDATA[<h3>Naive Bayes Algorithm</h3><h3>1. What is Naive Bayes?</h3><p>Naive Bayes is a supervised machine learning algorithm mainly used for classification tasks. It predicts the category or class of data based on probability.</p><p>The algorithm is based on Bayes’ Theorem and assumes that all input features are independent of each other, which is why it is called “Naive.”</p><p>Naive Bayes is widely used in text classification, sentiment analysis, spam filtering, and recommendation systems because it is simple, fast, and effective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*s3o23_qsIsg8xoml.jpeg" /></figure><h3>Examples:</h3><p>Email classification → Spam or Not Spam</p><p>Movie review analysis → Positive or Negative</p><p>News article classification → Sports, Politics, or Entertainment</p><p>Medical diagnosis → Disease or No Disease</p><h3>3. Bayes Theorem</h3><p>Use this visual in your article:</p><p>P(A|B)=P(B|A)P(A)/P(B)</p><p>Meaning:</p><p><strong>P(A|B)</strong> → Probability of A given B</p><p><strong>P(B|A)</strong> → Probability of B given A</p><p><strong>P(A)</strong> → Prior probability</p><p><strong>P(B)</strong> → Evidence probability</p><p>Simple interpretation:</p><p>Posterior = Likelihood × Prior / Evidence</p><h3>4. Why is it called “Naive”?</h3><p>It assumes all features are <strong>independent</strong>.</p><p>Example:</p><p>For house price prediction:</p><ul><li>Size</li><li>Location</li><li>Bedrooms</li></ul><p>Naive Bayes assumes they don’t affect each other (which is often not true).</p><p>That’s why it’s called <strong>“Naive”</strong>.</p><h3>Visual 1: Working Flow</h3><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*pVS4J8P0PzK9KXCU" /></figure><h3>5. How Naive Bayes Works (Step-by-Step)</h3><h3>Step 1: Collect training data</h3><p>Example:</p><h3>Weather Prediction (Play Tennis or Not)</h3><p>Imagine we want to teach the Naive Bayes model to predict:</p><p><strong>“Should we play tennis today?”</strong></p><p>To do this, we give the model past weather examples with the correct answers.</p><p>For example:</p><ul><li>Sunny, Hot, High Humidity, Not Windy → Do Not Play</li><li>Sunny, Hot, High Humidity, Windy → Do Not Play</li><li>Cloudy, Hot, High Humidity, Not Windy → Play</li><li>Rainy, Mild, High Humidity, Not Windy → Play</li><li>Rainy, Cool, Normal Humidity, Not Windy → Play</li><li>Rainy, Cool, Normal Humidity, Windy → Do Not Play</li><li>Cloudy, Cool, Normal Humidity, Windy → Play</li></ul><h3>Step 2: Calculate probabilities</h3><p>Example:</p><p>Probability of Spam:</p><p>P(Spam)=2/3</p><h3>Step 3: Check word probabilities</h3><p>Example:</p><p>Probability of word “Free” in spam emails:</p><p>P(Free∣Spam)</p><p><strong>Step 4: Multiply probabilities</strong></p><p>Naive Bayes combines all probabilities and chooses the highest one.</p><p><strong>Visual 2: Probability Example</strong></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*uSoeWlJww8qnfrXL" /></figure><h3>6. Types of Naive Bayes</h3><h3>Gaussian Naive Bayes</h3><p>Used for <strong>continuous numerical data</strong></p><p>Examples:</p><ul><li>Height</li><li>Salary</li><li>Temperature</li></ul><h3>Multinomial Naive Bayes</h3><p>Used for <strong>text classification</strong></p><p>Examples:</p><ul><li>Spam detection</li><li>Sentiment analysis</li></ul><h3>Bernoulli Naive Bayes</h3><p>Used for <strong>binary features (Yes/No)</strong></p><p>Example:</p><ul><li>Contains word “free”? Yes/No</li></ul><h3>Conclusion</h3><p>Naive Bayes is a simple, fast, and efficient machine learning classification algorithm based on probability and Bayes’ Theorem. It is especially useful for text classification tasks such as spam detection, sentiment analysis, and document categorization.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77f0ea6c0d3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>