Posts

Showing posts from February, 2025

ML concepts (Regression, Classification, Clustering)

Image
 ML concepts (Regression, Classification, Clustering) Part1 Regression Regression is a supervised Learning. It is a statistical technique used in machine learning to predict continuous values . It helps understand relationships between dependent and independent variables. Example: Imagine you are a real estate agent and want to predict the price of a house based on its size. You collect data on previous sales, including house sizes (independent variable) and their prices (dependent variable). By applying regression, you can find a mathematical relationship between these two and use it to predict the price of a new house based on its size. Types of Regression Linear Regression Multiple Linear Regression Polynomial Regression Ridge & Lasso Regression Logistic Regression (used for classification, not traditional regression)  Linear Regression This is the simplest form of regression where we fit a straight line to the data. The mathematical equation is:      ...

Retrieval-Augmented Generation (RAG)

Image
Retrieval-Augmented Generation (RAG) Introduction Retrieval-Augmented Generation (RAG) is a method/approach that basically enhances LLMs (Large Language Models). It extracts relevant information from external sources such as databases, APIs, Documents etc. before providing any response. Uses of RAG LLMs are limited to training data only and there are high chances that it may provide outdated or incorrect information. Well, worry not, RAG is there for rescue.  RAG solves this by extracting the most recent and relevant data at query time , leading to more accurate, fact-based responses to the user.  RAG improves LLMs by integrating external knowledge retrieval. Let us see how RAG works Retrieve: When a user asks a question, the system fetches relevant documents or data. Augment: The retrieved data is added as context for the LLM. Generate: The LLM then generates a response using both its pre-trained knowledge and the retrieved context. Example: Without RAG: 🤖 The presiden...