0% found this document useful (0 votes)
10 views2 pages

MindsDB Files and Home Rentals Guide

MindsDB includes a filesystem database called 'files' where uploaded files are stored as tables, allowing for SQL queries and model creation. Users can create models to predict outcomes based on data from these tables, such as flower variety and rental prices. The document provides examples of SQL commands for querying data, creating models, and making predictions.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

MindsDB Files and Home Rentals Guide

MindsDB includes a filesystem database called 'files' where uploaded files are stored as tables, allowing for SQL queries and model creation. Users can create models to predict outcomes based on data from these tables, such as flower variety and rental prices. The document provides examples of SQL commands for querying data, creating models, and making predictions.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

--- MindsDB ships with a filesystem database called 'files'

--- Each file you uploaded is saved as a table there.


---
--- You can always check the list tables in files as follows:

SHOW TABLES FROM files;

--- These files can be queried as tables,


--- You just uploaded datairis21

SELECT * FROM files.datairis21 LIMIT 10;

CREATE MODEL
[Link].datairis21
FROM files
(SELECT [Link], [Link], [Link], [Link], variety
* FROM files.datairis21)
PREDICT variety;

SELECT *
FROM mindsdb.datairis21
WHERE name='datairis21';

DESCRIBE [Link];

--- Make Prediction

SELECT variety
FROM mindsdb.datairis21
WHERE [Link] = 5
AND [Link]=3
AND [Link]=1
AND [Link]=0.2;

SELECT [Link] as real_variety,


[Link] as predicted_variety,
[Link], [Link], [Link], [Link],
[Link]
FROM [Link] as t
JOIN [Link].datairis2l as m limit 100;
Data rental price

CREATE DATABASE example_db


WITH ENGINE = "postgres",
PARAMETERS = {
"user": "demo_user",
"password": "demo_password",
"host": "[Link]",
"port": "5432",
"database": "demo"
};
SELECT *
FROM example_db.demo_data.home_rentals
LIMIT 10;
CREATE MODEL
mindsdb.home_rentals_model
FROM example_db
(SELECT * FROM demo_data.home_rentals)
PREDICT rental_price;
SELECT *
FROM [Link]
WHERE name='home_rentals_model';

DESCRIBE mindsdb.home_rentals_model.model;

SELECT rental_price,
rental_price_explain
FROM mindsdb.home_rentals_model
WHERE sqft = 823
AND location='good'
AND neighborhood='downtown'
AND days_on_market=10;

SELECT t.rental_price as real_price,


m.rental_price as predicted_price,
t.number_of_rooms, t.number_of_bathrooms, [Link], [Link],
t.days_on_market
FROM example_db.demo_data.home_rentals as t
JOIN mindsdb.home_rentals_model as m limit 100;

You might also like