Tesla's mission is to accelerate the world's transition to sustainable energy. It was founded in 2003 by a group of engineers. They wanted to prove that people didn't need to compromise to drive electric cars. Meaning, electric vehicles can be better, quicker, and more fun to drive than gasoline or diesel-based cars.
Dataset for Tesla Stock Price Prediction
Our goal is to predict the future stock price, based on historical data. It is easy to pull historical prices from publicly available sources. We pulled data for the past 365 days from Yahoo! finance.
Here is historical data, from 2020-01-01 - 2022-09-01:
We can clearly see all ups and downs in price dynamics.
Let's use this dataset to predict what will the stock price be in the next 365 days. We will start by uploading the dataset into Graphite Note.
In a few mouse clicks, we imported and parsed a CSV file that we previously downloaded from Yahoo! finance. These are the dataset columns:
We can browse through our dataset rows, filter, or search on the View Data tab. We have seven columns and 673 rows. Since we downloaded more days, it is clear that some dates are missing from the dataset. Graphite's time series Model is built to handle missing dates pretty well.
Every uploaded dataset will have a practical Summary tab. It enables, at a glance, to check distributions of numeric columns, the number of null values, and different statistical measures. For example, we can spot that for the closing price (CLOSE column), most dates (157 dates) belong to a bin with price CLOSE values from 217 to 256.
We will use the CLOSE column for our prediction - it is our target column.
It is the last trading price recorded when the market closed on the day.
Time series Forecast
Predicting Stock prices is a great use case of machine learning both for financial time series analysis. You can read more about the time series forecast here. In short, time series forecasting is looking at recorded data over time to forecast or predict what might happen in the next time period, under the assumption that future trends will be similar to historical trends.
That being said, don't use the results here as financial advice. This exercise should only be used to demonstrate the power of no-code machine learning to predict time-series datasets. Machine learning models can only "learn" what we feed them - and in this case, that is a historical pattern.
Time series Forecast Model in Graphite
Now we have our dataset ready, we are ready to create a no-code machine learning model in Graphite. We chose the Timeseries Forecast model:
In Graphite, to build a time series model, you need only 2 columns
a target column (what are we predicting?)
a date column (with dates, weeks, months, ...)
And that is all.
In the next few mouse clicks, we will define a model Scenario.
Selecting Target column from our dataset:
Selecting date column from the dataset, with the desired forecast horizon of 365 days:
Run the ML Model - Tesla Stock Price Prediction
We will leave all other options on default and run this scenario. Graphite will take a sample of 80% of our data and train several machine learning models. Then, it will test those models on the remaining 20% and calculate relevant model scores. The details about the final best model fit, seasonality, trends, results, and predictions will be available on the Results tab.
After a few seconds, we have our results. On the model fit tab Graphite will show historical data in blue, and predicted data in yellow.
We have our prediction for the next 365 days immediately ready at our disposal. For example, Graphite predicted a price of 353.64 on 2022-12-24.
We can now examine further analysis to understand the model and model fit better. A clear changepoint in global trend was detected in the data during November 2021. We also see the details about minimum and maximum data points:
It is always interesting to see what seasonality was detected in historical data. This kind of information can be very valuable in eCommerce and Retail as well, for example.
In our case, there are 2 seasonal patterns detected - weekly and yearly seasonality.
Based on training the model on the historical data of TSLA stock prices, it seems that the highest closing prices occur on Saturdays and Sundays, and the lowest is on Fridays.
Moreover, the price seems to be highest in January, and lowest in June - regarding yearly seasonality detected.
But bear in mind that we had only less than three years worth of data - so that is not a piece of very reliable information. If we trained the model on 5, 6 years of data - then yearly seasonality will have a much bigger weight.
Graphite also tried to detect if USA holidays had any correlation with prices going up or down.
It is potentially exciting information that on 11 Nov (Veteran's day), it detected the most significant negative impact on the price. The last day of the year has the most important positive effects for the price.
I hope that this helped you understand how easy it is to train models in a no-code machine learning software like Graphite Note. With just a few mouseclicks, we were able to predict the stock price, and analyze seasonality, trends, and patterns in data.
You can explore all other Models here. Feel free to train your own machine learning model on any dataset with the same ease, or schedule a demo if you need any help or have any questions.
Strictly Necessary Cookies
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
3rd Party Cookies
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!