docstr: ```
  train a classifier
  Args:
    x_train(list or np.ndarray):  training texts
    y_train(np.ndarray):  training labels
    ctype(str):  One of {'logreg', 'nbsvm', 'sgdclassifier'}.  default:nbsvm
  ```
docstr_tok: ["``","`","train","a","classifier","Args",":","x_train","(","list","or","np.ndarray",")",":","training","texts","y_train","(","np.ndarray",")",":","training","labels","ctype","(","str",")",":","One","of","{","'logreg","'",",","'nbsvm","'",",","'sgdclassifier","'","}",".","default",":","nbsvm","``","`"]
code: def fit(self, x_train, y_train, ctype="logreg"):
      """
      ```
      train a classifier
      Args:
        x_train(list or np.ndarray):  training texts
        y_train(np.ndarray):  training labels
        ctype(str):  One of {'logreg', 'nbsvm', 'sgdclassifier'}.  default:nbsvm
      ```
      """
      lang = U.detect_lang(x_train)
      if U.is_chinese(lang):
          x_train = U.split_chinese(x_train)
      if self.model is None:
          self.create_model(ctype, x_train)
      self.model.fit(x_train, y_train)
      return self
  
imports: from .None import utils
  from .imports import *
label_desc: Use image node_id 5 for calling the Classifier obj's underlying member method code with example usage: obj.fit(x_train, y_train, ctype) and returns: self