Many people don't have a clear idea of the difference between an algorithm and a model. In this video, learn what an algorithm and model are.
- [Instructor] In this first lesson of the foundations chapter, we're going to talk through some terminology. The terms model and algorithm are frequently used interchangeably, when they really shouldn't be. In this lesson, we'll walk through defining each of them, talk through how they're different, and then we'll explore an example to see what all this means more concretely. We'll start with algorithm. An algorithm is a mathematical technique or equation. In other words, it's some sort of framework, but it's not concrete. It will have some parameters, but those parameters have not been assigned an actual value. We'll see an example of this in just a minute. Conversely, a model is concrete. It's an equation where those parameters have been filled by values that are learned from the data. We'll look at an example as we'll walk through an algorithm on the left, and model on the right. Now, you might be familiar with the equation of a line. It's just y equals mx plus b, where m is the slope of the line, and b is the y intercept of the line. This is a linear regression algorithm. We have open parameters that have not been assigned a value yet. M and b are our open parameters here, but we would need some values learned from data in order for this to become a concrete model. Let's move over to the model section. Now, if we use this example of linear regression, we have a plot of rainfall versus umbrellas sold. And then we have this red best-fit line that we could use as an actual model to make a prediction about the number of umbrellas sold based on the amount of rainfall. For instance, if it were to rain 110 millimeters, we could say that the model would predict that 30 umbrellas would be sold. This line was learned from data and this line also has a concrete equation. That equation is y equals 0.45x minus 19. Now we've used this data to assign values to our open parameters m and b. We've gone from the linear regression algorithm of y equals mx plus b, to this model of y equals 0.45x minus 19. This model's fit to the data, and can be used to make predictions. Just to recap, algorithms are equations or frameworks. Algorithms become concrete models once you assign values to the parameters by learning from data.
- Models vs. algorithms
- Cleaning continuous and categorical variables
- Tuning hyperparameters
- Pros and cons of logistic regression
- Fitting a support vector machines model
- When to consider using a multilayer perceptron model
- Using the random forest algorithm
- Fitting a basic boosting model