class_docstr: A mixin class for SageMaker ``Inference Recommender`` that will be extended by ``Model``
class_docstr_tok: ["A","mixin","class","for","SageMaker","``","Inference","Recommender","``","that","will","be","extended","by","``","Model","``"]
docstr: Bundle right_size() parameters into an endpoint configuration for Advanced job
docstr_tok: ["Bundle","right_size","(",")","parameters","into","an","endpoint","configuration","for","Advanced","job"]
code: def _convert_to_endpoint_configurations_json(
      self, hyperparameter_ranges: List[Dict[str, CategoricalParameter]]
  ):
      """Bundle right_size() parameters into an endpoint configuration for Advanced job"""
      if not hyperparameter_ranges:
          return None
  
      endpoint_configurations_to_json = []
      for parameter_range in hyperparameter_ranges:
          if not parameter_range.get("instance_types"):
              raise ValueError(
                  "instance_type must be defined as a hyperparameter_range"
              )
          parameter_range = parameter_range.copy()
          instance_types = parameter_range.get("instance_types").values
          parameter_range.pop("instance_types")
  
          for instance_type in instance_types:
              parameter_ranges = [
                  {"Name": name, "Value": param.values}
                  for name, param in parameter_range.items()
              ]
              endpoint_configurations_to_json.append(
                  {
                      "EnvironmentParameterRanges": {
                          "CategoricalParameterRanges": parameter_ranges
                      },
                      "InstanceType": instance_type,
                  }
              )
  
      return endpoint_configurations_to_json
  
imports: from __future__ import absolute_import
  import logging
  import re
  from typing import List, Dict, Optional
  import sagemaker
  from sagemaker.parameter import CategoricalParameter
label_desc: Use image node_id 5 for calling the InferenceRecommenderMixin obj's underlying member method code with example usage: obj._convert_to_endpoint_configurations_json(hyperparameter_ranges) and returns: endpoint_configurations_to_json, None