docstr: QRX is an algorithm that takes a point estimate algorithm and turns it
  into a probabilistic forecasting algorithm. By default it uses XGBoost.
  
  You fit it once, and choose the quantile to predict only at
  prediction time.
  
  Prediction is done by taking empirical quantiles of *true values*
  associated with point estimate predictions close to the point
  estimate of the given point. The minimal number of associated true
  values is determined by min_bin_size.
  
  The algorithm is (loosely) inspired by quantile regression
  forests, in that it is predicts quantiles based on associated true
  values, where the association is based on a point estimate algorithm.
  
  Parameters
  ----------
  model
      Any point estimate algorithm with .fit and .predict functions.
  xgboost_params
      If None, then it uses
      {"max_depth": 5, "n_jobs": -1, "verbosity": 1,
       "objective": "reg:squarederror"}
  min_bin_size
      Hyperparameter that determines the minimal size of the list of
      true values associated with each prediction.
docstr_tok: ["QRX","is","an","algorithm","that","takes","a","point","estimate","algorithm","and","turns","it","into","a","probabilistic","forecasting","algorithm",".","By","default","it","uses","XGBoost",".","You","fit","it","once",",","and","choose","the","quantile","to","predict","only","at","prediction","time",".","Prediction","is","done","by","taking","empirical","quantiles","of","*","true","values","*","associated","with","point","estimate","predictions","close","to","the","point","estimate","of","the","given","point",".","The","minimal","number","of","associated","true","values","is","determined","by","min_bin_size",".","The","algorithm","is","(","loosely",")","inspired","by","quantile","regression","forests",",","in","that","it","is","predicts","quantiles","based","on","associated","true","values",",","where","the","association","is","based","on","a","point","estimate","algorithm",".","Parameters","--","--","--","--","--","model","Any","point","estimate","algorithm","with",".fit","and",".predict","functions",".","xgboost_params","If","None",",","then","it","uses","{","``","max_depth","''",":","5",",","``","n_jobs","''",":","-1",",","``","verbosity","''",":","1",",","``","objective","''",":","``","reg",":","squarederror","''","}","min_bin_size","Hyperparameter","that","determines","the","minimal","size","of","the","list","of","true","values","associated","with","each","prediction","."]
code: def __init__(
      self,
      model=None,
      xgboost_params: Optional[dict] = None,
      min_bin_size: int = 100,
  ):
      """
      QRX is an algorithm that takes a point estimate algorithm and turns it
      into a probabilistic forecasting algorithm. By default it uses XGBoost.
  
      You fit it once, and choose the quantile to predict only at
      prediction time.
  
      Prediction is done by taking empirical quantiles of *true values*
      associated with point estimate predictions close to the point
      estimate of the given point. The minimal number of associated true
      values is determined by min_bin_size.
  
      The algorithm is (loosely) inspired by quantile regression
      forests, in that it is predicts quantiles based on associated true
      values, where the association is based on a point estimate algorithm.
  
      Parameters
      ----------
      model
          Any point estimate algorithm with .fit and .predict functions.
      xgboost_params
          If None, then it uses
          {"max_depth": 5, "n_jobs": -1, "verbosity": 1,
           "objective": "reg:squarederror"}
      min_bin_size
          Hyperparameter that determines the minimal size of the list of
          true values associated with each prediction.
      """
      if model:
          self.model = copy.deepcopy(model)
      else:
          self.model = self._create_xgboost_model(xgboost_params)
      self.min_bin_size = min_bin_size
      self.quantile_dicts: Dict[Any, dict] = defaultdict(dict)
  
imports: from typing import Any, Dict, List, Optional, Union
  import copy
  import numpy
  import pandas
  import xgboost
  import gc
  from collections import defaultdict
  from gluonts.core.component import equals, validated
label_desc: Use image node_id 1 to create a new QRX object  with example: obj = QRX(model, xgboost_params, min_bin_size)