Home  >  Article  >  Technology peripherals  >  Understanding artificial intelligence tables in one article: starting with MindsDB

Understanding artificial intelligence tables in one article: starting with MindsDB

WBOY
WBOYforward
2023-04-12 12:04:021516browse

This article is reproduced from the WeChat public account "Living in the Information Age". The author lives in the information age. To reprint this article, please contact the Living in the Information Age public account.

For students who are familiar with database operations, writing beautiful SQL statements and finding ways to find the data they need from the database is a routine operation.

For students who are familiar with machine learning, it is also a matter of obtaining data, preprocessing the data, building a model, determining the training set and test set, and using the trained model to make a series of predictions about the future. It's a routine operation.

So, can we combine the two technologies? We see that data is stored in the database, and predictions need to be based on past data. If we query future data through the existing data in the database, is it feasible?

Based on this idea, MindsDB was born.

Understanding artificial intelligence tables in one article: starting with MindsDB

MindsDB is a tool for bringing machine learning to existing SQL databases, connecting data and models. It integrates machine learning models into virtual tables in the database through artificial intelligence tables (AI-Tables), so that predictions can be created and queries can be made using simple SQL statements. Time series, regression, and classification forecasting can be performed directly in the database almost instantly.

With the development of information technology, many industries are slowly changing from "what happened and why it happened" based on historical data analysis to "what we predict will happen and how to make it happen" based on machine learning predictive models. change. MindsDB is a tool to achieve this goal.

MindsDB can perform modeling directly in the database, eliminating the headache of data processing, building machine learning models and other steps. Data analysts and business analysts don't need to know too much about data engineering or modeling to use it out of the box.

So, let’s take a look at how MindsDB implements such an operation.

For example, we have a data table that stores data on housing prices and GDP in a city. Then, if we want to query housing prices and GDP. You can query using SQL similar to the following:

select gdp, houseprice from city;

Then, we can see that GDP and housing prices may have a linear relationship. If we want to query the housing price corresponding to a certain GDP value, we can write

select gdp, houseprice from city where gdp=10000;

. However, what if the GDP data being queried does not exist in the database, then obviously the query result cannot be obtained.

At this time, the artificial intelligence table appears.

We can first create a housing price prediction model:

create predictor mindsdb.price_model from city predict houseprice;

In this way, MindsDB will automatically create the model in the background. At this time, we can use this model to query the predicted housing price corresponding to GDP data that is not in the database.

select houseprice from mindsdb.price_model where gpd=20000;

In this way, we will get the model prediction value based on historical data.


Understanding artificial intelligence tables in one article: starting with MindsDB


The above is the detailed content of Understanding artificial intelligence tables in one article: starting with MindsDB. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:51cto.com. If there is any infringement, please contact admin@php.cn delete