Summary and Quiz
Revise and test your knowledge of the fundamentals of AI and ML.
We'll cover the following
Congratulations! You’ve learned the fundamentals of artificial intelligence and machine learning. Let's quickly review what we have learned in this chapter and take a short quiz to validate it.
Summary
Let’s quickly summarize the chapter on the fundamentals of artificial intelligence and machine learning:
Neural networks: Neural networks consist of multiple layers of interconnected neurons that process input data through mathematical operations. Important components of a neural network include:
Weights: Weights are values assigned to the connections between the neurons.
Bias: Bias is the value added to the data at a neuron.
Activation functions: Activation functions determine whether a neuron should activate based on its inputs, enabling the model to capture complex, non-linear patterns.
Artificial intelligence is a discipline that aims to create systems capable of performing tasks that usually require human intelligence, such as reasoning, decision-making, and language comprehension. Artificial intelligence has multiple domains:
Machine learning (ML) is a domain of AI that teaches machines to learn from past experiences and data.
Deep learning (DL) is a specialized domain of machine learning that trains neural networks with multiple layers to model complex patterns in data.
Generative AI is a specialized area of ML and DL that focuses on creating new content, such as images, text, and music, by learning patterns from existing data.
Computer vision is a field within AI focused on enabling machines to interpret and understand visual information from images and videos.
Natural language processing (NLP) is an area of AI dedicated to enabling machines to understand, interpret, and generate human language.
Large language models (LLMs) are advanced NLP systems trained on vast amounts of text data, enabling them to generate coherent and contextually relevant text based on input.
Types of data in AI models: In artificial intelligence, the types of data used in training models determine the model’s capabilities and the applications they support.
Labeled data comes with predefined tags or annotations that identify the characteristics or categories of each data point.
Unlabeled data lacks these explicit labels, requiring the AI model to identify patterns or clusters without prior categorization.
Structured data is highly organized and fits neatly into predefined formats like rows and columns, making it ideal for relational databases. Tables are an example of structured data.
Unstructured data doesn’t have a predefined format, making it more challenging to process.
Time series data consists of sequences of data points collected or recorded at specific time intervals, such as hourly stock prices, daily temperature measurements, or monthly sales figures.
Image data refers to visual information stored in pixel form, used in applications that require the model to interpret visual content.
Text data includes written or spoken language, often in the form of documents, chat logs, social media posts, or transcripts.
ML Techniques: There are three primary ML techniques:
Supervised learning: It is a technique where an algorithm is trained on labeled data, meaning each input comes with a corresponding output. We have discussed two types of supervised learning algorithms:
Regression: It is a model that finds a relationship between independent and dependent variables and predicts a continuous value.
Classification: It is a model trained on label data to predict labels of unseen data.
Unsupervised learning: It is a technique where an algorithm finds patterns, similarities, or structures in the data without predefined categories.
Clustering: It is a model trained to find similarities in data and create groups based on the similarities.
Reinforcement learning: It is a type of machine learning where an agent interacts with an environment to maximize cumulative rewards over time.
Phases in ML model: Training of an ML model is a comprehensive multi-stage process. It includes the following main steps:
Data collection: It is the first step of model training involves gathering relevant data that represents the problem the model is expected to solve.
Data preparation: It is the process of cleaning, transforming, and organizing the data to make it suitable for training a model.
Feature engineering: It is the process of creating new features or modifying existing ones to improve model performance. Effective feature engineering can reveal patterns or relationships in the data that the model might otherwise miss.
ML modeling: In the ML modeling phase, a suitable algorithm or model type is selected based on the problem and data characteristics.
Model training: It is the phase where the algorithm learns from the data by adjusting its parameters to minimize the difference between its predictions and the actual outputs in the training data.
Hyperparameter tuning: Hyperparameters are model settings that are not learned from data but instead are set before training begins.
Evaluation: It is the final step in assessing how well the trained model performs on new, unseen data. This phase involves using metrics to gauge the model’s accuracy. We have discussed the following evaluation metrics:
Accuracy is the ratio of the correct number of predictions to the total number.
Precision is used to evaluate the models where the cost of misclassifying a negative instance as positive is high, and we want to decrease the number of false positives.
Recall, also known as sensitivity, is used to evaluate the models where the cost of misclassifying a positive instance as a negative is high, and we want to reduce the number of false negatives.
F1-score is the harmonic mean of the precision and recall. It combines both the views of precision and recall.
Receiver Operating Curve (ROC) is the plot between false positives and true positives. The better the model, the closer the curve to the upper boundary will be.
Area Under the Curve (AUC) is the area under the ROC curve. The better the model, the more will be the area under the curve.
Mean Absolute Error (MAE) is the average of the difference between predicted data points and their ground truth.
Mean Square Error (MSE) is the average of the squares of the difference between predicted data points and their ground truth.
Root Mean Square Error (RMSE) is the square root of Mean Square Error.
Business evaluation metrics quantify how models align with the organizational goals and provide tangible value. We’ve discussed the following business metrics:
Cost per user is the sum of the cost of building, developing, and maintaining an ML model divided by the total number of users.
Development costs are the total expense of developing the ML model.
Customer feedback gathers users’ qualitative and quantitative responses regarding their experience with the ML model’s outputs.
Return on investment measures the profitability of the ML model relative to its costs, expressed as a percentage.
User adoption rate is the percentage of intended users who actively use the ML model after its deployment.
Error in ML models are some challenges machine learning engineers face while designing a precise machine learning model. We’ve discussed the following errors in this chapter:
Bias is the error introduced due to the under-fitted model.
Variance is the error introduced due to the overfitted model.
Fairness is the error introduced when a model favors one class over another.
The goodness of fit shows how a model balances the variance tradeoff and fits the data points to generate accurate predictions.
Inferencing: Inference is the process of using the trained machine learning model to make predictions and generate results. There are two main types of inferencing:
Real-time inferencing: Real-time inferencing takes the input, processes it, and returns the prediction immediately.
Batch inferencing: Batch inferencing takes multiple inputs and generates predictions over time, which are stored in a database.
Test yourself
Let’s take a short quiz to test what we have learned so far.
Get hands-on with 1400+ tech skills courses.