

What I mean, is that for the most part, R libraries and functions perform the mathematical calculations for you. To be clear, there is quite a bit of math involved in machine learning, but most of that math is taken care of for you. Ok, here is some good news: to implement basic machine learning techniques, you don’t need to know much math. What I just wrote in the last few paragraphs about “estimating functions” and “mathematical relationships” might cause you to ask a question: “how much math do I need to know to do machine learning?” Ultimately, once we have this mathematical function (a model), we can use that model to make predictions and inferences. Said differently, machine learning provides a set of computational methods that accept data observations as inputs, and subsequently estimate that mathematical function, machine learning methods learn the relationship by being trained with an input dataset. In the case of the above example, we’ll be making the assumption that “miles per gallon” can be described as a function of “car weight”.Īssuming this type of mathematical relationship, machine learning provides a set of methods for identifying that relationship. So, as we press forward in our analysis, we’ll make the assumption that this relationship can be described mathematically more precisely, we’ll assume that this relationship can be described by some mathematical function. But if we want to make more precise claims about the relationship between wt and mpg, we need to specify this relationship mathematically. Just examining the data visually, it’s pretty clear that there’s some relationship. Ggplot(data = mtcars, aes(x = wt, y = mpg)) + To answer this question, you could obtain a dataset with several different car models, and attempt to identify a relationship between weight (which we’ll call wt) and miles per gallon (which we’ll call mpg).Ī good starting point would be to simply plot the data, so first, we’ll create a scatterplot using R’s ggplot: Imagine that you want to understand the relationship between car weight and car fuel efficiency (I.e., miles per gallon) how is fuel efficiency effected by a car’s weight? Without going into extreme depth here, let’s unpack that by looking at an example. Machine learning is the study of data-driven, computational methods for making inferences and predictions. We’ll build a very simple machine learning model as a way to learn some of caret’s basic syntax and functionality.īut before diving into caret, let’s quickly discuss what machine learning is and why we use it. To help you begin learning about machine learning in R, I’m going to introduce you to an R package: the caret package. If you’ve been using R for a while, and you’ve been working with basic data visualization and data exploration techniques, the next logical step is to start learning some machine learning.
