Skip to content

FIT MODEL

1. FIT MODEL Statement

The "FIT MODEL" statement allows users to retrain a model with new data without having any expertise in data science.

2. FIT MODEL Syntax

query_statement:
    query_expr

FIT MODEL (model_name_expression)
USING (model_name_expression)
OPTIONS (
    expression [ , ...]
    )
AS
(query_expr)

Query Details

  • The "OPTIONS" clause allows you to change the value of a parameter. The definition of each parameter is as follows:
    • "overwrite": determines whether to overwrite a model if it already exists. If set as True, the old model is replaced with the new model (bool, optional, True|False, default: False)

The model_name_expression that comes after "USING" is case sensitive.

3. FIT MODEL Example

Note

  • Examples are specific to one model, and the required option values ​​or the dataset used may differ from model to model. For a detailed description of each model, refer to the ThanoSQL Model Statement Reference
  • Because the example only works when a specific model and dataset are present, it may not run normally if copied and used as is.
%%thanosql
FIT MODEL titanic_automl_classification_fit
USING titanic_automl_classification
OPTIONS (
    target='survived',
    impute_type='iterative',
    features_to_drop=['name', 'ticket', 'passengerid', 'cabin'],
    outlier_method='pca',
    time_left_for_this_task=300,
    overwrite=True
    )
AS
SELECT *
FROM titanic_train

AI Models That Can Be Used with 'FIT MODEL Statement'

  • AutoML Classification model - AutomlClassifier
  • AutoML Regression model - AutomlRegressor
  • ConvNeXT Model - ConvNeXt_Tiny, ConvNeXt_Base
  • EfficientNet Model - EfficientNetV2S, EfficientV2M
  • Albert Model - AlbertKo, AlbertEn
  • Electra Model - ElectraKo, ElectraEn
  • Wav2Vec2 Model - Wav2Vec2Ko, Wav2Vec2En
  • SimCLR Model - SimCLR
  • SBERT Model - SBERTKo, SBERTEn

Last update: 2023-08-09