class_docstr: The base uncertainty model.
  
  Attributes
  ----------
  uncertainty_dict : `dict` [`str`, any]
      The uncertainty model specification. It should have the following keys:
  
              "uncertainty_method": a string that is in
                  `~greykite.sklearn.uncertainty.uncertainty_methods.UncertaintyMethodEnum`.
              "params": a dictionary that includes any additional parameters needed by the uncertainty method.
  
  uncertainty_method : `str` or None
      The name of the uncertainty model.
      Must be in `~greykite.sklearn.uncertainty.uncertainty_methods.UncertaintyMethodEnum`.
      This parameter is a required parameter by all subclasses.
  params : `dict` [`str`, any] or None
      The parameters to be fed into the uncertainty model.
      This class tries to populate ``value_col`` if ``cst.VALUE_COL`` is found in the training df,
      because ``value_col`` is a common parameter used by many subclasses.
  train_df : `pandas.DataFrame` or None
      The data used to fit the uncertainty model.
  uncertainty_model : any or None
      The uncertainty model.
  pred_df : `pandas.DataFrame`
      The prediction result df.
class_docstr_tok: ["The","base","uncertainty","model",".","Attributes","--","--","--","--","--","uncertainty_dict",":","`","dict","`","[","`","str","`",",","any","]","The","uncertainty","model","specification",".","It","should","have","the","following","keys",":","``","uncertainty_method","''",":","a","string","that","is","in","`","~greykite.sklearn.uncertainty.uncertainty_methods.UncertaintyMethodEnum","`",".","``","params","''",":","a","dictionary","that","includes","any","additional","parameters","needed","by","the","uncertainty","method",".","uncertainty_method",":","`","str","`","or","None","The","name","of","the","uncertainty","model",".","Must","be","in","`","~greykite.sklearn.uncertainty.uncertainty_methods.UncertaintyMethodEnum","`",".","This","parameter","is","a","required","parameter","by","all","subclasses",".","params",":","`","dict","`","[","`","str","`",",","any","]","or","None","The","parameters","to","be","fed","into","the","uncertainty","model",".","This","class","tries","to","populate","``","value_col","``","if","``","cst.VALUE_COL","``","is","found","in","the","training","df",",","because","``","value_col","``","is","a","common","parameter","used","by","many","subclasses",".","train_df",":","`","pandas.DataFrame","`","or","None","The","data","used","to","fit","the","uncertainty","model",".","uncertainty_model",":","any","or","None","The","uncertainty","model",".","pred_df",":","`","pandas.DataFrame","`","The","prediction","result","df","."]
docstr: Checks that necessary input are provided in ``self.uncertainty_dict`` and ``self.train_df``.
  To be called after setting ``self.train_df`` in ``self.fit``.
  Every subclass need to override this method to check their own inputs.
  Do not raise errors other than
  `~greykite.sklearn.uncertainty.exceptions.UncertaintyError`,
  since this type of error will be catched and won't fail the whole pipeline.
docstr_tok: ["Checks","that","necessary","input","are","provided","in","``","self.uncertainty_dict","``","and","``","self.train_df","``",".","To","be","called","after","setting","``","self.train_df","``","in","``","self.fit","``",".","Every","subclass","need","to","override","this","method","to","check","their","own","inputs",".","Do","not","raise","errors","other","than","`","~greykite.sklearn.uncertainty.exceptions.UncertaintyError","`",",","since","this","type","of","error","will","be","catched","and","wo","n't","fail","the","whole","pipeline","."]
code: def _check_input(self):
      """Checks that necessary input are provided in ``self.uncertainty_dict`` and ``self.train_df``.
      To be called after setting ``self.train_df`` in ``self.fit``.
      Every subclass need to override this method to check their own inputs.
      Do not raise errors other than
      `~greykite.sklearn.uncertainty.exceptions.UncertaintyError`,
      since this type of error will be catched and won't fail the whole pipeline.
      """
      if self.uncertainty_dict is None:
          self.uncertainty_dict = {}
  
      # Checks the uncertainty method matches.
      self.uncertainty_method = self.uncertainty_dict.get(
          "uncertainty_method"
      )
      if self.uncertainty_method != self.UNCERTAINTY_METHOD:
          raise UncertaintyError(
              f"The uncertainty method {self.uncertainty_method} is not as expected {self.UNCERTAINTY_METHOD}."
          )
  
      # Gets the parameters.
      self.params = self.uncertainty_dict.get("params", {})
  
      # Populates ``value_col`` since it's a commonly used param.
      if (
          self.params.get("value_col", None) is None
          and self.train_df is not None
          and cst.VALUE_COL in self.train_df.columns
      ):
          self.params["value_col"] = cst.VALUE_COL
  
      # Checks all required parameters are given.
      for required_param in self.REQUIRED_PARAMS:
          if required_param not in self.params:
              raise UncertaintyError(
                  f"The parameter {required_param} is required but not found in "
                  f"`uncertainty['params']` {self.params}. "
                  f"The required parameters are {self.REQUIRED_PARAMS}."
              )
  
file_path: greykite/greykite/sklearn/uncertainty/base_uncertainty_model.py
imports: from abc import abstractmethod
  from typing import Dict
  from typing import Optional
  import pandas
  from greykite.common import constants
  from greykite.sklearn.uncertainty.exceptions import UncertaintyError
label_desc: Use image node_id 2 for calling the BaseUncertaintyModel obj's underlying member method code with example usage: obj._check_input() without return types