<?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 PTU AI CLUB on Medium]]></title>
        <description><![CDATA[Stories by PTU AI CLUB on Medium]]></description>
        <link>https://medium.com/@ai-club?source=rss-3f61345ea673------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jQcEyQkcAVLLfgKwRbRv8g.png</url>
            <title>Stories by PTU AI CLUB on Medium</title>
            <link>https://medium.com/@ai-club?source=rss-3f61345ea673------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 13:10:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ai-club/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[ML101: T-Distributed Stochastic Neighbor Embeddings (t-SNE) part-2.]]></title>
            <link>https://medium.com/@ai-club/ml101-t-distributed-stochastic-neighbor-embeddings-t-sne-part-2-4c59b71064a6?source=rss-3f61345ea673------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c59b71064a6</guid>
            <dc:creator><![CDATA[PTU AI CLUB]]></dc:creator>
            <pubDate>Sun, 09 Jun 2024 14:52:42 GMT</pubDate>
            <atom:updated>2024-06-09T14:52:42.003Z</atom:updated>
            <content:encoded><![CDATA[<p>Authors: Ravi Kumar</p><p>In the previous article, we have seen the theoretical aspects of t-SNE, in this article we will focus on t-SNE implementation and its coding aspects.</p><p>Let’s implement the t-SNE algorithm on the MNIST handwritten digit database in <strong>Python</strong>. This is one of the most explored dataset for image processing.</p><p>An important thing to note is that the “pip install t-sne” produces an error. Installing “t-sne” package is not recommended. t-SNE algorithm can be accessed from the sklearn package.</p><p><strong>Hyperparameter Tuning</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*F0KtA-wElxDcAqIqSv36rQ.png" /></figure><p>Lets Dive into Code part!!!</p><pre>from time import time<br>import numpy as np<br>import matplotlib.pyplot as plt<br>from matplotlib import offsetbox<br>from sklearn import (manifold, datasets, decomposition, ensemble,<br>             discriminant_analysis, random_projection)<br><br>## Loading and curating the data<br>digits = datasets.load_digits(n_class=10)<br>X = digits.data<br>y = digits.target<br>n_samples, n_features = X.shape<br>n_neighbors = 30<br>## Function to Scale and visualize the embedding vectors<br>def plot_embedding(X, title=None):<br>    x_min, x_max = np.min(X, 0), np.max(X, 0)<br>    X = (X - x_min) / (x_max - x_min)     <br>    plt.figure()<br>    ax = plt.subplot(111)<br>    for i in range(X.shape[0]):<br>        plt.text(X[i, 0], X[i, 1], str(digits.target[i]),<br>                 color=plt.cm.Set1(y[i] / 10.),<br>                 fontdict={&#39;weight&#39;: &#39;bold&#39;, &#39;size&#39;: 9})<br>    if hasattr(offsetbox, &#39;AnnotationBbox&#39;):<br>        ## only print thumbnails with matplotlib &gt; 1.0<br>        shown_images = np.array([[1., 1.]])  # just something big<br>        for i in range(digits.data.shape[0]):<br>            dist = np.sum((X[i] - shown_images) ** 2, 1)<br>            if np.min(dist) &lt; 4e-3:<br>                ## don&#39;t show points that are too close<br>                continue<br>            shown_images = np.r_[shown_images, [X[i]]]<br>            imagebox = offsetbox.AnnotationBbox(<br>                offsetbox.OffsetImage(digits.images[i], cmap=plt.cm.gray_r),<br>                X[i])<br>            ax.add_artist(imagebox)<br>    plt.xticks([]), plt.yticks([])<br>    if title is not None:<br>        plt.title(title)<br><br>#----------------------------------------------------------------------<br>## Plot images of the digits<br>n_img_per_row = 20<br>img = np.zeros((10 * n_img_per_row, 10 * n_img_per_row))<br>for i in range(n_img_per_row):<br>    ix = 10 * i + 1<br>    for j in range(n_img_per_row):<br>        iy = 10 * j + 1<br>        img[ix:ix + 8, iy:iy + 8] = X[i * n_img_per_row + j].reshape((8, 8))<br>plt.imshow(img, cmap=plt.cm.binary)<br>plt.xticks([])<br>plt.yticks([])<br>plt.title(&#39;A selection from the 64-dimensional digits dataset&#39;)<br>## Computing PCA<br>print(&quot;Computing PCA projection&quot;)<br>t0 = time()<br>X_pca = decomposition.TruncatedSVD(n_components=2).fit_transform(X)<br>plot_embedding(X_pca,<br>               &quot;Principal Components projection of the digits (time %.2fs)&quot; %<br>               (time() - t0))<br>## Computing t-SNE<br>print(&quot;Computing t-SNE embedding&quot;)<br>tsne = manifold.TSNE(n_components=2, init=&#39;pca&#39;, random_state=0)<br>t0 = time()<br>X_tsne = tsne.fit_transform(X)<br>plot_embedding(X_tsne,<br>               &quot;t-SNE embedding of the digits (time %.2fs)&quot; %<br>               (time() - t0))<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*7MIa8vi-yq0D8Sh9ULCOzA.png" /><figcaption>PCA-Image</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*2UvfQAUFZHzUDjF0H68StA.png" /><figcaption>t-SNE</figcaption></figure><h4>8. Where and When to use t-SNE?</h4><h4>8.1 Data Scientist</h4><p>Well for the data scientist, the main problem while using t-SNE is the black box-type nature of the algorithm. This impedes the process of providing inferences and insights based on the results. Also, another problem with the algorithm is that it doesn’t always provide a similar output on successive runs.</p><p>So then how could you use the algorithm? The best way to used the algorithm is to use it for exploratory data analysis. It will give you a very good sense of patterns hidden inside the data. It can also be used as an input parameter for other classification &amp; clustering algorithms.</p><h4>8.2 Machine Learning Hacker</h4><p>Reduce the dataset to 2 or 3 dimensions and stack this with a non-linear stacker. Using a holdout set for stacking / blending. Then you can boost the t-SNE vectors using XGboost to get better results.</p><h4>8.3 Data Science Enthusiasts</h4><p>For data science enthusiasts who are beginning to work with data science, this algorithm presents the best opportunities in terms of research and performance enhancements. There have been a few research papers attempting to improve the time complexity of the algorithm by utilizing linear functions. But an optimal solution is still required. Research papers on implementing t-SNE for a variety of NLP problems and image processing applications is an unexplored territory and has enough scope.</p><h4><strong>9. Common Fallacies</strong></h4><p>Following are a few common fallacies to avoid while interpreting the results of t-SNE:</p><p>1. For the algorithm to execute properly, the perplexity should be smaller than the number of points. Also, the suggested perplexity is in the range of (5 to 50)</p><p>2. Sometimes, different runs with same hyper parameters may produce different results.</p><p>3. Cluster sizes in any t-SNE plot must not be evaluated for standard deviation, dispersion or any other similar measures. This is because t-SNE expands denser clusters and contracts sparser clusters to even out cluster sizes. This is one of the reasons for the crisp and clear plots it produces.</p><p>4. Distances between clusters may change because global geometry is closely related to optimal perplexity. And in a dataset with many clusters with different number of elements one perplexity cannot optimize distances for all clusters.</p><p>5. Patterns may be found in random noise as well, so multiple runs of the algorithm with different sets of hyperparameter must be checked before deciding if a pattern exists in the data.</p><p>6. Different cluster shapes may be observed at different perplexity levels.</p><p>7. Topology cannot be analyzed based on a single t-SNE plot, multiple plots must be observed before making any assessment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c59b71064a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML101: T-Distributed Stochastic Neighbour Embeddings (t-SNE) part-1.]]></title>
            <link>https://medium.com/@ai-club/ml101-t-distributed-stochastic-neighbour-embeddings-t-sne-part-1-dce3db2b0c21?source=rss-3f61345ea673------2</link>
            <guid isPermaLink="false">https://medium.com/p/dce3db2b0c21</guid>
            <category><![CDATA[t-sne-explained]]></category>
            <dc:creator><![CDATA[PTU AI CLUB]]></dc:creator>
            <pubDate>Sun, 09 Jun 2024 14:35:03 GMT</pubDate>
            <atom:updated>2024-06-09T14:35:03.547Z</atom:updated>
            <content:encoded><![CDATA[<p>Authors : Ravi Kumar</p><p><strong>Introduction</strong></p><p>Imagine you get a dataset with hundreds of features (variables) and have little understanding about the domain the data belongs to. You are expected to identify hidden patterns in the data, explore and analyze the dataset. And not just that, you have to find out if there is a pattern in the data — is it signal or is it just noise?</p><p>Do you wonder how to explore a multidimensional dataset? It is one of the frequently asked question by many data scientists. In this article, we will take you through a very powerful way to exactly do this.</p><p><strong>What about PCA?</strong></p><p>By now, some of you would be thinking “I’ll use PCA for dimensionality reduction and visualization”. Well, you are right! PCA is definitely a good choice for dimensionality reduction and visualization for datasets with a large number of features. <strong>But, what if you could use something more advanced than PCA? </strong>(If you don’t know PCA, I would strongly recommend to read this article first- add link to PCA article).</p><p>What if you could easily search for a pattern in non-linear style? <strong>In this article, we will tell you about a new algorithm called t-SNE, which is much more effective than PCA.</strong> We will take you through the basics of t-SNE algorithm first and then will walk you through why t-SNE is a good fit for dimensionality reduction algorithms.</p><h3>1. What is t-SNE?</h3><p>(t-SNE) t-Distributed Stochastic Neighbor Embedding is a non-linear dimensionality reduction algorithm used for exploring high-dimensional data. It maps multi-dimensional data to two or more dimensions suitable for human observation. With the help of the t-SNE algorithms, you may have to plot fewer exploratory data analysis plots next time you work with high-dimensional data.</p><p><strong>2. What is dimensionality reduction?</strong></p><p>In order to understand how t-SNE works, let’s first understand what is dimensionality reduction.</p><p>Well, in simple terms, dimensionality reduction is the technique of representing multi-dimensional data (data with multiple features having a correlation with each other) in 2 or 3 dimensions.</p><p>Some of you might question why do we need Dimensionality Reduction when we can plot the data using scatter plots, histograms &amp; boxplots and make sense of the pattern in data using descriptive statistics.</p><p>Well, even if you can understand the patterns in data and present it on simple charts, it is still difficult for anyone without statistics background to make sense of it. Also, if you have hundreds of features, you have to study thousands of charts before you can make sense of this data. (Read more about dimensionality reduction here — link to Dimensionality reduction article)</p><p>With the help of dimensionality reduction algorithm, you will be able to present the data explicitly.</p><p><strong>3. Limitations of PCA</strong></p><p>PCA is a linear algorithm. It will not be able to interpret complex polynomial relationship between features. On the other hand, t-SNE is based on probability distributions with random walk on neighborhood graphs to find the structure within the data.</p><p>A major problem with, linear dimensionality reduction algorithms is that they concentrate on placing dissimilar data points far apart in a lower dimension representation. But in order to represent high dimension data on low dimension, non-linear manifold, it is important that similar datapoints must be represented close together, which is not what linear dimensionality reduction algorithms do.</p><p>Now, you have a brief understanding of what PCA endeavors to do.</p><p>Local approaches seek to map nearby points on the manifold to nearby points in the low-dimensional representation. Global approaches on the other hand attempt to preserve geometry at all scales, i.e mapping nearby points to nearby points and far away points to far away points</p><p>It is important to know that most of the nonlinear techniques other than t-SNE are not capable of retaining both the local and global structure of the data at the same time.</p><h4>4. What does t-SNE actually do?</h4><p>After we have looked into the mathematical description of how does the algorithms works, to sum up, what we have learned above. Here is a brief explanation of how t-SNE works.</p><p>It’s quite simple actually, t-SNE a non-linear dimensionality reduction algorithm finds patterns in the data by identifying observed clusters based on similarity of data points with multiple features. But it is not a clustering algorithm it is a dimensionality reduction algorithm. This is because it maps the multi-dimensional data to a lower dimensional space, the input features are no longer identifiable. Thus you cannot make any inference based only on the output of t-SNE. So essentially it is mainly a data exploration and visualization technique.</p><p>But t-SNE can be used in the process of classification and clustering by using its output as the input feature for other classification algorithms.</p><p><strong>5. Use cases</strong></p><p>You may ask, what are the use cases of such an algorithm. t-SNE can be used on almost all high dimensional data sets. But it is extensively applied in Image processing, NLP, genomic data and speech processing. It has been utilized for improving the analysis of brain and heart scans. Below are a few examples:</p><p><strong>5.1 Facial Expression Recognition</strong></p><p>A lot of progress has been made on FER and many algorithms like PCA have been studied for FER. But, FER still remains a challenge due to the difficulties of dimension reduction and classification. t-Stochastic Neighbor Embedding (t-SNE) is used for reducing the high-dimensional data into a relatively low-dimensional subspace and then using other algorithms like AdaBoostM2, Random Forests, Logistic Regression, NNs and others as multi-classifier for the expression classification.</p><p>In one such attempt for facial recognition based on the Japanese Female Facial Expression (JAFFE) database with t-SNE and AdaBoostM2. Experimental results showed that the proposed new algorithm applied to FER gained the better performance compared with those traditional algorithms, such as PCA, LDA, LLE and SNE.[2]</p><p>The flowchart for implementing such a combination on the data could be as follows:</p><p>Preprocessing → normalization → t-SNE→ classification algorithm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*f0FMqh_veToZqHWQjjcU0g.png" /><figcaption>A Quick Comparison</figcaption></figure><p><strong>5.2 Identifying Tumor Subpopulations (Medical Imaging)</strong></p><p>Mass spectrometry imaging (MSI) is a technology that simultaneously provides the spatial distribution for hundreds of biomolecules directly from tissue. Spatially mapped t-distributed stochastic neighbor embedding (t-SNE), a nonlinear visualization of the data that is able to better resolve the biomolecular intratumor heterogeneity.</p><p>In an unbiased manner, t-SNE can uncover tumor subpopulations that are statistically linked to patient survival in gastric cancer and metastasis status in primary tumors of breast cancer. Survival analysis performed on each t-SNE clusters will provide significantly useful results.[3]</p><p><strong>5.3 Text comparison using wordvec</strong></p><p>Word vector representations capture many linguistic properties such as gender, tense, plurality and even semantic concepts like “capital city of”. Using dimensionality reduction, a 2D map can be computed where semantically similar words are close to each other. This combination of techniques can be used to provide a bird’s-eye view of different text sources, including text summaries and their source material. This enables users to explore a text source like a geographical map.[4]</p><h4>6. t-SNE compared to other dimensionality reduction algorithms</h4><p>While comparing the performance of t-SNE with other algorithms, we will compare t-SNE with other algorithms based on the achieved accuracy rather than the time and resource requirements with relation to accuracy.</p><p>t-SNE outputs provide better results than PCA and other linear dimensionality reduction models. This is because a linear method such as classical scaling is not good at modeling curved manifolds. It focuses on preserving the distances between widely separated data points rather than on preserving the distances between nearby data points.</p><p>The Gaussian kernel employed in the high-dimensional space by t-SNE defines a soft border between the local and global structure of the data. And for pairs of data points that are close together relative to the standard deviation of the Gaussian, the importance of modeling their separations is almost independent of the magnitudes of those separations. Moreover, t-SNE determines the local neighborhood size for each datapoint separately based on the local density of the data (by forcing each conditional probability distribution to have the same perplexity)[1]. This is because the algorithm defines a soft border between the local and global structure of the data. And unlike other non-linear dimensionality reduction algorithms, it performs better than any of them.</p><p>So, in this article we have seen the theoretical aspects behind t-SNE , in the upcoming article we will deep dive into the technical aspect. Until then, happy Machine Learning!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dce3db2b0c21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML101: Linear Discriminant Analysis]]></title>
            <link>https://medium.com/@ai-club/ml101-linear-discriminant-analysis-17f7a1444beb?source=rss-3f61345ea673------2</link>
            <guid isPermaLink="false">https://medium.com/p/17f7a1444beb</guid>
            <category><![CDATA[applications-of-ml]]></category>
            <category><![CDATA[linear-discriminant]]></category>
            <dc:creator><![CDATA[PTU AI CLUB]]></dc:creator>
            <pubDate>Sun, 09 Jun 2024 08:02:19 GMT</pubDate>
            <atom:updated>2024-06-09T08:02:19.640Z</atom:updated>
            <content:encoded><![CDATA[<p>Author : <a href="https://www.linkedin.com/in/chaidanya-ajith-727752292/">Chaidanya Ajjith</a></p><p>Let’s start with a quick introduction to Linear Discriminant Analysis (LDA) in machine learning</p><p>Linear Discriminant Analysis (LDA) is one of the commonly used dimensionality reduction techniques in machine learning to solve more than two-class classification problems.</p><p>It is also known as Normal Discriminant Analysis (NDA) or Discriminant Function Analysis (DFA).</p><p>The main aim of LDA is to project the dataset on to a lower dimensional space while maximizing the class separability This is done by finding a set of linear discriminants that maximize the ratio of between the class variance to within class variance. In other words we can say that it finds the directions in the feature space that best separate the different classes of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*Wsmvvfce3FpEnPx-UU_q5w.png" /></figure><p>Whenever we need to separate two or more classes having multiple features in an efficient way we use the LDA model to solve these kind of classification problems.</p><p><strong>Now let us see how LDA works :</strong></p><p>Linear Discriminant Analysis uses the following criteria to create new axis</p><ul><li>It maximizes the distance between means of two classes.</li><li>It minimizes the variance within the individual class.</li></ul><p>Linear discriminant analysis (LDA) is generally used to classify patterns between two classes, however, it can be extended to classify multiple patterns. LDA assumes that all classes are linearly separable and according to this multiple linear <a href="https://www.sciencedirect.com/topics/computer-science/discrimination-function">discrimination function</a> representing several <a href="https://www.sciencedirect.com/topics/computer-science/hyperplanes">hyperplanes</a> in the feature space are created to distinguish the classes.</p><p><strong>Why do we choose LDA ?</strong></p><ul><li>Logistic Regression is one of the most popular classification algorithms that perform well for binary classification but falls short in the case of multiple classification problems with well-separated classes.</li><li>LDA can also be used in data pre-processing to reduce the number of features, just as PCA, which reduces the computing cost significantly.</li><li>LDA is also used in face detection algorithms. In Fisher faces, LDA is used to extract useful data from different faces.</li></ul><p><strong>Assumptions:</strong></p><p>LDA makes some assumptions about the data:</p><p>· Assumes the data to be distributed normally or Gaussian distribution of data points i.e. each feature must make a bell-shaped curve when plotted.</p><p>· Each of the classes has identical covariance matrices.</p><p><strong>Real-world Applications of LDA</strong></p><ul><li><strong>Face-Recognition</strong><br> Face recognition is the popular application of computer vision, where each face is represented as the combination of a number of pixel values. In this case, LDA is used to minimize the number of features to a manageable number before going through the classification process. It generates a new template in which each dimension consists of a linear combination of pixel values. If a linear combination is generated using Fisher’s linear discriminant, then it is called Fisher’s face.</li><li><strong>Medical</strong><br> In the medical field, LDA has a great application in classifying the patient disease on the basis of various parameters of patient health and the medical treatment which is going on. On such parameters, it classifies disease as mild, moderate, or severe. This classification helps the doctors in either increasing or decreasing the pace of the treatment.</li><li><strong>Customer-Identification</strong><br> In customer identification, LDA is currently being applied. It means with the help of LDA; we can easily identify and select the features that can specify the group of customers who are likely to purchase a specific product in a shopping mall. This can be helpful when we want to identify a group of customers who mostly purchase a product in a shopping mall.</li></ul><p><strong>Advantages of using LDA</strong></p><p>· It is a simple and comparatively more efficient algorithm.</p><p>· It can work well even when the number of features is much larger than the number of training samples.</p><p>· LDA utilizes class labels to guide the dimensionality reduction process, making it suitable for tasks where class information is available.</p><p><strong>Visualizing LDA in Python:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*RhEdfJnvmiywM50Hegubhw.png" /><figcaption>Sample Code Snippet.</figcaption></figure><p><strong>Conclusion</strong></p><p>So, in a nutshell we can conclude that Linear Discriminant Analysis (LDA) stands out as a valuable tool for simplifying data and making classifications. We’ve covered why LDA is important, its limitations, and key components such as Fisher’s Linear Discriminant. Understanding the numerator and denominator in LDA, its application for multiple classes, and its implementation in Python provides practical insights. Recognizing and addressing LDA’s limitations is crucial for effective use in diverse scenarios. So, this was all about LDA . Hope it was helpful.</p><p>So that all about LDA folks! , until next time happy Machine Learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17f7a1444beb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML101: Un Supervised Machine Learning Factor Analysis.]]></title>
            <link>https://medium.com/@ai-club/ml101-un-supervised-machine-learning-factor-analysis-986789ee4ccb?source=rss-3f61345ea673------2</link>
            <guid isPermaLink="false">https://medium.com/p/986789ee4ccb</guid>
            <category><![CDATA[factor-analysis]]></category>
            <category><![CDATA[analysis]]></category>
            <dc:creator><![CDATA[PTU AI CLUB]]></dc:creator>
            <pubDate>Sun, 24 Mar 2024 05:30:30 GMT</pubDate>
            <atom:updated>2024-03-24T05:30:30.659Z</atom:updated>
            <content:encoded><![CDATA[<p>Author : <a href="https://www.linkedin.com/in/chaidanya-ajith-727752292/">Chaidanya Ajith</a></p><p>In the previous articles we have seen different types of clustering and its pros and cons. In this article we will dive in to factor analysis.</p><p>Factor analysis is a statistical method used to uncover underlying dimensions, or factors, in a dataset.</p><p>It is a statistical approach that seeks to elucidate the variations present in observed data by uncovering latent variables, commonly known as factors. By revealing hidden patterns and relationships that may not be readily discernible, factor analysis offers valuable insights into the intricate structure of complex datasets.</p><p>Factor analysis is used in big data as the data from a large number of variables may be condensed down into a smaller number of variables. Due to this same reason, it is also frequently referred to as “dimension reduction.” Such dimensions of data can be collapsed into one or more super-variables depending on needs.</p><p>Since factor analysis helps reduce the variables to work with, some people call it “dimension reduction,” which means decreasing the size of anything.</p><p>It can be used across various filed like data mining, machine learning, marketing, etc. It has useful applicability anywhere data needs to be reduced for further operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*zVrlBAQmMZIxGrFgI5iL2Q.png" /><figcaption>Fig 1. Process of Factor Analysis.</figcaption></figure><h3>Types of factor analysis include:</h3><p>1. Exploratory factor analysis</p><p>2. Confirmatory factor analysis</p><p>3. Principal component analysis</p><p><strong>Types of Factor Analysis</strong></p><p>1. <strong>Exploratory Factor Analysis: </strong>Exploratory Factor Analysis serves as a powerful tool to uncover latent factors within a dataset. Unlike other methods, EFA does not impose any predetermined structure or assume pre-existing relationships among variables. Instead, it enables an open-ended exploration of the data, providing valuable insights into the underlying factors present in the dataset.</p><p>2. <strong>Confirmatory Factor Analysis: </strong>Confirmatory Factor Analysis is a technique used to evaluate predetermined hypotheses regarding the relationships between variables and factors. Its purpose is to determine whether the observed data aligns with the proposed factor structure</p><p>3. <strong>Principal Component Analysis: </strong>Factor analysis assumes the existence of latent factors within the dataset, and then works backward from there to identify the factors. In contrast, principal component analysis (also known as PCA) uses the variables within a dataset to create a composite of the other variables.</p><h3>Benefits of Factor Analysis:</h3><p>• Factor analysis plays a pivotal role in simplifying intricate data by identifying the latent factors that account for the observed patterns. This process facilitates a more concise and easily understandable representation of the data, removing unnecessary complexity.</p><p>• effectively filtering out noise and irrelevant information, factor analysis empowers machine learning models to make more accurate and reliable predictions, ultimately enhancing their overall performance and efficacy.</p><p>• Factor analysis enables a thorough investigation of data, unveiling the hidden structure and uncovering concealed relationships and patterns. By going beyond surface-level observations, factor analysis provides valuable insights that enhance our understanding of the problem at hand.</p><p>• eliminating redundant information, factor analysis optimizes resource utilization, leading to more efficient data processing and analysis workflows.</p><p><strong>Example of Factor Analysis:</strong></p><p>factor analysis has a wide range of applications. But two of the most used application is in employee survey and customer surveys.</p><h3>1. Employee surveys</h3><p>In these surveys, businesses aim to learn what matters most to their employees.</p><p>Because there is a myriad of variables that impact the employee experience, factor analysis has the potential to narrow down all these variables into a few manageable latent factors.</p><p>You might learn that flexibility, growth opportunities, and compensation are three key factors propelling your employees· experiences.</p><p>Understanding these categories will make the management or hiring process that much easier.</p><h3>2. Customer surveys</h3><p>Let’s say you have a lot of distinct variables going on in relation to customer preferences.</p><p>Customers are weighing these various product attributes each time before they make a purchase.</p><p>Factor analysis can group these attributes into useful factors, enabling you to see the forest through the trees.</p><p>You may have a hunch about what the categories would be, but factor analysis gives an approach backed by statistics to say this is how your product attributes should be grouped.</p><p>It is also concluded that the factor analysis that the ETF is most likely suitable for large-cap, value, and quality investing environments, which is in line with the market’s appetite at present. In addition, the ETF is a wager against momentum, which could be a positive development considering that momentum assets are now performing worse than other market categories.</p><h3>Conclusion:</h3><p>Factor analysis is a powerful tool for identifying underlying dimensions in a dataset, allowing us to better understand complex phenomena. By reducing the number of variables needed to explain a given phenomenon, factor analysis can help us to simplify our understanding of the world and make more informed decisions.</p><p>Whether used in marketing research, psychology, or other fields, this approach has proven to be highly effective.</p><p>So that all about factor analysis folks! , until next time happy Machine Learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=986789ee4ccb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML101: Un Supervised Machine Learning -Hierarchical Clustering.]]></title>
            <link>https://medium.com/@ai-club/ml101-un-supervised-machine-learning-hierarchical-clustering-957f7d8b9ecb?source=rss-3f61345ea673------2</link>
            <guid isPermaLink="false">https://medium.com/p/957f7d8b9ecb</guid>
            <category><![CDATA[hierarchical-clustering]]></category>
            <category><![CDATA[clustering-algorithm]]></category>
            <category><![CDATA[clustering]]></category>
            <dc:creator><![CDATA[PTU AI CLUB]]></dc:creator>
            <pubDate>Sun, 24 Mar 2024 05:04:10 GMT</pubDate>
            <atom:updated>2024-03-24T05:04:10.495Z</atom:updated>
            <content:encoded><![CDATA[<p>Author: <a href="https://in.linkedin.com/in/science-priya-547043278">Sakthi Priya</a></p><p>Whenever you hear the word CLUSTER you might visualize a cluster of grapes waiting for you on a plate. So, basically, Clustering is nothing but to group similar kinds of grapes, ahmm my bad …. Similar kind of data!</p><p>We have many types of clustering. Here we’re gonna look into <strong>Hierarchical clustering</strong>. It is a type of connectivity-based clustering mode which means it will group the data points based on how close or how similar they are. You can also say that the data points that are close to each other are considered to be similar to each other.</p><p><strong>Dendrogram :</strong></p><p>den·druh·gram</p><p>Dendrogram is represented as a tree that has the largest clustered at the top and it will decrease to individual data points towards the base. Clusters are divided or merged repeatedly until all data points are clustered into a single one. The dendrogram can be sliced at various heights to generate a different number of clusters.</p><p><strong>TYPES OF HIERARCHICAL CLUSTERING</strong>:</p><p>We have two types of hierarchical clustering. They are ,</p><ol><li>Agglomerative clustering</li><li>Divisive clustering</li><li><strong>AGGLOMERATIVE CLUSTERING:</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*IqCT1duo1t_IKobjKrTyEQ.png" /><figcaption>Fig1 . Agglomerative Clustering.</figcaption></figure><p>Agglomerative clustering is also known as the <strong>bottom-up approach</strong>. As we can observe from the above diagram, in agglomerative clustering the main goal is to group the similar or nearby data points into a single cluster step by step.</p><p>Step 1: Take each alphabet as a single cluster and calculate the distance of one cluster from all others.</p><p>Step 2: Comparable clusters are merged. In this example, [B],[C] and [D],[E].</p><p>Step 3: The proximity or the distance is calculated and the steps are repeated to get the final single cluster i.e.:[A,B,C,D,E].</p><p><strong>2. DIVISIVE CLUSTERING:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*_eSd8l5FnaIsAEc6RWz12g.png" /><figcaption>Fig2. Divisive Clustering.</figcaption></figure><p>Divisive clustering is also known as the <strong>top-down approach</strong> This algorithm also does not require pre-specifying the number of clusters. It involves a method of splitting a cluster that contains the whole data into a singleton cluster or an individual data point.</p><p><strong>COMPARISON BETWEEN AGGLOMERATIVE AND DIVISIVE CLUSTERING:</strong></p><p>The divisive clustering method is complex compared to the agglomerative method since we need a flat clustering method as a “subroutine” to split each cluster until we have each data having its singleton cluster.</p><p>Whereas the divisive method is efficient when we don’t go all the way to reduce the cluster into a singleton cluster.</p><p>Agglomerative makes decisions without considering the global distribution of data whereas divisive takes that into account that’s why divisive is more accurate.</p><p><strong>COMPUTING DISTANCE:</strong></p><p>You should be well known about the fact that we merge two clusters based on distance or similarities between them. we have a variety of distance computing methods such as minimum distance method, maximum distance method etc…</p><p>In the <strong>minimum distance</strong> method, we calculate the minimum distance between the clusters. On the other hand, we have the maximum distance method which calculates the maximum distance between the clusters.</p><p><strong>ADVANTAGES OF HIERARCHICAL CLUSTERING</strong>:</p><p>We have several advantages on the usage of hierarchical clustering, some of them are.</p><p>1. <strong>Easy to interpret</strong>: Since it has a tree-like structure, it is easy to interpret and understand without complex algorithms and deep learning modes.</p><p>2. <strong>Flexibility</strong>: Can be used in various kinds of data and allows us to customize based on the application on hand.</p><p>3. <strong>Visualization</strong>: The structure helps to understand the data and the process at a glance.</p><p>4. <strong>Versatility</strong>: Hierarchical clustering can be used in both supervised and unsupervised learning.</p><p>5. <strong>Non-linearity</strong>: Since we can’t expect linearity in a large database, hierarchical clustering allows us to work with both linear and non-linear data.</p><p><strong>DISADVANTAGES OF HIERARCHICAL CLUSTERING:</strong></p><p>Although it is a robust tool for patterning and relationships in data sets, we still have some disadvantages that come along with it which are unavoidable. Some of them are,</p><ol><li>Manual interruptions: It requires manual interruptions to select the number of clusters, which is time-consuming and prone to errors.</li></ol><p>2. It is prone to producing overlapping clusters where two groups share common characteristics and are grouped although they belong to two different groups.</p><p>3. The results produced are based on the order of the data point processed and can be changed if the order is changed for similar data.</p><p>4. The time required to run the algorithm increases if the number of data points increases.</p><p>5. All variables must be treated equally. Therefore the algorithm does not produce any flexibility on multi-dimensional data.</p><p><strong>APPLICATIONS OF HIERARCHICAL CLUSTERING</strong>:</p><ol><li>Customer segmentation: Used in marketing to observe customer behavior and to improve service from that result observed.</li><li>Market segmentation: Used to target different types of customers based on the group of markets and services.</li><li>Image segmentation: To segment images into different data and to process further.</li><li>Network analysis: To group nodes in a network and to understand the workings of the network.</li><li>Text analysis: Can be used to group text documents based on content which is a treasure of book readers.</li><li>Risk assessment: Can group different types of risk factors and predict risks.</li><li>Recommendation system: Used in many applications to group the preferences of users and to provide/ recommend relevant information.</li></ol><p>Let’s get into a short example program of hierarchical clustering. Here we can see a simple Python program to understand the working of Hierarchical clustering.</p><pre> from sklearn.cluster import AgglomerativeClustering<br> import numpy as np<br> # randomly chosen dataset<br> X =np.array([[1, 2], [1, 4], [1, 0],<br> [4, 2], [4, 4], [4, 0]])<br> # here we need to mention the number of clusters<br> # otherwise the result will be a single cluster containing all the data<br> clustering = AgglomerativeClustering(n_clusters=2).fit(X)<br> # print the class labels<br> print(clustering.labels_)</pre><p>Congratulations ! You are now familiar with Hierarchical clustering! Practice more for better understanding. Until next time, Happy Machine Learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=957f7d8b9ecb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML101: Un Supervised Machine Learning -K Means Clustering (Part-2)]]></title>
            <link>https://medium.com/@ai-club/ml101-un-supervised-machine-learning-k-means-clustering-part-2-6d0d185771c9?source=rss-3f61345ea673------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d0d185771c9</guid>
            <category><![CDATA[k-means]]></category>
            <category><![CDATA[elbow-method]]></category>
            <category><![CDATA[clustering]]></category>
            <dc:creator><![CDATA[PTU AI CLUB]]></dc:creator>
            <pubDate>Tue, 12 Mar 2024 14:10:05 GMT</pubDate>
            <atom:updated>2024-03-12T14:10:05.820Z</atom:updated>
            <content:encoded><![CDATA[<p>Author : <a href="https://www.linkedin.com/in/yuvarani-vd-503aa72b8?utm_source=share&amp;utm_campaign=share_via&amp;utm_content=profile&amp;utm_medium=android_app"><em>Yuvarani VD</em></a></p><p>In the last article we have seen about K-means clustering basics , in this article we will move forward with the topics of optimization and choosing the value of ‘K’.</p><p><strong>Optimization</strong></p><p>In supervised learning algorithms,we had this concept of the model trying to find the best fittingline or the model trying to adjust theweights inorder to have maximum accuracy.For that, the model has to reduce something called the cost function.Here in unsupervised learning algorithms also we have the thing of,the model trying to reduce thecost function for better performance.Lets look at it for K-means clustering.</p><p>The model keeps track of two variables: 𝐶(𝑖) µ𝑘, which is the index of the cluster to which the current data point is assigned, and 𝐶(𝑖) 𝑥(𝑖) µ𝑘, which is the cluster centroid’s location, with k ranging from 1 to K. The cost function is sometimes referred to as the distortion cost function, and it is defined as follows:</p><p>𝐽( 𝐶(1) 𝐶(𝑚) µ1 µ𝑘 ) = 1/𝑚 ∑ | 𝑥(𝑖)− µ𝑘 |2</p><p>In this cost function, the average of the squared distance between the data point and its assigned cluster centroid location is calculated. The algorithm reduces 𝑥(𝑖) µ𝑘 to reduce the distance between them, which in turn reduces the cost function ‘J’.</p><p>In step 1, the cluster assignment step, the model minimizes J with respect to 𝐶(1) 𝐶(2) , while having 𝐶(𝑚) µ1 µ𝑘 as fixed. In other words, the cluster centroid is fixed and does not change here. The algorithm finds the best way to assign the data points to the clusters in such a way that it reduces the cost function ‘J’.</p><p>In Step 2 of the process, which is the Move Centroid step, the model selects the value of µ1 to µk that minimizes J with respect to the location of the cluster centroid. Therefore, J is minimized with respect to both µ1 and the next centroid value.</p><p><strong>Random Initialization of the Cluster Centroids:</strong></p><p>We often talk about the initialization of the cluster centroids in data clustering. But what is it, and how is it done?</p><p>First, we need to ensure that K (the total number of cluster centroids) is less than m (the total number of available data points). We then randomly pick K training examples from the available data points.</p><p>The cluster centroids are not obtained from any external source but are just one of the available data points. We then proceed by randomly selecting K training examples as the centroid of each cluster.</p><p>For example, µ1 = 𝑥(𝑖) and µ2 = 𝑥(𝑗). Depending on this random initialization, K-means can produce different solutions. Our goal is to choose the solution that results in the minimum cost function.</p><p><strong>CHOICE OF ‘K’:</strong></p><p>Having covered most of the aspects, we are left with the choice of right value of ‘K’ . One such method is by mere physical inspection of the plot between the different values of ‘K’ and the cost function J. This is called ‘elbow method’ wherein we choose the value of K at the place where the plot looks like the elbow of our arm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*RN-pJyhZYa7l303XHRHrQQ.png" /><figcaption>Elbow Method.</figcaption></figure><p>In the above figure as example, we choose the optimal value of K to be 3 and we group our dataset into three different clusters. But what if our plot of values of K and the cost function J doesn’t give the elbow point and it goes smooth? In such cases, we go with the number of clusters or ‘K’ which will serve our own purpose. For example, we have the data set of a food delivery app. If we want, we can group into two groups as light-orderer and heavy-orderer. Or else if we want, we can group into three groups as light-orderers, medium-orderers and heavy-orderers. Ultimately, the perfect choice of K depends on how well it serves our real purpose.</p><p><strong>ADVANTAGES:</strong></p><p>● K-means is computationally efficient and works well on large datasets. Its time complexity is generally linear with respect to the number of data points.</p><p>● The algorithm is scalable and suitable for high-dimensional data. It performs well when the number of features is relatively large.</p><p>● The number of clusters (k) can be specified by the user or determined using techniques like the elbow method, making it versatile for different applications.</p><p><strong>DISADVANTAGES:</strong></p><p>● K-means is sensitive to the initial placement of cluster centroids. Different initializations may lead to different final cluster assignments.</p><p>● The algorithm may converge to a local minimum, and the final result depends on the initial centroids.</p><p>● The user needs to specify the number of clusters (k) in advance, which might not be known in some real-world applications.</p><p><strong>REAL WORLDUSESOF K-MEANS:</strong></p><p>● Facebook might use clustering for friend suggestion algorithms, grouping users who sharesimilar interests, mutual friends, or activities.</p><p>● IBM Watson Health could use clustering for patient segmentation based on health records, helping to identify trends, potential risks, and personalized treatment plans.</p><p>● Amazon uses customer segmentation to categorize users based on their browsing and purchasing behavior. This helps in personalized product recommendations and targeted marketing.</p><p>● NASA might use clustering to categorize astronomical objects or analyze data from space missions, aiding in the discovery of new patterns and celestial phenomena.</p><p>● Bing, Microsoft’s search engine, may use clustering to group search results based on user intent and relevance, improving the user experience.</p><p>● JPMorgan Chase might apply clustering to group customers based on their financial behavior and investment preferences, assisting in personalized financial services.</p><p>And the list goes on……</p><p>Having talked a lot, let’s enter the coding part!</p><p>CODE:</p><p>This time we are going with a very simple and basic code to visualize the K means algorithm. You can try out with any dataset or with the open source ones from the UCI machine learning repository or Kaggle. You are unstoppable!</p><pre>import numpy as np<br> import matplotlib.pyplot as plt<br> from sklearn.cluster import KMeans<br> from sklearn.datasets import make_blobs</pre><p>Import the required libraries. numpy is used for numerical operations, matplotlib. pyplot for plotting, and K-Means from sci-kit-learn for the K-means clustering algorithm.</p><pre># Generate synthetic data with make_blobs<br> data, _ = make_blobs(n_samples=300, centers=4, random_state=42)</pre><p>Use the make_blobs function from sci-kit-learn to generate synthetic data. The make_blobs function returns two values: the generated data points and an array of labels. In this case, we are interested in the data points, so we assign the first value to the variable data and use ‘ _ ‘ for the second value, which is ignored. n_samples=300: Generate 300 data points. Centers: Create 4 clusters (centers). random_state=42: Set a seed for reproducibility.(just like a code word between yourself and your friend).</p><pre># Apply K-means clustering<br> kmeans = KMeans(n_clusters=4, random_state=42</pre><p>Create a K-means clustering object with n_clusters=4. Fit the K-means model to the synthetic data using the fit method.</p><pre># Get cluster labels and centroids<br> labels = kmeans.labels_<br> centroids = kmeans.cluster_centers</pre><p>Retrieve the cluster labels assigned to each data point. Get the coordinates of the cluster centroids.</p><pre> # Plot the data points and cluster centroids<br> plt.scatter(data[:, 0], data[:, 1], c=labels, cmap=&#39;viridis&#39;,<br> alpha=0.8, edgecolors=&#39;k&#39;)<br> plt.scatter(centroids[:, 0], centroids[:, 1], c=&#39;red&#39;, marker=&#39;X&#39;,<br> s=200, label=&#39;Centroids&#39;)<br> plt.title(&#39;K-means Clustering on Blobs Dataset&#39;)<br> plt.xlabel(&#39;Feature 1&#39;)<br> plt.ylabel(&#39;Feature 2&#39;)<br> plt.legend()<br> plt.show()</pre><p>1.Scatter plot plots the data points with colors based on their assigned clusters (c=labels).</p><p>2.Use the viridis colormap and set alpha (transparency) to 0.8. Mark the cluster centroids in red with ‘X’ markers.</p><p>3.Add a title to the plot, and label the x and y axes.</p><p>4.Display a legend for the centroids.</p><p>5.Finally, show the plot.</p><p>Congratulations ! you are now familiar with K-means clustering! Practice more for better understanding. Until next time, Happy Machine Learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d0d185771c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML101: Un Supervised Machine Learning -K Means Clustering]]></title>
            <link>https://medium.com/@ai-club/ml101-un-supervised-machine-learning-k-means-clustering-51a1ff02e351?source=rss-3f61345ea673------2</link>
            <guid isPermaLink="false">https://medium.com/p/51a1ff02e351</guid>
            <category><![CDATA[clustering-algorithm]]></category>
            <category><![CDATA[clustering]]></category>
            <category><![CDATA[k-means]]></category>
            <dc:creator><![CDATA[PTU AI CLUB]]></dc:creator>
            <pubDate>Mon, 11 Mar 2024 16:46:07 GMT</pubDate>
            <atom:updated>2024-03-11T16:46:07.741Z</atom:updated>
            <content:encoded><![CDATA[<p>Author: Yuvarani VD</p><p>Hey techies, PTU AI CLUB welcomes you with yet another article of the ongoing series ml 101. First, let’s brush up on some basics to follow along with today’s topic.</p><p>In supervised learning we were given the training set with the labels that is the training data set was tagged with its outputs and our goal was to find the decision boundary that separates different output labels.</p><p><strong>Training set: { (𝑥(1) , 𝑦(1) ), (𝑥(2) , 𝑦(2) ), (𝑥(3) , 𝑦(3) ), . (𝑥(𝑚) , 𝑦(𝑚) )}</strong></p><p>Where 𝑦 (1) 𝑥 (1) is the input of the first training example and is its corresponding output label. ‘m’ denotes the total number of training samples in the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*MAX9GB7pQN_Pb4dI8oFsLg.png" /><figcaption>Fig 1. Supervised Learning.</figcaption></figure><p>In contrast, in unsupervised learning we have a training set only with the input features. We don’t have an idea about the output labels.</p><p><strong>Training set: { 𝑥(1) , 𝑥(2) , 𝑥(3) , . 𝑥(𝑚) }</strong></p><p>Here, we have only the input features and not ‘y’- the output labels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*91Pl8ukV-_tX4Wat1lIWAA.png" /><figcaption>Fig2. Unsupervised Learning</figcaption></figure><p>We give this unlabelled training set to the algorithm or the learning model and we want it to find the underlying structure or the pattern in the training set. One type of structure is that the algorithm can group the data into separate clusters. The algorithm which clusters the data is called the clustering algorithm. The unsupervised learning algorithms find different types of structures or patterns from the given data. ‘<strong>Clustering algorithms</strong>’ are one among them. The algorithms which find other types of patterns or structures will be dealt in further sections.</p><p>Among these clustering algorithms, <strong>K-means clustering</strong> is the most popularly used algorithm.</p><p>This algorithm basically groups out the input data into clusters and the number of clusters is specified by the parameter- ‘K’. For example, if k is 2, then the algorithm has to group the given input data into two clusters or two groups. And that’s the justification of calling this algorithm as ‘K-means clustering’ .</p><p>So how is this clustering done ?</p><p>First we find the cluster centroids for each cluster, which is like the center spot of a particular cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*T0rI9m6oH_YoiLLUlSIrBg.png" /></figure><p>So for K clusters, we have K clusters.(note that it is uppercase K for the total number of clusters).</p><p><strong>training set </strong>{ Hence, The input to the K-means algorithm is the K parameter (number of clusters) and the<strong> 𝑥 (1) , 𝑥(2) , 𝑥(3) , . 𝑥(𝑚)</strong> } where 𝑥 (𝑖) ∈ 𝑅𝑛 ( n dimensional vector)</p><p><strong>K-means is an iterative algorithm which works in two important steps.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*D9K5kHYi9VpoxfbIOAd3dA.png" /><figcaption>Fig3. Steps in K-Means</figcaption></figure><p>Steps in K-Means:</p><p><strong>Step 1: CLUSTER ASSIGNMENT STEP</strong></p><p>This is the first step inside the loop. In this step, the algorithm goes through each of the data points and measures the distance between the data points and all the initialized cluster centroids and then it assigns a particular datapoint to the cluster centroid which is closer to that datapoint. For example, consider that data point shown in pink. In the step, the model will calculate the distance between it and the cluster centroids shown in blue and purple and it finds that the data point in pink is closer to the cluster centroid 2 shown in blue and so the datapoint in pink is assigned to the cluster 2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*2nOD_fd_pPHuoT0YjjljlQ.png" /><figcaption>Fig4. Cluster Assignment</figcaption></figure><p>In such a way all the data points will be mapped to its nearest cluster centroid in step 1. So, here the cluster centroids remain unmoved and the data points are mapped.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*H11OQcdRPyvP89HSLGgUUA.png" /></figure><p><strong>STEP 2: MOVE CENTROID STEP</strong></p><p>Here, the cluster centroids are moved to the location which is the average of the data points of that particular cluster. The algorithm sees the data points which belong to a particular cluster and finds the mean of the location of all those data points and then moves the cluster centroid there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*m2HJnI487qWl6NWW2MF9jA.png" /><figcaption>Fig5. Cluster Centroid</figcaption></figure><p>Again step 1 is repeated and the data points belonging to the particular clusters are updated and then in step 2, the cluster centroids are updated with those updated data points.</p><p>After another iteration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*TntNTpN7DqqA4YQBP0o7dA.png" /></figure><p>Hence these two steps are done repetitively until the algorithm converges.</p><p>Okay so now we got to know the working, but is there any criteria to stop the clustering? Yes , absolutely lets look on them:</p><p><strong>Stopping Criteria for K-Means Clustering:</strong></p><p>There are essentially three stopping criteria that can be adopted to stop the K-means algorithm:</p><p>● Centroids of newly formed clusters do not change</p><p>● Points remain in the same cluster</p><p>● Maximum number of iterations is reached</p><p>We can stop the algorithm if the centroids of newly formed clusters are not changing. Even after multiple iterations, if we are getting the same centroids for all the clusters, we can say that the algorithm is not learning any new pattern, and it is a sign to stop the training. Another clear sign that we should stop the training process is if the points remain in the same cluster even after training the algorithm for multiple iterations.</p><p><strong>THE ALGORITHM:</strong></p><p>First we randomly initialize K cluster centroids.(we will discuss this in later part) Cluster centroids are denoted by µ , , ,… (‘k’ denotes the index of the cluster 1 µ2 µ3 µ𝑘∈ 𝑅𝑛 centroid and K denotes the total number of cluster centroids). Then as discussed earlier the algorithm goes with the previously mentioned two steps</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*NHrh4ujzjOTGdJlooD14Rw.png" /><figcaption>Fig 6 . K-Means</figcaption></figure><p>So, by now we would be familiar with the cluster assignment step that assigns the data point to the cluster whose cluster centroid is closer to the data point. Totally there are ‘m’ data points and each of them are assigned to a particular cluster centroid by calculating the squared euclidean distance. The ‘k’ (index of the cluster centroid ) is the value which is assigned to 𝐶 (𝑖) where i is the index of the data point.</p><p>For example, consider 𝐶 (5) = 2; 𝐶 (7) = 2; 𝐶 (2) = 2</p><p>It means that the data points with index 5, 7, 2 (i.e., the cluster centroid 2 and they are assigned to the cluster 2 . 𝑥 , , (5) 𝑥(7) 𝑥(2) 𝑟𝑒𝑠𝑝𝑒𝑐𝑡𝑖𝑣𝑒𝑙𝑦) are closer to</p><p>Now that we have the clusters with the assigned data points, we have to reposition the already existing cluster centroid by finding the mean of the position of the data points belonging to that particular cluster. So µ 𝑘 has the value of the average which is found to reposition the centroid of the particular cluster with index ‘k’ .</p><p>For example, After step 1 we had cluster 2(k=2) had the data points In step 2 : µ 2 = 𝑥 (5) + 𝑥(7) + 𝑥(2) 3 𝑥 ∈ 𝑅𝑛 , (5) 𝑥(7) and 𝑥 (2)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*MPWfcu2b2NdwkUBRNnz2wQ.png" /></figure><p>Now thatyou have understood the algorithm, one question might arise in your mind! What if there exists a cluster centroid with no data points assigned to it after both steps? Well, simply you can eliminate that cluster centroid and you will be left with only K-1 clusters instead of K clusters. Or else, you can just randomly reinitialize the cluster centroid again. But the first approach of just eliminating is more common when there is no data point assigned.</p><p><strong>The most important thing for a better output of this algorithm is that, the data points within the cluster must be similar to each other and the data points between two different clusters must be dissimilar.</strong></p><p>In the next article we will be focusing on the optimization aspect and choosing the value of ‘k’ along with few code snippets . Until then happy Machine Learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51a1ff02e351" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML101: Un Supervised Machine Learning (Clustering ) Part-2.]]></title>
            <link>https://medium.com/@ai-club/ml101-un-supervised-machine-learning-clustering-part-2-ac785781162e?source=rss-3f61345ea673------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac785781162e</guid>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[clustering]]></category>
            <category><![CDATA[clustering-algorithm]]></category>
            <dc:creator><![CDATA[PTU AI CLUB]]></dc:creator>
            <pubDate>Sun, 04 Feb 2024 15:56:04 GMT</pubDate>
            <atom:updated>2024-02-04T15:56:04.088Z</atom:updated>
            <content:encoded><![CDATA[<p>Authors : <a href="https://www.linkedin.com/in/beenasamuel7777/">Beena Samuel</a>, <a href="https://www.linkedin.com/in/iram-naseer-78a013207">Iram Naseer</a></p><p>In the previous post, we saw a brief introduction to clustering. We saw that <strong>clustering is an unsupervised learning technique that involves the grouping of the inputs based on some commonalities. </strong>So, what are the ways to perform this grouping? Let’s see that in this article.</p><p>There are numerous clustering methods because there is no single ideal approach to cluster data. Choosing a clustering method requires good examination and evaluation of the data as well as the expected conclusion. The assumptions, aims, and performance requirements of various clustering algorithms differ. Depending on these, different clustering algorithms may produce different results, some of the clustering algorithms belong to the following categories.</p><p>· Partition based clustering</p><p>· Hierarchy based clustering</p><p>· Fuzzy theory based clustering</p><p>· Distribution based clustering</p><p>· Density based clustering</p><p>· Graph theory based clustering</p><p>· Fractal theory based clustering</p><p>So, in this article let’s look at each of the clustering types briefly.</p><p><strong>Partition based clustering:</strong></p><p>This method segregates the data into <em>distinct clusters</em>, where each cluster is symbolized by a <em>central</em> or <em>representative</em> point. The groups are formed by <em>minimizing</em> the distance between the data points and their centroids. This method is simple and fast, but it requires <em>specifying the number of clusters</em> in advance and it may be sensitive to outliers and initial conditions. An example of this method is k-means clustering. We will look into the K-means clustering in our upcoming blogs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*YV-v1X__nz3i3bBj8NYIFA.png" /><figcaption>K-Means Clustering</figcaption></figure><p><strong>Hierarchy based clustering:</strong></p><p>This method creates a <em>tree-like</em> structure of clusters, where each cluster is a <em>subset</em> of another cluster. Clusters are made by joining together the nearest pairs of data points from different groups. This method can handle arbitrary-shaped clusters and reveal the hierarchical relationships among them, but it can be computationally expensive and sensitive to noise and outliers. An example of this method is agglomerative clustering. Figure 2 illustrates hierarchical clustering for different types of machine learning. The <strong>green</strong> points represent the different algorithms used; they are found in the leaf nodes of the tree representation. The <strong>blue</strong> clusters are a broader cluster, and four of them denote classification, regression, clustering, and association. The <strong>yellow</strong> clusters are even more general divisions, and there are two of them: supervised and unsupervised. Finally, the <strong>red</strong> cluster denotes the types of learning. As you can see, this clustering order represents a hierarchical flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*TSBh3QBqptXFORkVYsZm4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*JRg7mL_9zRdouPcVUD6Z6g.png" /><figcaption>Hierarchial Clustering</figcaption></figure><p><strong>Fuzzy theory based clustering:</strong></p><p>This method assumes that the data points have <em>fuzzy membership values</em> for each cluster, meaning that they can belong to more than one cluster with different degrees of probability. The clusters are formed by finding the regions where the membership values are high enough to form a coherent group. This method can handle complex and irregular data sets, but it may require tuning some parameters (like initial centroid location, membership degree of data point to a cluster, distance to centre, etc.,) and it may not work well with sparse or noisy data. An example of this method is fuzzy C-means clustering. Figure 3. shows some datapoints which are in the overlapping region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*HFUiAmo6WYsom4wUuo-IEw.png" /><figcaption>Clustering Based on Fuzzy theory</figcaption></figure><p><strong>Distribution based clustering:</strong></p><p>In this method the data points are generated by a combination of <em>probability distributions</em>, such as Gaussian distributions (normal or bell-shaped distributions). Clusters are generated by estimating the <em>parameters</em> of these distributions that best suit the data points, such as mean and covariance. This method can detect complicated patterns and shapes in data, but it might require the selection of a suitable distribution model and may not function well with non-Gaussian or multimodal data. GMMs (Gaussian Mixture Models) can be used to group data points from the same Gaussian distribution together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*NK68jx4ppyLjV7lC9tmuIg.png" /></figure><p><strong>Density based clustering:</strong></p><p>This method identifies areas where there are many data points (high density) and areas where there are few or no data points (low density). The clusters are formed by connecting these areas into regions that have <em>similar density</em> values. This method can discover arbitrary-shaped clusters as long as they have enough density, but it may be difficult to measure density accurately and it may not work well with varying densities or high dimensions. An example of this method is DBSCAN algorithm.</p><p>The figure below illustrates the DBSCAN algorithm in action with a minimum number of points (MinPts) set to 4. In DBSCAN, MinPts is a parameter that specifies the minimum number of points required to form a dense region.</p><p>The <strong>core points</strong>, represented by red dots labeled ‘A’, are located in a high-density area. These points have at least MinPts within a specified radius. In this case, there are 6 points in the core area, exceeding the MinPts threshold of 4.</p><p>The <strong>border points</strong>, represented by yellow dots labeled ‘B’ and ‘C’, are within the specified radius of a core point but don’t have MinPts within their own specified radius. They serve as the boundary of the cluster.</p><p>The <strong>noise point</strong>, represented by the blue dot labeled ’N’, is a point that is neither a core point nor a border point. It’s not part of a cluster due to its distance from other points, hence it’s classified as noise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*aA44KwlnRisoaaNnKlyFrg.png" /><figcaption>DBSCAN</figcaption></figure><p><strong>Graph theory based clustering:</strong></p><p>This method represents the data as a <em>graph</em>, where each node is a data point and each edge connects two nodes that are similar or related in some way. The clusters are formed by finding communities or subgraphs that have high connectivity or similarity within them. This method can capture complex networks and structures in the data, but it may require choosing an appropriate graph model and metric for similarity measurement and it may not work well with sparse or noisy graphs. An example of this method is spectral clustering which can be used even in clustering higher dimensional data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*mC48jcnsFnABtG3occoiLg.png" /><figcaption>Graph-Based Clustering</figcaption></figure><p><strong>Fractal theory based clustering:</strong></p><p>This method uses <em>fractal geometry</em> to model complex shapes in nature or art, such as coastlines, mountains, clouds, etc., as self-similar patterns that <em>repeat at different scales</em> or levels of detail. The clusters are formed by finding regions where these patterns coexist at different scales within them. This method can capture natural phenomena that exhibit self-similarity at various levels, but it may require choosing an appropriate fractal dimension for measuring complexity and diversity in nature or art.</p><p>Figure 6 illustrates fractal clustering in a tree; each branch of the tree can be considered a cluster, which further divides into smaller sub-clusters (the smaller branches). This pattern continues, with each smaller branch (sub-cluster) further dividing, creating a hierarchy of clusters within clusters. This is similar to how fractal clustering works, where data is grouped into clusters that themselves contain sub-clusters, and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*FOe69fiz-bnrsv40ZqfLkA.png" /><figcaption>Fractal Theory</figcaption></figure><p><strong>Importance of choosing the right clustering method:</strong></p><p>Now that we have seen the different types of clustering algorithms, some of you might wonder why it is required to know all the different clustering types. It is important to be aware of them because, depending on the situation, we may put our knowledge to use. We can see an example case that shows the need for this.</p><p>Let’s consider a dataset of customer behaviour for a retail store. If the data shows clear, spherical clusters of customers with similar behaviours, a partition-based algorithm like k-means might be a good choice. This algorithm works well with spherical clusters and large datasets, but it requires the number of clusters to be specified in advance and can be sensitive to outliers.</p><p>On the other hand, if the data shows customers with behaviours that gradually transition from one group to another, a density-based algorithm like DBSCAN might be more appropriate. This algorithm can discover clusters of arbitrary shape and doesn’t require the number of clusters to be specified in advance. However, it can have difficulty with data of varying densities and high dimensions.</p><p>Understanding the properties of your data, as well as the benefits and drawbacks of various clustering algorithms, is essential for selecting the best approach for usage.</p><p>well, we hope you enjoyed the clustering parts, we will discuss more algorithms of unsupervised learning in upcoming articles, till then Happy MACHINE LEARNING!</p><p>The <a href="https://www.linkedin.com/company/ptu-ai-club/?viewAsMember=true">PTU AI CLUB</a> will be coming out with more articles under the ML101 series in this spirit and be ready to be the magic creature learning by the supervision of AI CLUB 😉!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac785781162e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML101: Un Supervised Machine Learning (Clustering ) Part-1.]]></title>
            <link>https://medium.com/@ai-club/ml101-un-supervised-machine-learning-clustering-part-1-ad37e1263470?source=rss-3f61345ea673------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad37e1263470</guid>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[unsuper]]></category>
            <category><![CDATA[clustering]]></category>
            <dc:creator><![CDATA[PTU AI CLUB]]></dc:creator>
            <pubDate>Sat, 03 Feb 2024 13:53:58 GMT</pubDate>
            <atom:updated>2024-02-09T06:59:30.418Z</atom:updated>
            <content:encoded><![CDATA[<p>Authors: <a href="https://www.linkedin.com/in/beenasamuel7777/">Beena Samuel</a>, <a href="https://www.linkedin.com/in/iram-naseer-78a013207">Iram Naseer</a></p><p>In the previous article we have learned what is unsupervised learning and its use cases, in this article we will explore the world of CLUSTERING! , Interesting right?</p><p><strong>INTRODUCTION</strong></p><p>Imagine yourself going to a library to find a book. But when you get there, everything is mixed up and messy. You see all kinds of books everywhere, not sorted at all. This makes you feel lost, and you can’t find the book you want. Would you want to go back to that library? No way! You wouldn’t want to waste your time looking for a book in such a messy place.</p><p>But what if the books in the library were organized and placed in their respective groups? It would be a lot easier for you to locate your desired book, and for sure, you wouldn’t mind stepping into the library even the next time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*mBqiOvgTJEMQiItvkqj53A.png" /></figure><p>So, if the books in the library are organized, the customer is happy 😊, but what about the librarian? Won’t it be a difficult task to organize the thousands of books in the huge library 😓? Well, it might if the librarian does it manually, but it can be easily done using clustering. Yes, clustering comes to the rescue!!</p><p><strong>What is Clustering?</strong></p><p><strong>Clustering is an unsupervised learning technique that involves the grouping of the inputs based on some commonalities</strong>, in this case, books. Let’s treat each book as a data point. A clustering technique can be used to allot these data points into groups based on the input features. Data points that are in the same group will have similar properties, while data points in different groups will have dissimilar properties. We can call these groups as clusters. Each of these clusters can then be allotted a unique identifier known as the <strong>cluster ID</strong>.</p><p>So, why was the term unsupervised being used here? If the input to the clustering algorithm is a collection of books that were unorganized, the output will be groups of books, wherein each book will share some common features with the other books in the same group. Since the algorithm doesn’t have any predefined categories like science, literature, etc., it is <strong>unlabeled</strong> in nature. The clustering algorithm analyses the unlabeled features of each book and groups them based on similarities or patterns it identifies; we call it an <strong>unsupervised learning</strong> method.</p><p>Let’s say our clustering algorithm identified some common features and grouped the books based on category and author’s country of origin. As a result, we get many groups. However, in the diagram below, only two groups were considered for illustration purposes. From figure 1, we can notice that some data points are blue and some are golden; each of them indicates a book.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*EC8oNivmoMFcYwsGJGrKig.png" /><figcaption>Figure 1 . Clustering</figcaption></figure><p>In figure 1, we have considered a simple case where the model has grouped clusters considering only two features/dimensions (category and Authors country of origin), but in reality, there may be many different input features/dimensions which may help in clustering, in such cases we can reduce the higher dimensional input features to lower dimensions, this method is known as <strong>dimensionality reduction</strong>. <strong>PCA</strong> <strong>(Principal Component Analysis)</strong> is a widely used technique in dimensionality reduction. Figure 2 illustrates higher dimensional clustering after using PCA. We will see PCA in future blogs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*1nZL8Xa1mz4IyHwIWkUuHw.png" /><figcaption>Figure 2 . Clustering After PCA Technique</figcaption></figure><p><strong>Types of Clustering:</strong></p><p>Clustering can broadly be divided into two types:</p><p><strong>Hard Clustering</strong>: In hard clustering, it’s a clear-cut scenario: each data point is either fully in a cluster or not at all. It’s an <em>all-or-nothing</em> approach to grouping data. For example, a book can only belong to one genre. Figure 1 illustrates hard clustering, considering each colour to be a genre. Let’s say the blue books represent science and the red books represent romance. A book cannot belong to both categories at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*P9hb3yjvdtMFFCqL5KSlCw.png" /><figcaption>Figure 3 Hard Clustering.</figcaption></figure><p><strong>Soft Clustering</strong>: Instead of assigning each data point to a separate cluster, soft clustering assigns a <em>probability</em> or likelihood of that data point being in those clusters. For example, a book could be classified as 70% comedy and 30% mystery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*fbsQtGiv16N_Jr_0z_d3fw.png" /><figcaption>Figure 4: Soft clustering</figcaption></figure><p><strong>Noises and outliers:</strong></p><p>When performing clustering, we might sometimes notice our clustering algorithm not grouping properly. Well, there may be many reasons for that, but one of the common issues is the presence of noise and outliers in the data. Only by identifying them can we process the data in order to keep it from interfering with the performance of our clustering algorithm. So, let’s look at what these are.</p><p><strong>Data that does not fit in with the other data you are evaluating is called an outlier.</strong> An outlier may be noise or a valid data item. In our example, outliers could be those unique books that are very different from the rest. Imagine you’re grouping books based on their genre, and most of the books are fiction. But then, there’s this one book on quantum physics. This book stands out because it’s not a fiction book like the rest. So, this book is a good example of an outlier.</p><p><strong>The term “noise” on the other hand refers to erroneous or irrelevant data that may interfere with the process of classifying or grouping the information. </strong>In our example, noise may be misplaced or mislabeled books. Assume you’re categorizing books based on the author’s country of origin. You come across a book labeled as written by a French author, but after close examination, you discover that the author is actually from Spain. This mislabeling is considered noise because it does not provide reliable information and may result in the book being classified incorrectly.</p><p><strong>Applications of clustering:</strong></p><p>We have seen the usage of clustering algorithm for a library. Apart from that, clustering can be used in a wide range of situations. Some of the most common applications of clustering are listed below.</p><p>1. <strong>Customer Segmentation: </strong>Clustering is used by businesses to group clients based on their purchase habits, demographics, or interests. This data is useful for targeted marketing, personalized recommendations, and better customer service.</p><p>2. <strong>Analysis of Social Networks: </strong>Within a social network, clustering makes it easier to find communities or groups of people that interact or have similar interests. It can also be used to promote connections or content based on the tastes of similar people.</p><p>3. <strong>Grouping of Search Results: </strong>Clustering is used to categorize search results based on relevance or thematic similarity. This It enhances the user experience by displaying sets of search results that are well-organized and logical.</p><p>4. <strong>Medical imaging: </strong>Clustering is used in medical imaging to group pixels that have similar properties. This aids with the segmentation of tissues, organs, or abnormalities in images. Medical experts can examine and diagnose diseases more effectively by identifying areas of interest. Clustering is also used in tumour identification and classification.</p><p>5. <strong>Genomic Clustering: </strong>Clustering in bioinformatics aids in the identification of groups of genes with similar expression patterns across conditions. This is essential for finding possible biomarkers and understanding genetic relationships.</p><p><strong>6.</strong> <strong>Anomaly Detection: </strong>Clustering is used to detect normal patterns or behaviours within a collection. Anomalies or outliers are data points that differ significantly from these patterns. This is useful in various applications, including fraud detection, network security, and quality control in manufacturing.</p><p><strong>Clustering and Classification:</strong></p><p>While the goals of clustering and classification differ, clustering can be used as a <em>preliminary step</em> to identify hidden patterns in unlabeled data, and the generated clusters may be useful as labels in a future classification task.</p><p>Consider a large library of unknown categories of books. We use clustering to group books with similar characteristics in order to identify the underlying themes. Each cluster, which represents a different category, is then <em>assigned </em>its own group. For example, one cluster could be made up of science fiction books, another of historical novels, and so on. By training a classification model on a single book from each category, the algorithm learns the patterns that relate book features to their corresponding classes (groups). When a new book arrives, the classification model assigns it to a relevant category, making it an effective tool for organizing and categorizing volumes in the collection. The table below illustrates the differences between clustering and classification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ApE3C1x1jNUivfQ33QCLDQ.png" /><figcaption>Differences Between Classification And Clustering.</figcaption></figure><p>Well , thats it for part-1 of clustering people, we will see the clustering techniques in the upcoming article.</p><p>The <a href="https://www.linkedin.com/company/ptu-ai-club/?viewAsMember=true">PTU AI CLUB</a> will be coming out with more articles under the ML101 series in this spirit and be ready to be the magic creature learning by the supervision of AI CLUB 😉!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad37e1263470" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML101: Un Supervised Machine Learning (Introduction) — 2]]></title>
            <link>https://medium.com/@ai-club/ml101-un-supervised-machine-learning-introduction-2-5ecc769977d3?source=rss-3f61345ea673------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ecc769977d3</guid>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[supervised-learning]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[PTU AI CLUB]]></dc:creator>
            <pubDate>Sat, 03 Feb 2024 13:44:16 GMT</pubDate>
            <atom:updated>2024-02-03T13:44:16.901Z</atom:updated>
            <content:encoded><![CDATA[<h3>ML101: Un Supervised Machine Learning (Introduction) — 2</h3><p>Authors: Rohith R, Sharan and Narin Subramanian.</p><p>In the previous article we have seen what unsupervised learning is and its different types of algorithms and how unsupervised learning works.</p><p>In this article we will focus on differences between unsupervised and supervised machine learning , along with use cases of unsupervised learning.</p><p><strong>Differences between Supervised and Unsupervised Learning</strong></p><p><strong>SUPERVISED LEARNING</strong></p><p>1. The model is trained using labeled data, which means that both the input and output variables are known.</p><p>2. This type of learning is called supervised because the process of learning can be thought of as a teacher who is supervising the entire learning process. In supervised learning, the algorithm learns from a labeled dataset, where each input is associated with a corresponding output. The algorithm is guided by the provided labels to make predictions or classifications.</p><p>3. The primary goal is to make predictions or classify new, unseen data based on the patterns learned from the labeled training set. The algorithm aims to minimize the difference between its predictions and the actual labeled outputs.</p><p>4. The algorithm receives explicit feedback in the form of labeled data. It adjusts its parameters to minimize the error between its predictions and the true labels during training.</p><p>Ex:</p><p>Linear regression, support vector machines, neural networks.</p><p>UNSUPERVISED LEARNING</p><p>1. Involves unlabeled training data, and the algorithm explores the data’s inherent structure or patterns without explicit guidance.</p><p>2. Unsupervised learning is called “unsupervised” because, unlike supervised learning, it does not rely on explicit supervision or labeled output during the training process. The term “unsupervised” reflects the absence of direct supervision or guidance in the form of labeled examples.</p><p>3. The goal is often to discover hidden patterns, structures, or relationships within the data. Common tasks include clustering similar data points or reducing the dimensionality of the data.</p><p>4. There is no explicit feedback in the form of labeled output. The algorithm must infer the structure of the data based on patterns and relationships it discovers within the unlabeled dataset.</p><p>Ex:</p><p>K-means clustering, hierarchical clustering, PCA</p><p>now lets see where unsupervised learning is put into use….</p><p><strong><em>Unsupervised Learning Use Cases</em></strong></p><p>Unsupervised learning is used in various real-life applications across different industries. Here are some examples:</p><ol><li><strong>Customer Segmentation</strong>:</li></ol><p>Companies use unsupervised learning algorithms, such as K-means clustering, to segment their customer base based on common attributes or behaviors. This helps in targeted marketing and personalized customer experiences.</p><p>2. <strong>Recommendation Systems</strong>:</p><p>Unsupervised learning is employed in recommendation systems, where algorithms analyze user behavior and preferences to suggest products, movies, music, or content. Collaborative filtering and clustering are common techniques.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*9mi1arjvC78zUN9rgxZKDw.png" /></figure><p><strong>3. Healthcare:</strong></p><p>Clustering algorithms can be used to group patients based on similar health characteristics, aiding in personalized medicine. Unsupervised learning is also employed in medical image analysis, like identifying patterns in MRI or CT scans.</p><p>4. <strong>Financial Market Analysis</strong>:</p><p>Unsupervised learning is used to identify patterns and trends in financial market data. Clustering techniques can help group similar stocks based on market behavior, and dimensionality reduction can aid in visualizing complex financial datasets.</p><p>5. <strong>Autonomous Vehicles</strong>:</p><p>Unsupervised learning plays a role in the perception and decision-making components of autonomous vehicles. Clustering helps identify objects in the environment, and dimensionality reduction may be used for feature extraction from sensor data.</p><p>6. <strong>Speech Recognition</strong>:</p><p>Unsupervised learning techniques are employed in speech processing to cluster similar speech patterns, aiding in the development of robust speech recognition systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*20K3ERkyFA9fhrzx7lVPPg.png" /></figure><p>well, unsupervised learning has a lot of real-life or day-to-day use cases the above mentioned are some of them…</p><p>In this article we have seen the use cases of unsupervised machine learning and how it differs from supervised machine learning. In the following articles we will explore different unsupervised learning algorithms in detail. Till then <strong>happy Machine Learning !</strong></p><p>The <a href="https://www.linkedin.com/company/ptu-ai-club/?viewAsMember=true">PTU AI CLUB</a> will be coming out with more articles under the ML101 series in this spirit and be ready to be the magic creature learning by the supervision of AI CLUB 😉!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ecc769977d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>