<?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 Sreeram A S K on Medium]]></title>
        <description><![CDATA[Stories by Sreeram A S K on Medium]]></description>
        <link>https://medium.com/@sreerama.s.k?source=rss-8067ac008580------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RvDPt1bGvlA5Rf9d.jpg</url>
            <title>Stories by Sreeram A S K on Medium</title>
            <link>https://medium.com/@sreerama.s.k?source=rss-8067ac008580------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 07:22:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sreerama.s.k/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[Building Graph RAG for structured and unstructured data.]]></title>
            <link>https://pub.towardsai.net/building-graph-rag-for-structured-and-unstructured-data-e6148bcbe9c9?source=rss-8067ac008580------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6148bcbe9c9</guid>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Sreeram A S K]]></dc:creator>
            <pubDate>Sat, 11 Jan 2025 22:01:58 GMT</pubDate>
            <atom:updated>2025-01-11T22:01:58.479Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*u22hcnWwz9YEZR37.jpg" /></figure><p>RAG architecture is, by far, the most adapted and sophisticated solution for missing contextualisation of LLM’s. With no overhead of fine tuning, to a huge extent problems concerning the usage of LLM’s with untrained knowledge base’s have been solved with RAG.</p><p>While the Vector RAG could establish the contextualisation, the extent to which it could do that, has been limited. With complicated relationships and highly interconnected data, the recall measure of Vector RAG is not impressive. One of the major reasons being, the naïve vector embeddings that make up the Knowledge Base, which only consider geometrical proximity.</p><p>Graphs, on the other hand are innately structured to capture intricate relationships within data, leading to longer contextuality. For this reason graph based RAG’s have become the best means to exploit LLM capabilities.</p><h3>Building Knowledge Graphs</h3><p>Knowledge graphs can be populated with both unstructured data like Text, PDF’s and structured data like Tables/CSV’s. To manually identify and extract Nodes, Relationships and Node properties from documents spanning multiple pages, is a in-human task and requires high amount of domain expertise. Langchain has turned this daunting task into an effortless one, by using LLM’s for graph entity extraction.</p><p>Lets take a look at how to convert Unstructured and Structured data into Knowledge Graphs.</p><h4>Unstructured data</h4><p>Before proceeding further lets make all the necessary imports</p><pre>from langchain_community.graphs import Neo4jGraph<br>from langchain_experimental.graph_transformers import LLMGraphTransformer<br>from langchain_openai import AzureChatOpenAI<br>import os<br>from langchain_core.documents import Document<br>from langchain.text_splitter import RecursiveCharacterTextSplitter, CharacterTextSplitter<br>from langchain_community.vectorstores.neo4j_vector import Neo4jVector<br>from langchain_openai import AzureOpenAIEmbeddings<br>import fitz<br>import logging <br>import ast<br>from tqdm.notebook import tqdm<br>from concurrent.futures import ThreadPoolExecutor, as_completed<br>from langchain.memory import ConversationBufferMemory</pre><p><em>We will be using Neo4j Desktop application as Graph Database and AzureOpenAI LLM across this article.</em></p><pre>#Azure opena ai Gpt model initialisation<br>gpt_llm = AzureChatOpenAI(temperature=0, azure_deployment= OPENAI_GPT_DEPLOYMENT_NAME, api_key= OPENAI_API_KEY, api_version= OPENAI_API_VERSION, azure_endpoint= AZURE_ENDPOINT)<br># Initialise neo4j object with an active neo4j server credentials <br>graph_db = Neo4jGraph()</pre><p>First we need to extract all the text from PDF’s and instantiate a langchain Document object with that text.</p><pre>def convert_pdf_to_text (file_paths):<br><br>    &quot;&quot;&quot;<br>    file_paths = list[str]<br>    rtype: Document object <br>    Implements text extraction from pdf and forms a langchain object with the document text.<br>    &quot;&quot;&quot;<br>  <br>    doc_text = []<br>    #iterate through each document<br>    for i in file_paths:<br>        logging.info(&quot;Reading ...&quot;+str(i))<br>        doc = fitz.open(i)<br>            <br>        # Iterate through each page in the document and extract text<br>        try:<br>            text = &quot;&quot;<br>            for page_num in range(len(doc)):<br>                page = doc.load_page(page_num)<br>                text += page.get_text()<br>            # Combine metadata along with the document text  <br>            doc_text.append([Document(page_content=str(text))])<br>        <br>        except Exception as e:<br>            logging.info(&quot;Error Reading Document : &quot;+str(e))<br><br>    return(doc_text)</pre><p>After the text extraction, we now<strong> chunk the documents</strong>. Each new chunk will be a Document object in itself.</p><pre>def split_text(docs):<br><br>    &quot;&quot;&quot;<br>    docs: list of docuemnt objects <br>    rtype: list[Document]<br>    Implements chunking mechanism by splitting the given document into chunks along with the metadata <br>    &quot;&quot;&quot;<br>    #initialise text splitter with appropriate chunk size and chunk overlap<br>    text_splitter = RecursiveCharacterTextSplitter.from_tiktoken_encoder(<br>    chunk_size=1000, chunk_overlap=100 )<br>    documents = []<br>    #Iterate through all the documents and implement chunking<br>    for i in docs:<br>        documents.append(text_splitter.split_documents(i))<br>    # merge all the chunked documents into a single list<br>    merged_docs = [item for sublist in documents for item in sublist]<br><br>    return(merged_docs)</pre><p><em>The chunk and overlap size can be treated as hyper parameters.</em></p><p>We now have to populate a Graph from the chunked documents by extracting Nodes, Node properties and Relationships from the Document text. As the number of documents increase, it would become an impossible task to extract them manually. Hence we would use an LLM for extraction. The LLM would go through all the document chunks and populate those nodes which have interconnected relationships. The <em>LLMGraphTransformer </em>function from langchain does the job for us.</p><pre>def construct_graph(doc):<br>    &quot;&quot;&quot; <br>    doc: Document object<br>    rtype: Graph Document<br>    Implements graph contruction functionality using llm.<br>    &quot;&quot;&quot;<br>    #initialise graph transformer object<br>    llm_transformer = LLMGraphTransformer(llm= gpt_llm)<br>    <br>    #construct graph by extracting nodes and relationships from documents using LLM<br>    graph_doc = llm_transformer.convert_to_graph_documents([doc])<br>    return(graph_doc)</pre><p>Though this might have reduced a lot of manual labour, it still consumes a huge amount time for entity extraction. Hence we would multi thread the same process to handle multiple documents and collate the results. Below is a multi-threaded implementation of the above function.</p><pre>def  thread_construct_graph(merged_docs):<br>  <br>    &quot;&quot;&quot;<br>    merged_docs: list<br>    Implements the graph construction from diocuments using LLM in a multithreaded approach and pushes the extracted nodes and relationships into the provided GraphDB<br>    &quot;&quot;&quot;<br>    MAX_WORKERS = 20 # can be changed as per requirement<br>    # NUM_ARTICLES = len(merged_docs)<br>    graph_documents = []<br><br>    with ThreadPoolExecutor(max_workers=MAX_WORKERS) as pool:<br>        # Submitting all tasks and creating a list of future objects<br>        futures =  [pool.submit(construct_graph, merged_docs[i]) for i in range(len(merged_docs)) ]<br>    <br>        #tqdm displays a progress bar for threading execution visualisation <br>        for future in tqdm(as_completed(futures), total=len(futures), desc=&quot;Processing documents&quot;):<br>            <br>            #capture results of thread status<br>            graph_document = future.result()<br>            graph_documents.extend(graph_document) #list extension method to add new graph documents to the existing list<br><br>    # add the contructed graph into graph db with extracted nodes and relatiosnhips <br>    graph_db.add_graph_documents(graph_documents,baseEntityLabel = True, include_source = True)<br>    logging.info(&quot;Constructed graphdb...&quot;)<br>    logging.info(&quot;Schema: &quot;+str(graph_db.get_schema))</pre><p>Once the graph has been populated the <em>add_graph_documents </em>method of the <em>graph_db </em>object would push the populated graph into neo4j DB.</p><h4>Structured Data</h4><p>Constructing Knowledge Graph from structured data like CSV’s is comparatively strenuous than unstructured, but can be programmatically populated. The <a href="https://neomodel.readthedocs.io/en/latest/"><em>neomodel</em></a><em> </em>library, which connects to neo4j from python, can be used to define the structure of the node and its properties.</p><p>Required imports:</p><pre>from neomodel import db, config, StructuredNode, RelationshipTo, RelationshipFrom, StringProperty</pre><pre>config.DATABASE_URL = &quot;bolt://neo4j:#PASSWORD@localhost:7687&quot;</pre><p>To define the structure of Node, we will have to define a node class, implementing the <em>StructuredNode. </em>The member variables of the class will become the node’s properties, and relationships.</p><p>The below code demonstrates , an employee node that has properties such as Emp_ID, Emp_Fname, Emp_Lname, Emp_Location, Emp_Manager_Name, Emp_Rank..etc which is related to Manager Node by ‘<em>reports to’</em> relation and to the Department Node by <em>‘belongs to’ </em>relationship.</p><pre>class Employee (StructuredNode):<br>    <br>    __label__ = &quot;Employee&quot;<br>    Emp_ID= StringProperty(unique_index = True)<br>    Emp_Fname= StringProperty()<br>    Emp_Lname= StringProperty()<br>    Emp_Location= StringProperty()<br>    Emp_Manager_Name= StringProperty()<br>    Emp_Rank= StringProperty()<br>    <br>    reports_to= RelationshipTo(Manager, &quot;reports to&quot;)<br>    belongs_to= RelationshipTo(Department, &quot;belongs to&quot;)<br><br><br>class Manager (StructuredNode):<br>    <br>    __label__ = &quot;Manager&quot;<br>    Emp_id= StringProperty(unique_index = True)<br>    M_Fname= StringProperty()<br>    M_Lname= StringProperty()<br>    dept_id=  StringProperty()<br>    dept_name = StringProperty()<br><br>class Department (StructuredNode):<br>  <br>    __label__ = &quot;Department&quot;<br>    Dept_ID= StringProperty(unique_index = True)<br>    Dept_name= StringProperty()<br>    Emp_count = StringProperty()<br>    Manager_emp_id = StringProperty()</pre><p>After defining the Node properties and relationships its allowed to have, we can now instantiate the nodes and assign values to all the node properties. For example, if i have to define a new employee node and establish a relationship between their Manager and Department nodes, here is how we could do it.</p><pre>emp_node = Employee.get_or_create({<br>    Emp_ID= #employee_id<br>    Emp_Fname= #employee_fname<br>    Emp_Lname= #employee_lname<br>    Emp_Location= #employee_location<br>    Emp_Manager_Name= .#employee_manager_name<br>    Emp_Rank= #employee_rank<br>    })<br><br>Manager = Manager.get_or_create({<br>    Emp_id= #manager_emp_id<br>    M_Fname= #manager_fname<br>    M_Lname= #manager_lname<br>    dept_id= #dept_id<br>    dept_name = #dept_name <br>})<br><br>dept = Department.get_or_create({<br>    Dept_ID= #dept_id<br>    Dept_name= #dept_name<br>    Emp_count = #emp_count<br>    Manager_emp_id =#manager_emp_id<br>})<br><br><br>emp_node.reports_to.connect(Manager)<br>emp_node.belongs_to.connect(dept)<br><br></pre><p>The <em>get_or_create </em>function either fetches an existing node if already present or creates a new node. If the manager or department nodes for an employee node already exist, then it assigns the employee node to them with the respective relationships.</p><h3>LLM Response</h3><p>Once the knowledge graph is developed, we would now be completing the Graph RAG cycle by developing the last module, that connects Graph DB with an LLM and answers user queries.</p><p>Langchain has several libraries which in connection with neo4j provides an interface to help build an QA chain. Lets explore one of those functions below which queries the Graph db with the user query</p><pre>def query_db_with_llm(existing_graph_index,  metadata, query):<br><br>    &quot;&quot;&quot;<br>    existing_graph_index = Neo4j Object<br>    metadata= dict<br>    query= str<br>    Implements querying the Graph DB using an LLM, alongside implicit metadata filtering<br>    &quot;&quot;&quot;<br>  <br>    <br>    logging.info(&quot;Metadata = &quot;, metadata)<br>    logging.info(&quot;Query = &quot;, query)<br>    <br>    #Initialise Neo4j object from the existing kowledge graph<br>    existing_graph_index = Neo4jVector.from_existing_graph(<br>    az_embeddings, # use the same embedding model as used for the embedding creations<br>    )<br>    # Intialise langchain querying object<br>    qa_chain = ConversationalRetrievalChain.from_llm(return_source_documents= True, # True when the source of answers is required else False<br>    llm= #LLM of your choice, <br>    retriever = existing_graph_index.as_retriever(search_kwargs={&#39;filter&#39;: metadata}), #does a vector embedding semantic search along with metadata filtering on node properties using neo4j vector indexing <br>    verbose = True,<br>    )<br>    #query the Graph db <br>    answer = qa_chain({&quot;question&quot;: query, &quot;chat_history&quot;: []}) <br>    <br>    return(answer)</pre><p>The above code also demonstrates an additional <strong>metadata filtering</strong> functionality which filters nodes &amp; relationships based on their properties, by passing it as a argument to index.<em>as_retriever </em>function<em>.</em></p><h4>Embedding</h4><p>As many of you have noticed, we have not explicitly created embeddings for the unstructured text data before inserting it into Graph db. The <em>LLMGraphTransformer </em>would by default create a node label by name <em>Document </em>wherein the nodes under it would contain chunks and their embeddings as node properties. The embeddings are generated when the <em>Neo4jVector.from_existing_graph </em>method is called, if not already exists.</p><p>*In my next article i shall discuss and propose an enhanced Graph RAG querying method. Stay tuned!!!</p><p><em>Hope you find this informative.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6148bcbe9c9" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/building-graph-rag-for-structured-and-unstructured-data-e6148bcbe9c9">Building Graph RAG for structured and unstructured data.</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[‘Don’t Hire Data Scientists’, the wrong way!!]]></title>
            <link>https://medium.com/@sreerama.s.k/dont-hire-data-scientists-the-wrong-way-b4ac77210677?source=rss-8067ac008580------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4ac77210677</guid>
            <category><![CDATA[hire-right]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Sreeram A S K]]></dc:creator>
            <pubDate>Wed, 17 Jan 2024 11:39:10 GMT</pubDate>
            <atom:updated>2024-01-17T22:19:14.982Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HR8VrmJ2Cz6gKdpVUJsemA.jpeg" /><figcaption>‘Don’t Hire Data Scientists’, The wrong way</figcaption></figure><p>Hello Readers!</p><p>Wishing a good day !!</p><p><em>This article is directed towards AI hiring managers and more so for startups in their prime of building data science teams.</em></p><p>Having gotten seasoned to build data science teams in multiple startups, over the sojourn of my career, I learnt more of what ought not to be done, to establish a robust AI team. I have had the opportunity to conduct close to 300+ data science interviews and several campus placement drives so far, for candidates ranging from fresh grads out of college to experienced professionals from F500 firms.</p><p>Recruitment in Data Science is a precision game!!! With the AI buzz going around in every nook and corner, it’s really a challenge to separate wheat from chaff while on a talent hunt. Especially when the talent is highly ubiquitous. Here are certain pitfalls that organisations have to cautiously avoid while on look out for Data Science Talent.</p><p><strong>Data Scientist vs Software Engineer</strong></p><p>‘Coding and Cooking and are no more gender specific skills’ !!!</p><p>While data scientists have to be good coders there is more to it than just that. Often the most common recipe for disastrous hiring is, looking for a geeky python coder, while what you need is a Data Scientist with hands on experience. Thanks to millions of open source contributors and chatgpt you have absolutely no struggle piling up code today. With the dawn of transfer learning, pre-trained models and a plethora of cloud hosted plug and play AI solutions, you hardly have a necessity for a geeky coder. In recent years Python and R have helped many coders jump the boat to become a data scientist. Its been a y2k moment for many data science enthusiasts. Scores of employees have changed their tags from software engineers to Data Scientists, thanks to Harvard’s article on calling Data Science as the sexiest job of the century.</p><p>Talent hirer’s should not get convinced and scammed with a candidate’s proficiency in congregating multiple libraries and models. Instead pick someone with an immaculate conceptual understanding. There is a significant dearth of minds with the right understanding of rudimentary Mathematics and Statistics of Data Science. Even after all the progress made so far there is still a lion’s share of AI work that is <a href="https://www.forbes.com/sites/forbestechcouncil/2023/04/10/why-most-machine-learning-applications-fail-to-deploy/#:~:text=A%20sober%20analysis%20of%20AI,it%20from%20prototype%20to%20production.">not production grade.</a></p><p><strong>Jargon Deception</strong></p><p>More often the winning pathway is laid with why than how!!. The present day is mushrooming with crash course data science graduates who are not aware of the fact that the first definition of Machine Learning came into being way back in 1959. Chatgpt, LLM’s and Deep Fake have helped gain tremendous traction for AI, making it a pet phrase for everyone. While to stay on par with the emerging advancements is necessary, having only a shallow and superficial understanding is ephemeral at best. None of the modern Data Science techniques have their roots outside fundamental mathematics and statistics.</p><p>In the sporting world they say form is temporary and class is permanent. While hiring data science talent, the trap to avoid is not to get your feet swept off with trendy jargons. Check around to find if the candidate has got the intuitive grasp of jargon thrown around. A good hire is certainly someone who is vigorously adaptive, and such dynamic dexterity comes only with a strong cemented foot in foundational concepts.</p><p><em>I remember interviewing an experienced data science professional from a multinational. Twenty minutes into the interview the candidate has doled out a laundry list of the latest tech he has mastered in Deep Learning. Next moment tumbles upon the question of why we use partial derivatives in neural networks and not complete derivatives.</em></p><p>Many Organisations have transitioned from having butterflies in their stomach at the mention of the word Data Science, to having nightmares. Post pandemic recession has forced many organisations to ruthlessly shed off data science teams with years of funding getting drained and many startups have even gone extinct. The dust has finally settled down and the industry is now looking for ROI’s on their AI investments. Its now a bigger challenge to not turn data science into another dot-com bubble. While we boast the rapid growth of AI, the sad truth is it’s more quantitative than qualitative.</p><p>Hope you liked. Mail me at sreeramask@gmail.com!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4ac77210677" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Calculating Sample Size using VC Dimensions; a Machine Learning way.]]></title>
            <link>https://medium.com/data-science/calculating-sample-size-using-vc-dimensions-a-machine-learning-way-748abbe1b1e4?source=rss-8067ac008580------2</link>
            <guid isPermaLink="false">https://medium.com/p/748abbe1b1e4</guid>
            <dc:creator><![CDATA[Sreeram A S K]]></dc:creator>
            <pubDate>Tue, 09 Jun 2020 13:37:24 GMT</pubDate>
            <atom:updated>2020-06-13T05:18:39.785Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>How and why do we need to know what is the optimal sample size??</em></h4><p>The data collection process is a tedious task in itself, spanning for eons. In domains like healthcare, this process involves a lot of costs and typically takes about years of time. For example, to procure information about a particular disease, say a 100 data points, would involve screening patients double or triple the desired sample size. Obtaining patient data is not only a time-consuming job but is also something that comes at a very high price. While collecting huge amounts of data when little would do is a very futile task, similarly not being able to meet the data requirements will not accord good results when a Machine learning algorithm is applied to it. Eventually, approximating an optimal sample size thus is a decisive task and something that needs to be looked upon before going on with performing any analysis on the data.</p><p>Here I will discuss an interesting technique to approximate the sample size using the concept of VC dimensions, by tweaking it a bit to our ease and comfort. Before proceeding further I would like to throw light upon a statistical method or way of approximating the sample size and then further put across its limitations and thus present you with the necessity of the VC dimension way of doing it.</p><p><strong>Statistical Sample Size estimation</strong></p><p>To explain the statistical way of estimating the sample size I take reference from the work presented <a href="http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Power/BS704_Power_print.html">here</a> by Prof. Lisa Sullivan of Boston University. <em>I recommend all the readers to go through the given link before going any further as I explain the methods proposed in it precisely</em>. The proposed method brings forth a way of estimating an optimal sample size that can reduce the <em>error margin E </em>caused by the input features, due to the variance present in the data. In order to determine the optimal sample size, one has to first choose the desired error margin, which typically is the work of a domain expert and varies according to the problem. The formula to calculate the sample size in the above-stated way is given below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/148/1*AkT0aRvEIYhx95UIesn2TA.png" /></figure><p>This formula generates the sample size ‘<strong>n’</strong>, required to ensure that the margin of error, <strong>E</strong>, does not exceed a specified value. To solve for <strong>n</strong>, we must input “<strong>Z</strong>,” “<strong>σ,”</strong> and “<strong>E</strong>.”</p><p><strong>‘σ’ is the sample variance</strong></p><p><strong>‘E’ is the desired error rate</strong></p><p><strong>‘Z’ is the Z- distribution value for a given level of confidence</strong></p><p>From the above formula, it’s important to observe that ’n’, the sample size, depends on the chosen error margin “<em>E”.</em></p><p>The Statistical way of determining the sample size though logically sounds great comes with a very vivid innate limitation.</p><blockquote>Statistical sample size estimation does not give a way of choosing a sample size that can reduce the error or increase the accuracy of predictive machine learning models applied on the data.</blockquote><p>In fact, the sample size estimated this way does not in any way take into account any machine learning model or algorithm that is applied to it. Thus it makes the statistical method very naive and less helpful.</p><p>Is there a way of choosing the sample size that can reduce the error of the machine learning model applied to the data?? Or Is there a way of determining what is the expected error of a machine learning model for a particular sample size. The answers to these questions are tightly knit with the concept of the VC dimension.</p><blockquote>The method of VC dimensions gives a way of determining the sample size that which can reduce the error of any machine learning model applied on it.</blockquote><p><strong>VC dimensions</strong></p><p>The concept of VC dimension has paved a way for determining the Test error based on the machine learning algorithm chosen to be applied to the data and the training error associated with it.</p><p>Let me first brief the concept of the <strong>Vapnik–Chervonenkis (VC) dimension </strong>and how it works.</p><p><em>Note: My explanation of the concept of the VC dimension is very slender as the main focus of this article is on the calculation of the Sample size using it rather than the concept itself</em>.</p><p>Vc dimension measure’s the capacity of a statistical classification algorithm in learning a set of functions. Simply put, it measure’s the power of a classification model.</p><blockquote><em>The typical definition of VC dimension of a statistical classifiction algorithm is; the</em> cardinality of the largest set of points that can be <strong>shattered</strong> by the algorithm.</blockquote><p><strong>Shattering</strong></p><p>Here I directly borrow the lucid definition of <em>shattering</em> from <a href="https://en.wikipedia.org/wiki/Vapnik%E2%80%93Chervonenkis_dimension#:~:text=In%20Vapnik%E2%80%93Chervonenkis%20theory%2C%20the,by%20a%20statistical%20classification%20algorithm.">Wikipedia</a>.</p><p>“A classification model ‘<em>f ’</em> with some parameter vector ‘θ’ is said to shatter a set of data points {X1, X2…, Xn} if, for all assignments of labels to those points, there exists a ‘θ’ such that the model ‘<em>f ’</em> makes no errors when evaluating that set of data points.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Z0vkoAAOIWPo80hjMYeFg.png" /><figcaption>Shattering</figcaption></figure><p>Thus the number of points that an algorithm can shatter defines its VC dimension.</p><p>Now moving to the central theme of this article as to how VC- dimensions can come handy in identifying the right sample size, let me introduce the formula which gives a probabilistic upper bound on the amount of test error generated by an algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*6897TEeQjMgYsyXjTkFURQ.png" /></figure><p>Though at first look it may look scary, let me reveal it part by part. The formula here considers the training error of a model, the VC-dimension ‘D’ of the applied algorithm, the size of the sample on which the model is applied ’N’, and ‘η’ which is 0≤η≤1.</p><p>Hence, simply put, the above formula takes into consideration a model’s Vc-dimension, the size of the sample, and training error obtained by it and then generates a probabilistic upper bound on the test error that can be obtained given all the above-stated factors. Till here I have not brought out anything novel, apart from explaining the general concept and working of Vc-dimension. Well, actually we have already reached the end without actually knowing it. A little tweak of the above formula gives us our anticipated approximation of the sample size.</p><p>We hack the above formula in such a way that we get ’N’ the sample size. Since our aim now is not to get an upper bound on test error but instead a sample size that can reduce the test error, we now choose a test error that which we can entertain based on the problem we are dealing with and sweep across a range of values for ‘N’ till we reach the desired test error. So instead of solving for the test error as we did earlier, we now solve for the sample size.</p><p>In general, as we choose a much stricter test error the value of ‘N’ increases. Thus the better the test error we want the bigger our sample size should be. Our resulted sample size approximation thus is the one that can reduce the test error.</p><p>This way of approximating is extremely simple and also flexible with the machine learning algorithm that we apply to the data. The approximated sample size varies with from model to model.</p><p><em>Hope this was informative!!</em></p><p>*some of the definitions and figures are sourced from Wikipedia and the internet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=748abbe1b1e4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/calculating-sample-size-using-vc-dimensions-a-machine-learning-way-748abbe1b1e4">Calculating Sample Size using VC Dimensions; a Machine Learning way.</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stacking Classifier approach for a Multi-classification problem.]]></title>
            <link>https://medium.com/data-science/stacking-classifier-approach-for-a-multi-classification-problem-56f3d5e120c8?source=rss-8067ac008580------2</link>
            <guid isPermaLink="false">https://medium.com/p/56f3d5e120c8</guid>
            <dc:creator><![CDATA[Sreeram A S K]]></dc:creator>
            <pubDate>Sat, 25 Apr 2020 06:04:05 GMT</pubDate>
            <atom:updated>2020-05-18T15:34:50.243Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I draft this concept of stacking classifiers based on my experimentation with it in a project that I have done. So the conceptual explanation of this may be a little inclined.</em></p><p>No one size fits all!!</p><p>When there are many classes in a dataset, assigning <em>a single model</em> with the task of classification, and expecting a high accuracy seems a bit too ambitious. Especially when the given dataset is very small. An easy hack to achieve this would be to design individual binary classifiers for each of the classes and combine all these binary classification models for prediction. A <strong>Stacking Classifier </strong>works pretty much in the lines of these intuitive ideas. Just like other ensemble techniques stacking classifier too uses many models for the task of prediction.</p><p><em>A stacking classifier is an ensemble method where the output from multiple classifiers is passed as an input to a meta-classifier for the task of the final classification.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*0hEXoK6zXhTt05q3V3vmnA.png" /><figcaption>Figure -1</figcaption></figure><p>The<em> stacking classifier approach </em>can be a very efficient way to implement a multi-classification problem. <em>The multi-classification problem can be converted (or rather broken) into several binary classification problems i.e. one for each class</em>. All the binary classification models, generally called as <em>base learning models, </em>can be thus combined by making use of the meta-classifier for the final output prediction task. This can be done by <strong><em>stacking </em></strong>together the outputs from each of the binary models and passing it as an input to the metaclassifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1qHUKYBk7QYpdRKTBv2MKw.png" /><figcaption>Figure -2 Stacking classifier block diagram</figcaption></figure><p>Different models can be used for the base learners. For example, while trying to classify between a particular class points with the rest, as in a one vs rest fashion for a multiclass data set; in some cases, there may exist a linear separation between the data points belonging to a particular class and the rest, and there may not be a linear separation in some cases. So the base learning models will have to vary accordingly. This provides a lot of ease and flexibility to tackle multiclassification problems. All the base learners are trained using the entire data.</p><p>The input data set for the meta-classifier is formed from the outputs of all the base learners and provide the actual output as the target variable for the meta classifier. The meta-classifier can be any classifier of our choice, whose job is to utilize the information provided by the binary classifiers to make the final prediction. The meta classifier is trained using the output of the base learners. The input to the meta-classifier may thus look like the following diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rv3lDi5367oxX5mvw6lWyw.png" /><figcaption>Figure -3 Example of training data set for the meta-classifier</figcaption></figure><p>The output from each of the base learners forms the feature set of the meta classifier. Thus for a multiclassification problem, the number of classes may equal the number of features of the meta-classifier.</p><p>Stacking classifiers have been designed to improve predictive performance and have shown to be performing better and have many a time worked better than the state of the art models and thus are extensively used to Kaggle competitions. On the contrary, the computational expense of these models is high. More information and tips regarding the stacking classifier approach are presented in the following link.</p><p><a href="https://www.kaggle.com/zaochenye/tips-for-stacking-and-blending">https://www.kaggle.com/zaochenye/tips-for-stacking-and-blending</a></p><p><em>Hope it was informative!!</em></p><p>*Figures 1 and 2 are sourced from the internet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56f3d5e120c8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/stacking-classifier-approach-for-a-multi-classification-problem-56f3d5e120c8">Stacking Classifier approach for a Multi-classification problem.</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to make your Data Speak Part-I]]></title>
            <link>https://medium.com/@sreerama.s.k/how-to-make-your-data-speak-10f01d25bf68?source=rss-8067ac008580------2</link>
            <guid isPermaLink="false">https://medium.com/p/10f01d25bf68</guid>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Sreeram A S K]]></dc:creator>
            <pubDate>Sat, 28 Sep 2019 10:20:17 GMT</pubDate>
            <atom:updated>2020-04-25T06:19:28.764Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Visualization&#39;s voice Data</strong></p><p>This is a Data Visualisation Exercise that has been done on a Data set from Kaggle — “Exploring Barcelona”.</p><p>This article circulates around Data sets — Births.csv, Population.csv, Accidents.csv, pertaining to the above mentioned Kaggle Data set.</p><p>This article is intended to discuss the right techniques of Data Visualisation to convey those important touchpoints which the data intends to convey.</p><p>Busy cities are always prone to have a high record of Accidents. So here is the City of Barcelona and its record of Accidents.</p><p>First let’s take a look at which month has recorded more number of Accidents, across all the year.</p><p>The below graph shows a bar plot of all the sum of accidents, distributed across the year (2017), we chose bar graphs for they are simply a simple way of conveying information and provide a convenient way to compare different values by the length of the bars.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*fMjWQw29WDhywVWxQbnKqA.png" /></figure><p>November leads with most number of Accidents and August has less number of Accidents. Since it is a holiday time during August people travel less and hence less number of Accidents.</p><p>Now let’s see which part of the day has recorded more number of Accidents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*tfqLgY6RRtwnfLdaEuXFyA.png" /></figure><p>Careful! When you walk on the streets of Barcelona during Afternoons since its evident that almost 50% of the accidents happen in the Afternoons.</p><p>Now let’s go District Wise!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*ZGpu5DD78kOcd7MRzalxMQ.png" /></figure><p>Eixample has the Highest accident count amongst all the Districts.</p><p>But what time should I walk out into the streets of Barcelona so that I wont be a victim of accidents.?</p><p>Here is the answer!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*WntwoCcdHDtMiKfEUq4cVQ.png" /></figure><p>No wonder Afternoon has the highest record of Accidents for almost 33% Accidents seems to happen during 12 to 4 hours.</p><p>Below is the Distribution trend line of the Accidents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*ZNXZRkUyTP_adCdiD-mnCA.png" /></figure><p>Here it is look closely at the peak in the Distribution is in the time range of 12 to 16. Like how we have seen that After noon has the Highest record of accidents.</p><p><strong>Which districts hold the Highest record of Accidents and by what percentage?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*zSxMTaJ7B1q6p6MDX32qIA.png" /></figure><p>AS seen previously Eixample city holds the record of highest accidents but here it is more clear as to what percentage of total accidents in Barcelona happen in each of its cities.</p><p>More number of accidents means either there a lot of people in that place or there are more number of careless drivers in that place. Which of these is true?</p><p>Let’s first see what’s the population of each of these of places.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*rxmAmkuTwqP_LyjzdU0F3g.png" /></figure><p>No wonder Eixample has more number of Accident victims for it is the most densely populated city amongst all the other cities of Barcelona.</p><p>Does this mean that more the number of people that <em>is the population of a city has influence on the number of accidents happening that place?</em></p><p>How do we check if that’s the case? How do we check for the relation between them?</p><p>Here is where regression graphs come handy.</p><p>Take a look at the below regression graph which shows a relation between Population and Accidents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*VlevzEjXAH9kzUAXUrvT7g.png" /></figure><p>Now this shows a very good polynomial relation between Population and Accidents and that too with an amazing R-square value of 87%. This proves that, <em>the more densely Populated a city is, those many Accidents take place.</em></p><p>This seems to be quite an obvious fact but not until a lot of data crunching has taken place.</p><p>This is the power of simpl<em>e Data Visualisation techniques that can crunch a sea of a Data and Squeeze out usual chunks of information and relations</em>.</p><p><strong>Hope this was informative!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10f01d25bf68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to make your Data Speak Part-II]]></title>
            <link>https://medium.com/@sreerama.s.k/how-to-make-your-data-speak-d52e49b302ef?source=rss-8067ac008580------2</link>
            <guid isPermaLink="false">https://medium.com/p/d52e49b302ef</guid>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Sreeram A S K]]></dc:creator>
            <pubDate>Sat, 28 Sep 2019 09:58:47 GMT</pubDate>
            <atom:updated>2020-04-25T06:19:06.232Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Visualization’s voice data</strong></p><p>This is a Data Visualisation Exercise that has been done on a Data set from Kaggle — “Exploring Barcelona”.</p><p>This article circulates around Data sets — Unemployment.csv, Births.csv, Immigrants, and Emigrants.csv by Gender and Age, pertaining to the above mentioned Kaggle Data set.</p><p>This presentation aims to shrink an ocean of data to titbits of useful information.</p><p>The moment you speak of Immigrants and emigrants the point that gets stuck to our mind is Travelling. Traveling always is related to Age.</p><p>This graph shows the number of Immigrants to Barcelona by age Group from 2013 to 2017.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*mgs2OmsyIVuC2O_IHlqEnw.png" /></figure><p>We choose bar graphs simply because they serve our purpose well and are easy to interpret with just little or no Effort.</p><p>The above graph shows a good picture that probably there is a good normal distribution though it seems to be a bit right skewed.</p><p>The age group of 20–39 is the age group that’s moving in most of the time. No wonder given the fame for the beauty and the historical antiques of the city of Barcelona more and more youngsters have poured in across the years.</p><p>Now let’s a look at the Emigrants that are flooding out of the city of Barcelona</p><p>Let’s start with the age factor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*PAwk88LBDSIwGPlIKWMTaA.png" /></figure><p>Even the most active Emigrant age group seems to be beating, again, around 20–39.</p><p>Now having seen different age groups of immigrants and emigrants lets checkout a visual ratio of Immigrants and Emigrants.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*z7VKsmsTKFuZWjTpbiRH0A.png" /></figure><p><strong>Which country is Losing its people to Barcelona?</strong></p><p>Well there seems to be a lot of immigrants but let’s check out from which country do we have our visitors from.</p><p>The below graph is a horizontal bar plot which shows a count of number of immigrants from all the countries to Barcelona.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*YEByvsw472USPofX_qAI8g.png" /></figure><p>This time too bar graphs seems to convey the information we want the Data to do, so that’s the reason we choose Bar Graphs, but this time a Horizontal one.</p><p>No wonder people from Spain are pouring in more and more given the nearness of these two places in terms of location.</p><p><strong>Immigrants and Emigrants by Gender</strong></p><p>Gender influence of the places we visit is a big thing to consider so let’s look at the same Immigrants and Emigrants by Gender this time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*JQQRnp1Y1cjAdt8hqTZ1nQ.png" /></figure><p>Females seems to be heading their way into Barcelona way higher than Males. The above graph gives the count of the number of males and females that have Immigrated into Barcelona across the Years.</p><p>The below graph shows the total count of Immigrants by Gender across the Years 2013–2017</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*JQQRnp1Y1cjAdt8hqTZ1nQ.png" /></figure><p>Females again seems to lead the group.</p><p>This is a simple way to understand the key touchpoints where there is a chunk of useful information, all by plotting necessary graphs which will do the speaking in place of Data.</p><p>In both of the cases (emigrants &amp; immigrants) Females seems to lead the way. What might influence this heavy movement of people in out of Barcelona. Data tells that movement is mostly caused by youngsters. Is this because people are moving in search of Jobs. Let’s see whether this has got anything to do with the Unemployment.</p><p><strong>Unemployment</strong></p><p>But before we go about checking the causality of things lets go about making our hands a bit dirty with the unemployment data provided.</p><p>Here are some key factors relating to the unemployment</p><p>The below trend line formed by the Line Graph is formed by considering the prevailing unemployment that occurred across the months for years (2013- 2017). This Line Graphs have the capability to convey the distribution of things across a timeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SmcOqnOSyculZZAqYimFCA.png" /></figure><p>This shows how unemployment rate varies across all the months for all the years.</p><p>Now let’s take look at the Gender wise classification of the unemployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*XkN_lfS_mmbCRtqXOSsLoQ.png" /></figure><p>Let’s dive a feet more and find out how does the distribution among the male and female varies across all the different districts of Barcelona .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*WYCuWsGn6UhohAar62mvNg.png" /></figure><p>This shows an upper hand for the female unemployed across all the districts of Barcelona.</p><p><strong>Finding Causality</strong></p><p>Now what might be happening with all these unemployed people. Are all the unemployed people migrating out of Barcelona.</p><p>Does unemployment have any effect on the increasing number of Emigrants. If yes, then who are more likely to be influenced, Male or Female. How do we get to know about it?</p><p>Here are some simple graphs that have the capability to bring out the relation between emigrant’s vs unemployed. Regression graphs are always sought when information in the graphs is supposed to convey any kind linear or non-linear relation between two things.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*flqlBqZrFQFYzVQ8XK6o2w.png" /></figure><p>This is a regression plot between Female unemployment and Female Emigrants.</p><p>This shows that there is no considerable relation between the Unemployed female and Female emigrants.</p><p>Now let’s check what’s the case with Male’s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*mpn0gdg-tE_YzJjIRLxgxw.png" /></figure><p>The above regression graph shows a very <em>good relation between the Unemployed Males and Male Emigrants</em> with an R-square value 52%.</p><p>That’s our clue for stating that <em>unemployment within the city of Barcelona may be one of the reasons as to why males are moving out</em>, probably in search of jobs.</p><p>Now what might be the reason for Unemployment in females??</p><p>Well let’s look at this from different angles.</p><p><strong>Table — 1</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*x1OpUnGQx_ZQ2n9fKHEwVA.png" /></figure><p>Take a close look at this Table.</p><p>In almost all the Districts where there are More number of Births, the female unemployment also surged up.</p><p>Well this brings us to an interesting stand point where we can establish a relation or rather a causality between the Births and Female unemployment. This reasons out as, <em>more number of females are dropping out of jobs once they have children to care of.</em></p><p>This seems to be an obvious conclusion but not until Data revealed it to us.</p><p>To prove this point further more here we have an interesting regression graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*8RWiWGrmxu-RC9HycY6T1w.png" /></figure><p>The Regression graph above shows a very strong correlation between Births and Female Unemployment with a whooping R-square value of 99.92%.</p><p>This shows an awesome relation between number of Births and increasing Female Unemployment, standing as a sound proof for assumption that Females in Barcelona drop out of jobs once they children.</p><p>Taking a further reference from Table-1 we can conclude that almost 8 out of 10 Unemployed women in Barcelona are mothers.</p><p>This is how simple Data Visualization techniques can help your Data speak.</p><p><strong><em>Hope this was informative!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d52e49b302ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bagging and Boosting — The Ensemble Techniques]]></title>
            <link>https://medium.com/@sreerama.s.k/bagging-and-boosting-the-ensemble-tecniques-3be22f75a8f4?source=rss-8067ac008580------2</link>
            <guid isPermaLink="false">https://medium.com/p/3be22f75a8f4</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Sreeram A S K]]></dc:creator>
            <pubDate>Thu, 08 Aug 2019 08:04:40 GMT</pubDate>
            <atom:updated>2025-02-20T06:39:17.706Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Bagging and Boosting</strong></p><p>Every time we talk about Decision Trees we cannot stop our self to mention about their slow learning process and their innate ability to overfit the data</p><p>To increase the performance and to reduce the problems that surround it we don’t use just one but a combination of Decision trees, to produce better predictive performance and to avoid the problem of overfitting.</p><p><strong>Bagging</strong></p><p>Bagging exactly does the same!</p><p>It takes several subsets of data with replacement from the given data and goes on to build a Decision Tree with each such chosen sample forming about a forest with these Decision trees (thus gets the name <strong><em>Random Forest</em></strong>). Each Decision Tree built over the sample data might have got overfitted, which really doesn’t concern us. Rather, many times the tree is made to <strong>Over fit</strong> the sample data. But then our final tree will not have an effect of these, for we are not considering any one Decision Tree that is built over the sampled data but a combination of all Trees (whether or not it’s overfitting ) to get a more robust one. The final Decision Tree will be built by Averaging all the predictions from different trees.</p><p><strong>Boosting</strong></p><p>Boosting is more like Teamwork, rather than parallelize work into small islands and aggregating them, in the end, to get a single output Learning model, like Bagging.</p><p>Boosting uses the idea of weighted learning. It refers to a group of algorithms pertaining to the weighted averages that turn Weak Learners to Strong Learners. Every model that runs, dictates what features the next model should focus on as they all run consecutively.</p><p>Both Bagging and Boosting turns a Single Learner model to an N Learner model that can accelerate learning by N-fold.</p><p>Since the data is sampled multiple times, randomly with a replacement which leads to the repetition of observations across the different samples and ultimately contributing to the learning of different models.<strong> In the case of Bagging, any element has the same probability to appear in a new data set. But in Boosting the observations are weighted and thus some observations have more probability of being a part of new data sets more often.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*TPVMb8Wc6TEMF4t4.png" /></figure><p><strong><em>Why does Boosting Use Weighted Data Elements</em></strong></p><p><em>Just like they say how every mistake of ours should help us not commit a second one!</em></p><p>Boosting too works exactly the same way! Boosting builds Learners in a Sequential Fashion. Each classifier is trained on data taking into consideration the success and failure of the previous model(s). At the end of every model, the weights are Redistributed to Boost the learning process the models that follow it. All the <strong>Misclassified Data</strong> increase their <strong>Weights</strong> so the mistakes committed by the previous Model are emphasized; to be corrected by the Model that follows it. (Quite close to Human Learning). This forms the differentiating wall for Bagging and Boosting</p><p>But <em>Bagging</em> and <em>Boosting,</em> both are <em>similar</em> in that they are both <strong>Ensemble Methods.</strong></p><p>(I would use this opportunity to explain a bit about it).<strong> </strong>Ensemble techniques are used to train multiple models using the same learning algorithm. They combine a set of Weak Learners to create a Strong Learner that obtains better performance than a single Learner. They behave as a group of hundreds or thousands of learning algorithms that are fused together to work, solve (classify) a single problem accelerating the performance, and at the same time speeding up the learning process.</p><p><strong>When to Use What??</strong></p><p>The answer, of course, would be a cliche: “Depends on the Data “!</p><p>But yes there is a way to know what to apply in which situation. If the problem with the single model is <strong>Over-fitting, </strong>then Bagging would be the best choice which would, in fact, use the over-fitted models and aggregate them to a single best one.</p><p>But if the problem with the single model is that of <strong>Lower performance</strong> then Boosting stands tall for it decreases the error at every stage and could come out with a combined model, at last, that would have a lower error rate than a single model.</p><p><em>Hope! You this was informative!!</em></p><p>*All the pictures are from the web</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3be22f75a8f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>