The retrain()
function retrains the model, for example, if new version of MindsDB is available.
Syntax
Use the retrain()
method to retrain a model:
/**
* Call retrain of the model
*
* @param query SQL string to get data for retraining, optional
* @param database Database to get data for retraining, optional
* @param options Parameters for retraining model, optional
* @param engine ML engine, optional
* @return Model object
*/
public Model retrain(String query, String database, Map<String, String> options, String engine);
Example
Model homeRentalsModel = mindsdb.getModel("home_rentals_model");
homeRentalsModel.retrain(null,null,null,null);
// or
homeRentalsModel.retrain("SELECT * FROM home_rentals limit 10;","example_db",null,null);