Definitions Flashcards
Edge AI
A technique of having the AI model deployed on the device. For eg: when the AI model is deployed on a drone or CCTV camera
JetSon Nano
Nvidia’s hardware containing CPU and GPU that will be put on the devices to execute the AI on the data. Implementation of Edge AI
RAG
Retrieval augmented generation
RAG (Retrieval-Augmented Generation) AI is an advanced method for improving the capabilities of natural language models like GPT. It combines the strengths of pre-trained generative models with information retrieval systems to produce more accurate, contextually relevant, and up-to-date answers.
Here’s how it works:
1. Retrieval: In a RAG system, the model first retrieves relevant documents or pieces of information from an external database or knowledge base. This external information helps the model fill in any gaps in its own knowledge and grounds its responses in more factual or up-to-date sources. 2. Generation: Once the relevant information is retrieved, the generative model processes it and uses it to craft a response. This means that instead of relying purely on what was learned during training, the model dynamically incorporates fresh, context-specific knowledge.
This combination is particularly useful when dealing with questions that require real-time or highly specific information, ensuring that responses are both coherent and factually reliable.
Chatbot categories
- Flow based
a. Rule based. (Can be achieved with programming)
b. AI/NLP (using chatbot frameworks such as DialogFlow, RASA, Amazon Lex, botpress) or custom implementation using LLM/Langchain - Open Ended
DialogFlow
Chatbot framework by Google
Collaborative filtering
Recommendation technique that suggests item to users based on the preference and behavior of similar users
K nearest neighbour
Machine learning algorithms to find the nearest neighbour based on set of features
Recommendation system
Popular application of AI which recommends relevant content to users based on their past activities
Two approaches to build a recommendation system
Content based filtering and collaborative filtering
10 stages of AI project lifecycle
- Requirments
- Data collection
- Data preparation
- EDA : Exploratory data analysis - Process of exploring the data to identify the pattern and structures
- Feature engineering : Process of selecting the right attributes of the data and tranforming it to train the model, this step is like selecting the right ingredients for making the required pizza
- Monitoring the feedback loop
- Model deployment
- Model fine tuning
- Model evaluation
- Model selection and training
Map and Reduce
Map and Reduce: Map is the process used in distributed computing to assign work to different computers on cloud and Reduce is the process of collecting individual results and aggregating them to final answer.
Feature Engineering
Feature Engineering: Feature Engineering is a process of transforming raw data into meaningful features (which can be new columns) such that these features help in improving the performance of the model being trained. Domain understanding and math/statistics can be used for doing feature engineering.
Scikit
Scikit Learn: A library used to perform feature learning in machine learning problems.
Scaling
Scaling: A technique used to adjust the data points to a scale that can be easily interpreted such as a scale between 0 to 1.
Accuracy (Model Evaluation Metrics)
Accuracy: The percentage of correct
predictions made with respect to overall
predictions .
Accuracy and precision are both metrics used to evaluate the performance of a model, but they measure different aspects of prediction quality. Here’s the difference:
Accuracy:
• Definition: Accuracy refers to the overall correctness of a model’s predictions. It measures how often the model correctly predicts the true class (both positives and negatives). • Formula:
Accuracy = (True Positives + True Negatives)/Total Predictions
• Example: If a model predicts 90 correct results out of 100 total predictions, the accuracy is 90%.
Accuracy is best used when the dataset is balanced, meaning the number of instances in each class is roughly equal.
Precision (Model Evaluation Metrics)
Precision: The percentage of correct predictions made for a given class (e.g.class=“dog”) with respect to all predictions which resulted in the value of a given class (e.g.class=“dog”).
A system with high precision might leave some good items out, but what it returns is of high quality
Recall (Model Evaluation Metric)
Recall: The percentage of correct predictions made for a given class (e.g. class= “dog”) with respect to total number of instances of the class (e.g. class=“dog”)
A system with high recall might give you a lot of duds, but it also returns most of the good items
Recall, also known as sensitivity or true positive rate, is a model evaluation metric that measures the ability of a model to correctly identify all relevant instances within a dataset. It focuses on how well the model can detect true positives (actual positive cases) out of all the actual positives in the dataset.
Formula:
Recall = True Positives/(True Positives + False Negatives)
Where:
• True Positives (TP): Cases where the model correctly predicts the positive class. • False Negatives (FN): Cases where the model incorrectly predicts the negative class, missing actual positives.
Interpretation:
• A high recall means that the model is able to detect most of the actual positive cases, but it may also increase the number of false positives (incorrectly identifying negatives as positives). • A low recall means the model is missing many true positives, failing to identify a significant portion of actual positive cases.
Use Case:
Recall is particularly important in scenarios where missing positive cases is costly or critical, such as:
• Medical Diagnoses: Missing a positive diagnosis (e.g., cancer) can have severe consequences, so high recall is prioritized. • Fraud Detection: Detecting fraudulent transactions is critical, even if it means flagging some legitimate transactions (higher false positives).
Trade-Off:
Recall often has a trade-off with precision, which measures how many of the positive predictions made by the model are actually correct. In scenarios where both metrics are important, the F1 score is used to balance recall and precision.
F1-Score (Model Evaluation Metric)
F1-Score: F1-Score is a harmonic mean of precision & recall, providing a single metric that balances both .
Ground Truth / Labeled data set
Data set that is labeled and used for training
Gradient Descent
Algorithm that internally updates / corrects itself based on the feedback
Gradient descent is an optimization algorithm used to minimize a function by iteratively moving towards the minimum of the function. It’s commonly used in machine learning to find the optimal parameters of a model, such as the weights in a neural network.
Here’s how it works:
1. Initialization: Start with a set of random parameters (weights). 2. Compute the gradient: At each iteration, calculate the gradient of the loss function with respect to each parameter. The gradient tells us the direction of the steepest ascent (increase) in the loss function. 3. Update the parameters: Move the parameters in the opposite direction of the gradient (steepest descent) by a small step, called the learning rate. This reduces the loss. 4. Repeat: Keep repeating the process until the parameters converge to values where the loss is minimized (or sufficiently small).
The key idea is that each step gets you closer to the optimal solution by gradually lowering the loss function. If the learning rate is too small, the process can be slow, and if it’s too large, it may overshoot the minimum.
Gradient descent can take several forms:
• Batch gradient descent: Uses the entire dataset to compute the gradient at each step. • Stochastic gradient descent (SGD): Uses a single data point at each step. • Mini-batch gradient descent: Uses a small batch of data points at each step, which is a compromise between the two.
It’s fundamental to training many machine learning models, especially deep learning models.
Inference
Process of using a trained ML model to make predictions or decisions based on new, unseen data
Machine learning
A discipline in computer science where we train machines on data so that they can make predictions without explicit programming
Model
Its a file that contains the logic build based on the training of input and output data provided to it
ML Inference
Phase where fresh input is provided to model to get an output
OR
Process of using a training ML model to make predictions or decisions based on new, unseen data