class_docstr: Implements the quantile regression model.
  
  Supports weighted sample, l1 regularization
  and weighted l1 regularization.
  These options can be configured to support different use cases.
  For example, specifying quantile to be 0.5 and sample weight to be the
  inverse absolute value of response minimizes the MAPE.
class_docstr_tok: ["Implements","the","quantile","regression","model",".","Supports","weighted","sample",",","l1","regularization","and","weighted","l1","regularization",".","These","options","can","be","configured","to","support","different","use","cases",".","For","example",",","specifying","quantile","to","be","0.5","and","sample","weight","to","be","the","inverse","absolute","value","of","response","minimizes","the","MAPE","."]
docstr: Fits the quantile regression model.
  
  Parameters
  ----------
  X : `numpy.array`, `pandas.DataFrame` or `pandas.Series`
      The design matrix.
  y : `numpy.array`, `pandas.DataFrame` or `pandas.Series`
      The response vector.
  
  Returns
  -------
  self
docstr_tok: ["Fits","the","quantile","regression","model",".","Parameters","--","--","--","--","--","X",":","`","numpy.array","`",",","`","pandas.DataFrame","`","or","`","pandas.Series","`","The","design","matrix",".","y",":","`","numpy.array","`",",","`","pandas.DataFrame","`","or","`","pandas.Series","`","The","response","vector",".","Returns","--","--","--","-","self"]
code: def fit(
      self, X: np.typing.ArrayLike, y: np.typing.ArrayLike
  ) -> QuantileRegression:
      """Fits the quantile regression model.
  
      Parameters
      ----------
      X : `numpy.array`, `pandas.DataFrame` or `pandas.Series`
          The design matrix.
      y : `numpy.array`, `pandas.DataFrame` or `pandas.Series`
          The response vector.
  
      Returns
      -------
      self
      """
      x, y = self._process_input(X, y)
  
      # Unregularized version. Solved with IRLS.
      if self.alpha == 0:
          beta = ordinary_quantile_regression(
              x=x,
              y=y,
              q=self.quantile,
              sample_weight=self.sample_weight,
              max_iter=self.max_iter,
              tol=self.tol,
          )
          if self.fit_intercept:
              self.intercept_ = beta[0]
              self.coef_ = np.zeros(self.p)
              self.coef_[self.nonconstant_cols] = beta[1:]
          else:
              self.intercept_ = 0
              self.coef_ = beta
      else:
          coefs = l1_quantile_regression(
              x=x,
              y=y,
              q=self.quantile,
              alpha=self.alpha,
              sample_weight=self.sample_weight,
              feature_weight=self.feature_weight,
              include_intercept=self.fit_intercept,
          )
          self.intercept_ = coefs["intercept"]
          self.coef_ = coefs["coef"]
      return self
  
imports: from __future__ import annotations
  from typing import Dict
  from typing import Optional
  import cvxpy
  import numpy
  import pandas
  import scipy
  from sklearn.base import BaseEstimator
  from sklearn.base import RegressorMixin
  from greykite.algo.common.partial_regularize_regression import constant_col_finder
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.logging import log_message
label_desc: Use image node_id 3 for calling the QuantileRegression obj's underlying member method code with example usage: obj.fit(X, y) and returns: self