code: def choose_model_type(
      training_df,
      model_type=None,
      target=None,
      supervised_threshold=3000,
  ):
      """Choose the model type based on the presence of labels and size of the dataset"""
      if model_type is None:
          if target is None:
              model_type = "unsupervised"
          else:
              model_type = (
                  "supervised"
                  if len(training_df) > supervised_threshold
                  else "semi-supervised"
              )
      assert model_type in [
          "supervised",
          "semi-supervised",
          "unsupervised",
      ], "model type must be 'supervised', 'semi-supervised', or 'unsupervised'"
      return model_type
  
imports: from mindsdb.integrations.libs.base import BaseMLEngine
  import pandas
  from mindsdb.integrations.handlers.anomaly_detection_handler.utils import train_unsupervised, train_supervised, train_semisupervised
  from joblib import dump, load
  from pyod.models.ecod import ECOD
  from pyod.models.xgbod import XGBOD
  from catboost import CatBoostClassifier
  from pyod.models.lof import LOF
  from pyod.models.knn import KNN
  from pyod.models.pca import PCA
  from xgboost import XGBClassifier
  from sklearn.naive_bayes import GaussianNB
  import numpy
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: choose_model_type(training_df, model_type, target, supervised_threshold) and returns: model_type