From the course: Advanced Python in Excel: Machine Learning

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Solution: Create a financial forecast

Solution: Create a financial forecast

(lively upbeat music) - [Instructor] Let's work together through the solution to our financial forecasting challenge. As always, we begin this challenge by importing the dataset with the function "xl". Then, in a separate cell, we started the code, but imported the necessary libraries, so Pandas, NumPy, Scikit-learn, and Matplotlib. Then, we convert the month column to datetime and create a new column for the numeric representation of this date. We prepared the features X, so the month number and the target of revenue, and we initialized and fit the machine learning model, in this case, linear regression. We created future dates for the next year and started to predict the future revenue. We store this future revenue into a new data frame that we create and then we plotted the results using Matplotlib. As you can see, the blue line in this graph is the historical revenue, and then the orange one is the forecasted revenue. Remember that there are multiple ways that you can solve this…

Contents