MindsDB
Open Source Product Docs
CREATE MODEL
CREATE MODEL mindsdb.home_rentals FROM example_db (SELECT * FROM demo_data.home_rentals) PREDICT rental_price USING engine = 'lightwood', tag = 'my model';
models
DESCRIBE MODEL home_rentals;
+------------+---------+-------+------+-------+--------+--------+------------+-------------+---------------+------+------------------------------------+---------------------------------------+----------------------+---------------------+------+--------------------------+-------------+ |NAME |ENGINE |PROJECT|ACTIVE|VERSION|STATUS |ACCURACY|PREDICT |UPDATE_STATUS|MINDSDB_VERSION|ERROR |SELECT_DATA_QUERY |TRAINING_OPTIONS |CURRENT_TRAINING_PHASE|TOTAL_TRAINING_PHASES|TAG |CREATED_AT |TRAINING_TIME| +------------+---------+-------+------+-------+--------+--------+------------+-------------+---------------+------+------------------------------------+---------------------------------------+----------------------+---------------------+------+--------------------------+-------------+ |home_rentals|lightwood|mindsdb|true |1 |complete|0.999 |rental_price|up_to_date |22.11.3.2 |[NULL]|SELECT * FROM demo_data.home_rentals|{'target': 'rental_price', 'using': {}}|5 |5 |[NULL]|2024-02-07 16:01:04.990958|19.946 | +------------+---------+-------+------+-------+--------+--------+------------+-------------+---------------+------+------------------------------------+---------------------------------------+----------------------+---------------------+------+--------------------------+-------------+
RETRAIN
RETRAIN mindsdb.home_rentals;
+------------+---------+-------+------+-------+--------+--------+------------+-------------+---------------+------+------------------------------------+---------------------------------------+----------------------+---------------------+------+--------------------------+-------------+ |NAME |ENGINE |PROJECT|ACTIVE|VERSION|STATUS |ACCURACY|PREDICT |UPDATE_STATUS|MINDSDB_VERSION|ERROR |SELECT_DATA_QUERY |TRAINING_OPTIONS |CURRENT_TRAINING_PHASE|TOTAL_TRAINING_PHASES|TAG |CREATED_AT |TRAINING_TIME| +------------+---------+-------+------+-------+--------+--------+------------+-------------+---------------+------+------------------------------------+---------------------------------------+----------------------+---------------------+------+--------------------------+-------------+ |home_rentals|lightwood|mindsdb|true |1 |complete|0.999 |rental_price|up_to_date |22.11.3.2 |[NULL]|SELECT * FROM demo_data.home_rentals|{'target': 'rental_price', 'using': {}}|5 |5 |[NULL]|2024-02-07 16:01:04.990958|19.946 | |home_rentals|lightwood|mindsdb|true |2 |complete|0.999 |rental_price|up_to_date |22.11.3.2 |[NULL]|SELECT * FROM demo_data.home_rentals|{'target': 'rental_price', 'using': {}}|5 |5 |[NULL]|2024-02-07 17:01:04.990958|21.923 | +------------+---------+-------+------+-------+--------+--------+------------+-------------+---------------+------+------------------------------------+---------------------------------------+----------------------+---------------------+------+--------------------------+-------------+
SELECT * FROM mindsdb.home_rentals AS p JOIN example_db.demo_data.home_rentals AS d;
SELECT * FROM mindsdb.home_rentals.1 AS p JOIN example_db.demo_data.home_rentals AS d;
SET model_active = home_rentals.1;
DROP MODEL home_rentals.2
DROP MODEL
DROP MODEL mindsdb.home_rentals;
Was this page helpful?