42
loading...
This website collects cookies to deliver better user experience
MindsDB is a predictive platform that makes databases intelligent and machine learning easy to use. It allows data analysts to build and visualize forecasts in BI dashboards without going through the complexity of ML pipelines, all through SQL. It also helps data scientists to streamline MLOps by providing advanced instruments for in-database machine learning and optimize ML workflows through a declarative JSON-AI syntax.
.csv
file that contains 9 columns:holiday
: Categorical US National holidays plus regional holiday, Minnesota State Fairtemp
: Numeric Average temp in kelvin
rain_1h
: Numeric Amount in mm of rain that occurred in the hoursnow_1h
: Numeric Amount in mm of snow that occurred in the hourclouds_all
: Numeric Percentage of cloud coverweather_main
: Categorical Short textual description of the current weatherweather_description
: Categorical Longer textual description of the current weatherdate_time
: DateTime Hour of the data collected in local CST timetraffic_volume
: Numeric Hourly I-94 ATR 301 reported westbound traffic volumemindsdb
and within it a new database cluster named mindsDB
. Typically, it takes a minute or two to provision a cluster. Once it is done, you should have something like this:
mongodb+srv://<username>:<password>@mindsdb.htuqc.mongodb.net/
mindsDB
and a collection named data
.
mindsDB
listed. Click on it and you will see that it contains a collection named data
. We will be loading data from the .csv
file into this collection. Open the data
collection by clicking on it.
.csv
file. You will now be able to preview your dataset and also assign the data types as shown below. Then, "import" the dataset and wait for a few seconds for the import to finish.
Enter the required details as shown below. The connection string must be similar to:
mongodb+srv://<username>:<password>@mindsdb.htuqc.mongodb.net/mindsDB
Click on "Connect" and that's it! We have successfully linked our Database to MindsDB.
Next, head over to the Datasets tab and click on "From database".
Enter the details as shown below. In the Find field, we can specify a Mongo query using which MindsDB will include only the results of this query in the data source. By specifying {}
, we are telling MindsDB to include every single document in the data
collection in the data source.
Click on "Create" and now we will see that our data source named "Metro Traffic Dataset" has been added. One can check for the quality and also preview the data source.
We are now ready to train an ML model to predict the traffic_volume
using MindsDB.
traffic_volume
.
traffic_volume
.
Let's say we wanted to know the traffic_volume
for some day and all we know is the following:
{
temp: 300, # temperature of 300 Kelvin
clouds_all: 10, # 10% cloud cover
weather_main: "Clouds",
weather_description: "few clouds",
holiday: "None"
}
We can see that the model predicted with 99% confidence that on such a day, the traffic volume would be 832.
traffic_volume
what is the probability the sky is clear ☀️? What is the probability that it is raining? 🌧️traffic_volume
, how certain can we be that the day is a holiday? 🏖️traffic_volume
? 🤔