FAISS (Facebook AI Similarity Search) is a vector library developed by Facebook that is used to store and search embeddings efficiently. It is particularly useful for tasks like question answering within documents, where you need to retrieve relevant parts of the content based on semantic similarity. By converting text into embeddings, FAISS allows you to […]
hyperparameter tuning with scikit learn
We would be looking at tuning hyperparameters with Scikit-Learn. Scikit-Learn is a powerful machine learning library for Python. It provides simple , efficient tools for data analysis and modeling. Hyperparameter tuning is the process of finding the best values for the settings of a machine learning model that are not learned from data, but set […]
principal component analysis scikit learn
PCA (Principal Component Analysis) in Python using Scikit-learn is a technique used to reduce the number of features in a dataset while preserving most of the variance (information). It works by: Finding new axes (principal components) that capture the most variance. Projecting the data onto these fewer dimensions. It’s useful for visualization, speeding up models, […]
Reflexion Prompting
This technique is highly effective for chatbots and problem-solving tasks. It also helps reduce hallucinations by incorporating a form of quality control. The process involves: Starting with an initial prompt Getting the AI’s first response Sending a reflexion prompt asking the AI to review and reflect on its first answer Receiving an optimized response, improved […]
Python Pandas Lambda Function
Lambda functions in Python are small, anonymous functions defined using the lambda keyword. They are typically used for short, throwaway functions that are needed for a brief period, such as within map(), filter(), or sorted() calls. A lambda can take any number of arguments but only one expression, which is evaluated and returned. For example, […]
Simple Imputer
When working with data in Python, especially using pandas, handling missing values is a crucial step in data cleaning. Missing values can occur in both categorical and numeric columns. There are several common strategies to address them: you can choose to ignore them (though this is rarely recommended), remove the rows that contain them using […]
Logistic Regression
Logistic regression is a statistical model used for binary classification problems, where the goal is to predict one of two possible outcomes. Unlike linear regression, which predicts continuous values, logistic regression estimates the probability that a given input belongs to a particular class. It uses the logistic (sigmoid) function to map predicted values between 0 […]
Decision Tree
A decision tree is a non-parametric supervised learning algorithm, which is utilized for both classification and regression tasks. It has hierarchical, tree structure, which consists of a root node, branches, internal nodes and leaf nodes. note: Parametric supervised learning refers to a type of machine learning where the model assumes a specific functional form and estimates […]
Voting Classifier
Boosting Accuracy with Voting Classifiers In machine learning, combining multiple models often leads to better performance than relying on a single one. A Voting Classifier is a simple ensemble method that does just that — it aggregates predictions from several models to improve accuracy. There are two types: Hard Voting: Takes the majority vote from […]
Elastic Net Regressor
Elastic Net regression is a linear regression method that merges the strengths of both Lasso (L1) and Ridge (L2) regression techniques. It helps reduce overfitting and is especially effective when working with datasets that have many features, particularly when some of those features are highly correlated. The model’s regularization is controlled by two key hyperparameters: […]