From the course: Advanced SQL for Data Science: Time Series

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Forecasting with linear regression

Forecasting with linear regression - SQL Tutorial

From the course: Advanced SQL for Data Science: Time Series

Start my 1-month free trial

Forecasting with linear regression

- [Instructor] So, for the most part we've been looking at the past with our time series data. For example, we might have an average temperature, an average CPU utilization and then we look back and try to get an idea what was the average for the trailing hour or day. Sometimes though, we want to predict what's going to happen in the future and we can do that using regression functions. And we're going to work with linear regression and basically the idea is we're going to make predictions based on what we've seen in the past. So to start, I just want to remind everybody from some high school math. The formula for a line is Y = MX + B. M, that's the slope of the line. B, is the Y intercept. X is the input value and Y is the predicted value. So, in our example, let's try and predict the amount of free memory that will be available given a particular CPU utilization. So what we need to do, is we need to calculate the slope and the intercept first. Fortunately, PostgreSQL gives us…

Contents