class_docstr: Implementation of Non-Parametric Time Series Forecaster.
  
  Forecasts of NPTS for time step :math:`T` are one of the previous values
  of the time series (these could be known values or predictions), sampled
  according to the (un-normalized) distribution :math:`q_T(t) > 0` where
  :math:`0 <= t < T`.
  
  The distribution :math:`q_T` is expressed in terms of a feature map
  :math:`f(t)` which associates a time step :math:`t` with a
  :math:`D`-dimensional feature map :math:`[f_1(t), ..., f_D(t)]`. More
  details on the feature map can be found below.
  
  We offer two types of distribution kernels.
  
  **Exponential Kernel (NPTS Forecaster)**
  
    The sampling distribution :math:`q_T` for the `exponential` kernel
    can be `weighted` or `unweighted` and is defined as follows.
  
    .. math::
  
      q_T(t) =
      \begin{cases}
        \exp( - \sum_{i=1}^D \alpha   \left| f_i(t) - f_i(T) \right| )
          & \text{unweighted}\\
        \exp( - \sum_{i=1}^D \alpha_i \left| f_i(t) - f_i(T) \right| )
          & \text{weighted}
      \end{cases}
  
    In the above definition :math:`\alpha > 0` and :math:`\alpha_i > 0` are
    user-defined sampling weights.
  
  **Uniform Kernel (Climatological Forecaster)**
  
    The sampling distribution :math:`q_T` for the `uniform` kernel can be
    `seasonal` or not. The `seasonal` version is defined as follows.
  
    .. math::
  
       q_T(t) =
       \begin{cases}
         1.0
           & \text{if }f(t) = f(T) \\
         0.0
           & \text{otherwise}
       \end{cases}
  
    The `not seasonal` version is defined as the constant map.
  
    .. math::
  
       q_T(t) = 1.0
  
  **Feature Map**
  
    The feature map :math:`f` is configurable. The special case
    :math:`f(t) = [t]` results in the so-called `naive NPTS`. For
    non-seasonal models, by default we have :math:`f(t) = [t]` for the NPTS
    Forecaster (i.e., with the `exponential` kernel) and no features for the
    Climatological Forecaster (i.e., the `uniform` kernel).
  
    For seasonal NPTS and seasonal Climatological, time features are
    determined based on the frequency of the time series are added to the
    default feature map.
  
    The default time features for various frequencies are
  
    .. math::
  
       f(t) =
       \begin{cases}
         [\mathit{MINUTE\_OF\_HOUR}(t)] & \text{for minutely frequency}\\
         [\mathit{HOUR\_OF\_DAY}(t)]    & \text{for hourly frequency}\\
         [\mathit{DAY\_OF\_WEEK}(t)]    & \text{for daily frequency}\\
         [\mathit{DAY\_OF\_MONTH}(t)]   & \text{for weekly frequency}\\
         [\mathit{MONTH\_OF\_YEAR}(t)]  & \text{for monthly frequency}
       \end{cases}
  
    During prediction, one can provide custom features in `feat_dynamic_real`
    (these have to be defined in both the training and the prediction range).
    If the model is seasonal, these custom features are added to the default
    feature map, otherwise they are ignored. If `feat_dynamic_real` is not
    empty, one can disable default time features by setting the flag
    `use_default_time_features` to `False`.
  
  Parameters
  ----------
  
  prediction_length
      number of time steps to predict
  context_length
      number of time-steps that are considered before making predictions
      (the default value of None corresponds to the case where all time steps
      in the history are considered)
  kernel_type
      the type of kernel to use (either "exponential" or "uniform")
  exp_kernel_weights
      single weight :math:`\alpha` or the weights for the features to use
      in the exponential kernel; currently, we use the single weight version
      and for seasonal NPTS we just rescale :math:`\alpha` by `feature_scale`
      for seasonal features.
  use_seasonal_model
      whether to use seasonal variant
  use_default_time_features
      time features derived based on the frequency of the time series
  num_default_time_features
      this is not exposed; this parameter is for having more control on the
      number of default time features, as the date_feature_set adds too
      many per default.
  feature_scale
      scale for time (seasonal) features in order to sample past seasons
      with higher probability
