DEV Community

Vivek Shah
Vivek Shah

Posted on

Using MindsDB to Predict Microsoft Stock Prices

Ever wanted to be the Oracle like the Delphic one and use it to predict stocks in your portfolio? Can't take to the past but with MindsDB you could take a shot at predicting the future via this simple tutorial.

What is MindsDB?

MindsDB is a SQL-based tool that can be used to create and train time-series machine learning models directly from your database. With MindsDB, data teams and data analysts can use their data to build, train, optimize, and deploy machine learning models that provide meaningful insights for real-world problems.

Delphi Oracle
img source
Setup
Start off with you using the MindsDB Cloud Editor (create your free MindsDB Cloud account here) to create and train your time series prediction model.

Get your Dataset
Download data set from Kaggle for our demo to work with Microsoft stock prices :

Kaggle Data set

Upload your file into MindsDB
You can either load from a database or a file. We'll go with file in this demo.
MindsDB Data Load

Check your data
Sanity check your data loads up fine with a simple select query. You can use limit to have only a few records load.

Select data

Create a Predictor Model
Tap in the following syntax to get MindsDB to kick off the predictor model. Depending on the volume of data, this could take some time and you might see a "training" error if you query earlier than it is completed.
Predictor Kicked off

Data Insights
You can also quickly glean at the data insights generated visually to give you a quick look into the trends for the data sets you have pulled in.
Data Insights

Run a Query for an extrapolated Dates to see the magic
Since our data set is till July 2022, let's try a more recent date like 30th October 2022

Final results

With that last step, we have successfully created and trained Using historical data, we can easily try to predict the future. Hopefully my stock broker ain't reading this.

MindsDB makes machine learning simple, intuitive, and extremely effective! Do you have something interesting you’d like to forecast? Head to MindsDB and start training your model today!

Top comments (1)

Collapse
 
funnyworld profile image
funnyworld

Is this a joke? 26$ predicted on Oct-2022