# 4. Instance-Based versus Model-Based Learning

After machine learning (ML) models are trained on enough data, they are ready to make predictions on unseen data. While some ML models can predict the target aim by comparing the unseen data to the previous data, other ML models derive a mathematical function that enables them to make general predictions without comparing the new data to the trained data. We will call these two broad ML models as instance-based and model-based learning, respectively.

Instance-based learning is a type of machine learning where the model learns from examples and stores them in memory. The model can then make predictions by comparing new input data to the stored examples. One example of an instance-based learning algorithm is k-Nearest Neighbors (k-NN), which works by identifying the k number of closest examples in the stored data to the input data and making a prediction based on the majority of the closest examples. For example, in a medical diagnosis application, k-NN could be used to predict a patient's condition based on the stored records of similar patients' symptoms and diagnosis.

Model-based learning is a type of machine learning where the model learns the underlying relationships and patterns in the data by creating a mathematical representation or a model. This model can then be used to make predictions on new input data. One example of a model-based learning algorithm is linear regression, which is used to model the relationship between a dependent variable and one or more independent variables by fitting a linear equation to the data. For example, in stock market prediction, linear regression could be used to model the relationship between past stock prices and various economic indicators to predict future stock prices.

In summary, instance-based models learn from examples, and make predictions by finding similar examples in the training data, while model-based models learn the underlying relationships and patterns in the data by creating a mathematical representation.

### Instance-Based Learning

Instance-based learning is a type of machine learning where the model learns from examples and stores them in memory. The model can then make predictions by comparing new input data to the stored examples. One example of an instance-based learning algorithm is k-Nearest Neighbors (k-NN), which works by identifying the k number of closest examples in the stored data to the input data and making a prediction based on the majority of the closest examples. For example, in a medical diagnosis application, k-NN could be used to predict a patient's condition based on the stored records of similar patients' symptoms and diagnosis.

### Model-Based Learning

Model-based learning is a type of machine learning where the model learns the underlying relationships and patterns in the data by creating a mathematical representation or a model. This model can then be used to make predictions on new input data. One example of a model-based learning algorithm is linear regression, which is used to model the relationship between a dependent variable and one or more independent variables by fitting a linear equation to the data. For example, in stock market prediction, linear regression could be used to model the relationship between past stock prices and various economic indicators to predict future stock prices.

In summary, instance-based models learn from examples, and make predictions by finding similar examples in the training data, while model-based models learn the underlying relationships and patterns in the data by creating a mathematical representation.

Updated on: 25/01/2023

Thank you!