AI Tables
Let’s consider the following income_table
table that stores the income
and
debt
values.
On execution, we get:
A simple visualization of the data present in the income_table
table is as
follows:
Querying the income table to get the debt
value for a particular income
value results in the following:
On execution, we get:
And here is what we get:
But what happens when querying the table for an income
value that is not
present there?
On execution, we get:
When the WHERE
clause condition is not fulfilled for any of the rows, no
value is returned.
When a table doesn’t have an exact match, the query returns an empty set or null value. This is where the AI Tables come into play!
Let’s create a debt_model
model that allows us to approximate the debt
value
for any income
value. We train the debt_model
model using the data from the
income_table
table.
On execution, we get:
MindsDB provides the CREATE MODEL
statement. On execution of this statement, the predictive model works in the
background, automatically creating a vector representation of the data that can
be visualized as follows:
Please note that debt_model
is our AI Table.
Let’s now look for the debt
value of some random income
value. To get the
approximated debt
value, we query the mindsdb.debt_model
model instead
of the income_table
table.
On execution, we get:
And here is how it looks: