Model Train and Finetune#

  1. You can train a predication model easily in EvaDB

Note

Install Ludwig in your EvaDB virtual environment: pip install evadb[ludwig].

CREATE UDF IF NOT EXISTS PredictHouseRent FROM
( SELECT sqft, location, rental_price FROM HomeRentals )
TYPE Ludwig
'predict' 'rental_price'
'time_limit' 120;

In the above query, you are creating a new customized UDF by automatically training a model from the HomeRentals table. The rental_price column will be the target column for predication, while sqft and location are the inputs.

You can also simply give all other columns in HomeRentals as inputs and let the underlying automl framework to figure it out. Below is an example query:

CREATE UDF IF NOT EXISTS PredictHouseRent FROM
( SELECT * FROM HomeRentals )
TYPE Ludwig
'predict' 'rental_price'
'time_limit' 120;

Note

Check CREATE UDF via Training for available configurations for training models.

  1. After training completes, you can use the PredictHouseRent like all other UDFs in EvaDB

CREATE PredictHouseRent(sqft, location) FROM HomeRentals;

Check out our Integration Tests for working example.