class_docstr: Implementation of Scikit-learn interface for xlearn models.
  
  :param model_type: one of 'lr', 'fm', 'ffm'
  :param task: 'binary' for classification or 'reg' for regression
  :param metric: 'acc', 'prec', 'recall', 'f1', 'auc' for classification,
      and 'mae', 'mape', 'rmsd (rmse)' for regression.
  :param log: location of log
  :param lr: learning rate
  :param k: latent factor for factorization
  :param reg_lambda: alias for lambda
  :param init: initial value
  :param fold: number of fold used in cross validation
  :param epoch: number of training epoch
  :param stop_window: window size for early stopping
  :param opt: optimizer option, one of 'sgd', 'adagrad', 'ftrl'
  :param nthread: number of threads (Deprecated, please use n_jobs)
  :param n_jobs: number of threads used to run xlearn.
  :param block_size: block size for on-disk training.
  :param alpha: alpha for FTRL
  :param beta: beta for FTRL
  :param lambda_1: lambda_1 for FTRL
  :param lambda_2: lambda_2 for FTRL
  :param kwargs: extra input arguments
class_docstr_tok: ["Implementation","of","Scikit-learn","interface","for","xlearn","models",".",":","param","model_type",":","one","of","'lr","'",",","'fm","'",",","'ffm'",":","param","task",":","'binary","'","for","classification","or","'reg","'","for","regression",":","param","metric",":","'acc","'",",","'prec","'",",","'recall","'",",","'f1","'",",","'auc","'","for","classification",",","and","'mae","'",",","'mape","'",",","'rmsd","(","rmse",")","'","for","regression",".",":","param","log",":","location","of","log",":","param","lr",":","learning","rate",":","param","k",":","latent","factor","for","factorization",":","param","reg_lambda",":","alias","for","lambda",":","param","init",":","initial","value",":","param","fold",":","number","of","fold","used","in","cross","validation",":","param","epoch",":","number","of","training","epoch",":","param","stop_window",":","window","size","for","early","stopping",":","param","opt",":","optimizer","option",",","one","of","'sgd","'",",","'adagrad","'",",","'ftrl'",":","param","nthread",":","number","of","threads","(","Deprecated",",","please","use","n_jobs",")",":","param","n_jobs",":","number","of","threads","used","to","run","xlearn",".",":","param","block_size",":","block","size","for","on-disk","training",".",":","param","alpha",":","alpha","for","FTRL",":","param","beta",":","beta","for","FTRL",":","param","lambda_1",":","lambda_1","for","FTRL",":","param","lambda_2",":","lambda_2","for","FTRL",":","param","kwargs",":","extra","input","arguments"]
code: def __init__(
      self,
      model_type="fm",
      task="binary",
      metric="auc",
      block_size=500,
      lr=0.2,
      k=4,
      reg_lambda=0.1,
      init=0.1,
      fold=1,
      epoch=5,
      stop_window=2,
      opt="sgd",
      nthread=None,
      n_jobs=4,
      alpha=1,
      beta=1,
      lambda_1=1,
      lambda_2=1,
      seed=1,
      **kwargs,
  ):
      self.model_type = model_type
      self.task = task
      self.metric = metric
      self.lr = lr
      self.k = k
      self.reg_lambda = reg_lambda
      self.init = init
      self.fold = fold
      self.epoch = epoch
      self.opt = opt
      self.nthread = nthread
      self.n_jobs = n_jobs
      self.stop_window = stop_window
      self.alpha = alpha
      self.beta = beta
      self.lambda_1 = lambda_1
      self.lambda_2 = lambda_2
      self.kwargs = kwargs
      self.block_size = block_size
      self.seed = seed
  
      # initialize internal structure
      self._XLearnModel = None
      self._temp_model_file = tempfile.NamedTemporaryFile(delete=False)
      self._temp_weight_file = tempfile.NamedTemporaryFile(delete=False)
      self.weights = None
      self.fields = None
  
imports: import os
  import shutil
  import tempfile
  import warnings
  import numpy
  from .xlearn import create_linear, create_fm, create_ffm
  from .data import DMatrix
  from sklearn.base import BaseEstimator
  from sklearn.utils import check_array, check_X_y
label_desc: Use image node_id 1 to create a new BaseXLearnModel object from inherited base classes: BaseEstimator with example: obj = BaseXLearnModel(model_type, task, metric, block_size, lr, k, reg_lambda, init, fold, epoch, stop_window, opt, nthread, n_jobs, alpha, beta, lambda_1, lambda_2, seed)