// Getting an existing model
const homeRentalPriceModel = await MindsDB.Models.getModel('home_rentals_model', 'mindsdb');
// Checking the status and retraining a model if required
if (homeRentalPriceModel.updateStatus === 'available') {
try {
// For custom retraining: homerentalPriceModel.retrain('example_db', trainingOptions);
await homeRentalPriceModel.retrain();
console.log('retrained a model');
} catch (error) {
// Something went wrong with retraining
console.log(error);
}
}