class_docstr: Intent classifier using the sklearn framework.
class_docstr_tok: ["Intent","classifier","using","the","sklearn","framework","."]
code: def _create_classifier(
      self, num_threads: int, y: np.ndarray
  ) -> "sklearn.model_selection.GridSearchCV":
      from sklearn.model_selection import GridSearchCV
      from sklearn.svm import SVC
  
      C = self.component_config["C"]
      kernels = self.component_config["kernels"]
      gamma = self.component_config["gamma"]
      # dirty str fix because sklearn is expecting
      # str not instance of basestr...
      tuned_parameters = [
          {"C": C, "gamma": gamma, "kernel": [str(k) for k in kernels]}
      ]
  
      # aim for 5 examples in each fold
  
      cv_splits = self._num_cv_splits(y)
  
      return GridSearchCV(
          SVC(C=1, probability=True, class_weight="balanced"),
          param_grid=tuned_parameters,
          n_jobs=num_threads,
          cv=cv_splits,
          scoring=self.component_config["scoring_function"],
          verbose=1,
      )
  
imports: from __future__ import annotations
  import logging
  from rasa.nlu.featurizers.dense_featurizer.dense_featurizer import DenseFeaturizer
  import typing
  import warnings
  from typing import Any, Dict, List, Optional, Text, Tuple, Type
  import numpy
  import rasa.shared.utils.io
  import rasa.utils.io
  from rasa.engine.graph import GraphComponent, ExecutionContext
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.shared.constants import DOCS_URL_TRAINING_DATA_NLU
  from rasa.nlu.classifiers import LABEL_RANKING_LENGTH
  from rasa.shared.exceptions import RasaException
  from rasa.shared.nlu.constants import TEXT
  from rasa.nlu.classifiers.classifier import IntentClassifier
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.utils.tensorflow.constants import FEATURIZERS
label_desc: Use image node_id 11 for calling the SklearnIntentClassifier obj's underlying member method code with example usage: obj._create_classifier(num_threads, y) and returns: GridSearchCV