class_docstr_tok: ["Implementation","of","Non-Parametric","Time","Series","Forecaster",".","Forecasts","of","NPTS","for","time","step",":","math",":","`","T","`","are","one","of","the","previous","values","of","the","time","series","(","these","could","be","known","values","or","predictions",")",",","sampled","according","to","the","(","un-normalized",")","distribution",":","math",":","`","q_T","(","t",")",">","0","`","where",":","math",":","`","0","<","=","t","<","T","`",".","The","distribution",":","math",":","`","q_T","`","is","expressed","in","terms","of","a","feature","map",":","math",":","`","f","(","t",")","`","which","associates","a","time","step",":","math",":","`","t","`","with","a",":","math",":","`","D","`","-dimensional","feature","map",":","math",":","`","[","f_1","(","t",")",",","...",",","f_D","(","t",")","]","`",".","More","details","on","the","feature","map","can","be","found","below",".","We","offer","two","types","of","distribution","kernels",".","*","*","Exponential","Kernel","(","NPTS","Forecaster",")","*","*","The","sampling","distribution",":","math",":","`","q_T","`","for","the","`","exponential","`","kernel","can","be","`","weighted","`","or","`","unweighted","`","and","is","defined","as","follows",".","..","math",":",":","q_T","(","t",")","=","\\begin","{","cases","}","\\exp","(","-","\\sum_","{","i=1","}","^D","\\alpha","\\left|","f_i","(","t",")","-","f_i","(","T",")","\\right|",")","&","\\text","{","unweighted","}","\\\\","\\exp","(","-","\\sum_","{","i=1","}","^D","\\alpha_i","\\left|","f_i","(","t",")","-","f_i","(","T",")","\\right|",")","&","\\text","{","weighted","}","\\end","{","cases","}","In","the","above","definition",":","math",":","`","\\alpha",">","0","`","and",":","math",":","`","\\alpha_i",">","0","`","are","user-defined","sampling","weights",".","*","*","Uniform","Kernel","(","Climatological","Forecaster",")","*","*","The","sampling","distribution",":","math",":","`","q_T","`","for","the","`","uniform","`","kernel","can","be","`","seasonal","`","or","not",".","The","`","seasonal","`","version","is","defined","as","follows",".","..","math",":",":","q_T","(","t",")","=","\\begin","{","cases","}","1.0","&","\\text","{","if","}","f","(","t",")","=","f","(","T",")","\\\\","0.0","&","\\text","{","otherwise","}","\\end","{","cases","}","The","`","not","seasonal","`","version","is","defined","as","the","constant","map",".","..","math",":",":","q_T","(","t",")","=","1.0","*","*","Feature","Map","*","*","The","feature","map",":","math",":","`","f","`","is","configurable",".","The","special","case",":","math",":","`","f","(","t",")","=","[","t","]","`","results","in","the","so-called","`","naive","NPTS","`",".","For","non-seasonal","models",",","by","default","we","have",":","math",":","`","f","(","t",")","=","[","t","]","`","for","the","NPTS","Forecaster","(","i.e.",",","with","the","`","exponential","`","kernel",")","and","no","features","for","the","Climatological","Forecaster","(","i.e.",",","the","`","uniform","`","kernel",")",".","For","seasonal","NPTS","and","seasonal","Climatological",",","time","features","are","determined","based","on","the","frequency","of","the","time","series","are","added","to","the","default","feature","map",".","The","default","time","features","for","various","frequencies","are","..","math",":",":","f","(","t",")","=","\\begin","{","cases","}","[","\\mathit","{","MINUTE\\_OF\\_HOUR","}","(","t",")","]","&","\\text","{","for","minutely","frequency","}","\\\\","[","\\mathit","{","HOUR\\_OF\\_DAY","}","(","t",")","]","&","\\text","{","for","hourly","frequency","}","\\\\","[","\\mathit","{","DAY\\_OF\\_WEEK","}","(","t",")","]","&","\\text","{","for","daily","frequency","}","\\\\","[","\\mathit","{","DAY\\_OF\\_MONTH","}","(","t",")","]","&","\\text","{","for","weekly","frequency","}","\\\\","[","\\mathit","{","MONTH\\_OF\\_YEAR","}","(","t",")","]","&","\\text","{","for","monthly","frequency","}","\\end","{","cases","}","During","prediction",",","one","can","provide","custom","features","in","`","feat_dynamic_real","`","(","these","have","to","be","defined","in","both","the","training","and","the","prediction","range",")",".","If","the","model","is","seasonal",",","these","custom","features","are","added","to","the","default","feature","map",",","otherwise","they","are","ignored",".","If","`","feat_dynamic_real","`","is","not","empty",",","one","can","disable","default","time","features","by","setting","the","flag","`","use_default_time_features","`","to","`","False","`",".","Parameters","--","--","--","--","--","prediction_length","number","of","time","steps","to","predict","context_length","number","of","time-steps","that","are","considered","before","making","predictions","(","the","default","value","of","None","corresponds","to","the","case","where","all","time","steps","in","the","history","are","considered",")","kernel_type","the","type","of","kernel","to","use","(","either","``","exponential","''","or","``","uniform","''",")","exp_kernel_weights","single","weight",":","math",":","`","\\alpha","`","or","the","weights","for","the","features","to","use","in","the","exponential","kernel",";","currently",",","we","use","the","single","weight","version","and","for","seasonal","NPTS","we","just","rescale",":","math",":","`","\\alpha","`","by","`","feature_scale","`","for","seasonal","features",".","use_seasonal_model","whether","to","use","seasonal","variant","use_default_time_features","time","features","derived","based","on","the","frequency","of","the","time","series","num_default_time_features","this","is","not","exposed",";","this","parameter","is","for","having","more","control","on","the","number","of","default","time","features",",","as","the","date_feature_set","adds","too","many","per","default",".","feature_scale","scale","for","time","(","seasonal",")","features","in","order","to","sample","past","seasons","with","higher","probability"]
code: def _is_exp_kernel(self) -> bool:
      return self.kernel_type == KernelType.exponential
  
imports: from enum import Enum
  from typing import Any, Iterator, List, Optional, Tuple, Union
  import numpy
  import pandas
  from gluonts.core.component import validated
  from gluonts.dataset.common import Dataset
  from gluonts.exceptions import GluonTSDataError
  from gluonts.model.forecast import SampleForecast
  from gluonts.model.predictor import RepresentablePredictor
  from gluonts.time_feature import time_features_from_frequency_str
  from ._model import NPTS
label_desc: Use image node_id 2 for calling the NPTSPredictor obj's underlying member method code with example usage: obj._is_exp_kernel() and returns: unknown