class_docstr: Configurator module that load the defined parameters.
  
  Configurator module will first load the default parameters from the fixed properties in RecBole and then
  load parameters from the external input.
  
  External input supports three kind of forms: config file, command line and parameter dictionaries.
  
  - config file: It's a file that record the parameters to be modified or added. It should be in ``yaml`` format,
    e.g. a config file is 'example.yaml', the content is:
  
      learning_rate: 0.001
  
      train_batch_size: 2048
  
  - command line: It should be in the format as '---learning_rate=0.001'
  
  - parameter dictionaries: It should be a dict, where the key is parameter name and the value is parameter value,
    e.g. config_dict = {'learning_rate': 0.001}
  
  Configuration module allows the above three kind of external input format to be used together,
  the priority order is as following:
  
  command line > parameter dictionaries > config file
  
  e.g. If we set learning_rate=0.01 in config file, learning_rate=0.02 in command line,
  learning_rate=0.03 in parameter dictionaries.
  
  Finally the learning_rate is equal to 0.02.
class_docstr_tok: ["Configurator","module","that","load","the","defined","parameters",".","Configurator","module","will","first","load","the","default","parameters","from","the","fixed","properties","in","RecBole","and","then","load","parameters","from","the","external","input",".","External","input","supports","three","kind","of","forms",":","config","file",",","command","line","and","parameter","dictionaries",".","-","config","file",":","It","'s","a","file","that","record","the","parameters","to","be","modified","or","added",".","It","should","be","in","``","yaml","``","format",",","e.g",".","a","config","file","is","'example.yaml","'",",","the","content","is",":","learning_rate",":","0.001","train_batch_size",":","2048","-","command","line",":","It","should","be","in","the","format","as","'","--","-learning_rate=0.001'","-","parameter","dictionaries",":","It","should","be","a","dict",",","where","the","key","is","parameter","name","and","the","value","is","parameter","value",",","e.g",".","config_dict","=","{","'learning_rate","'",":","0.001","}","Configuration","module","allows","the","above","three","kind","of","external","input","format","to","be","used","together",",","the","priority","order","is","as","following",":","command","line",">","parameter","dictionaries",">","config","file","e.g",".","If","we","set","learning_rate=0.01","in","config","file",",","learning_rate=0.02","in","command","line",",","learning_rate=0.03","in","parameter","dictionaries",".","Finally","the","learning_rate","is","equal","to","0.02","."]
code: def _set_default_parameters(self):
      self.final_config_dict["dataset"] = self.dataset
      self.final_config_dict["model"] = self.model
      if self.dataset == "ml-100k":
          current_path = os.path.dirname(os.path.realpath(__file__))
          self.final_config_dict["data_path"] = os.path.join(
              current_path, "../dataset_example/" + self.dataset
          )
      else:
          self.final_config_dict["data_path"] = os.path.join(
              self.final_config_dict["data_path"], self.dataset
          )
  
      if hasattr(self.model_class, "input_type"):
          self.final_config_dict[
              "MODEL_INPUT_TYPE"
          ] = self.model_class.input_type
      elif "loss_type" in self.final_config_dict:
          if self.final_config_dict["loss_type"] in ["CE"]:
              if (
                  self.final_config_dict["MODEL_TYPE"]
                  == ModelType.SEQUENTIAL
                  and self.final_config_dict.get(
                      "train_neg_sample_args", None
                  )
                  is not None
              ):
                  raise ValueError(
                      f"train_neg_sample_args [{self.final_config_dict['train_neg_sample_args']}] should be None "
                      f"when the loss_type is CE."
                  )
              self.final_config_dict[
                  "MODEL_INPUT_TYPE"
              ] = InputType.POINTWISE
          elif self.final_config_dict["loss_type"] in ["BPR"]:
              self.final_config_dict[
                  "MODEL_INPUT_TYPE"
              ] = InputType.PAIRWISE
      else:
          raise ValueError(
              "Either Model has attr 'input_type',"
              "or arg 'loss_type' should exist in config."
          )
  
      metrics = self.final_config_dict["metrics"]
      if isinstance(metrics, str):
          self.final_config_dict["metrics"] = [metrics]
  
      eval_type = set()
      for metric in self.final_config_dict["metrics"]:
          if metric.lower() in metric_types:
              eval_type.add(metric_types[metric.lower()])
          else:
              raise NotImplementedError(
                  f"There is no metric named '{metric}'"
              )
      if len(eval_type) > 1:
          raise RuntimeError(
              "Ranking metrics and value metrics can not be used at the same time."
          )
      self.final_config_dict["eval_type"] = eval_type.pop()
  
      if (
          self.final_config_dict["MODEL_TYPE"] == ModelType.SEQUENTIAL
          and not self.final_config_dict["repeatable"]
      ):
          raise ValueError(
              "Sequential models currently only support repeatable recommendation, "
              "please set `repeatable` as `True`."
          )
  
      valid_metric = self.final_config_dict["valid_metric"].split("@")[
          0
      ]
      self.final_config_dict["valid_metric_bigger"] = (
          False if valid_metric.lower() in smaller_metrics else True
      )
  
      topk = self.final_config_dict["topk"]
      if isinstance(topk, (int, list)):
          if isinstance(topk, int):
              topk = [topk]
          for k in topk:
              if k <= 0:
                  raise ValueError(
                      f"topk must be a positive integer or a list of positive integers, but get `{k}`"
                  )
          self.final_config_dict["topk"] = topk
      else:
          raise TypeError(f"The topk [{topk}] must be a integer, list")
  
      if "additional_feat_suffix" in self.final_config_dict:
          ad_suf = self.final_config_dict["additional_feat_suffix"]
          if isinstance(ad_suf, str):
              self.final_config_dict["additional_feat_suffix"] = [
                  ad_suf
              ]
  
      # train_neg_sample_args checking
      default_train_neg_sample_args = {
          "distribution": "uniform",
          "sample_num": 1,
          "alpha": 1.0,
          "dynamic": False,
          "candidate_num": 0,
      }
  
      if (
          self.final_config_dict.get("neg_sampling") is not None
          or self.final_config_dict.get("training_neg_sample_num")
          is not None
      ):
          logger = getLogger()
          logger.warning(
              "Warning: Parameter 'neg_sampling' or 'training_neg_sample_num' has been deprecated in the new version, "
              "please use 'train_neg_sample_args' instead and check the API documentation for proper usage."
          )
  
      if (
          self.final_config_dict.get("train_neg_sample_args")
          is not None
      ):
          if not isinstance(
              self.final_config_dict["train_neg_sample_args"], dict
          ):
              raise ValueError(
                  f"train_neg_sample_args:[{self.final_config_dict['train_neg_sample_args']}] should be a dict."
              )
          for op_args in default_train_neg_sample_args:
              if (
                  op_args
                  not in self.final_config_dict["train_neg_sample_args"]
              ):
                  self.final_config_dict["train_neg_sample_args"][
                      op_args
                  ] = default_train_neg_sample_args[op_args]
  
      # eval_args checking
      default_eval_args = {
          "split": {"RS": [0.8, 0.1, 0.1]},
          "order": "RO",
          "group_by": "user",
          "mode": {"valid": "full", "test": "full"},
      }
      if not isinstance(self.final_config_dict["eval_args"], dict):
          raise ValueError(
              f"eval_args:[{self.final_config_dict['eval_args']}] should be a dict."
          )
  
      default_eval_args.update(self.final_config_dict["eval_args"])
  
      mode = default_eval_args["mode"]
      # backward compatible
      if isinstance(mode, str):
          default_eval_args["mode"] = {"valid": mode, "test": mode}
  
      # in case there is only one key in `mode`, e.g., mode: {'valid': 'uni100'} or mode: {'test': 'full'}
      if isinstance(mode, dict):
          default_mode = mode.get("valid", mode.get("test", "full"))
          default_eval_args["mode"] = {
              "valid": mode.get("valid", default_mode),
              "test": mode.get("test", default_mode),
          }
  
      self.final_config_dict["eval_args"] = default_eval_args
      if (
          self.final_config_dict["eval_type"] == EvaluatorType.VALUE
          and "full"
          in self.final_config_dict["eval_args"]["mode"].values()
      ):
          raise NotImplementedError(
              "Full sort evaluation do not match value-based metrics!"
          )
  
imports: import re
  import os
  import sys
  import yaml
  from logging import getLogger
  from typing import Literal
  from recbole.evaluator import metric_types, smaller_metrics
  from recbole.utils import get_model, Enum, EvaluatorType, ModelType, InputType, general_arguments, training_arguments, evaluation_arguments, dataset_arguments, set_color
label_desc: Use image node_id 13 for calling the Config obj's underlying member method code with example usage: obj._set_default_parameters() without return types