class_docstr: A single-task exact GP model for mixed search spaces.
  
  This model is similar to `SingleTaskGP`, but supports mixed search spaces,
  which combine discrete and continuous features, as well as solely discrete
  spaces. It uses a kernel that combines a CategoricalKernel (based on
  Hamming distances) and a regular kernel into a kernel of the form
  
      K((x1, c1), (x2, c2)) =
          K_cont_1(x1, x2) + K_cat_1(c1, c2) +
          K_cont_2(x1, x2) * K_cat_2(c1, c2)
  
  where `xi` and `ci` are the continuous and categorical features of the
  input, respectively. The suffix `_i` indicates that we fit different
  lengthscales for the kernels in the sum and product terms.
  
  Since this model does not provide gradients for the categorical features,
  optimization of the acquisition function will need to be performed in
  a mixed fashion, i.e., treating the categorical features properly as
  discrete optimization variables. We recommend using `optimize_acqf_mixed.`
  
  Example:
      >>> train_X = torch.cat(
              [torch.rand(20, 2), torch.randint(3, (20, 1))], dim=-1)
          )
      >>> train_Y = (
              torch.sin(train_X[..., :-1]).sum(dim=1, keepdim=True)
              + train_X[..., -1:]
          )
      >>> model = MixedSingleTaskGP(train_X, train_Y, cat_dims=[-1])
class_docstr_tok: ["A","single-task","exact","GP","model","for","mixed","search","spaces",".","This","model","is","similar","to","`","SingleTaskGP","`",",","but","supports","mixed","search","spaces",",","which","combine","discrete","and","continuous","features",",","as","well","as","solely","discrete","spaces",".","It","uses","a","kernel","that","combines","a","CategoricalKernel","(","based","on","Hamming","distances",")","and","a","regular","kernel","into","a","kernel","of","the","form","K","(","(","x1",",","c1",")",",","(","x2",",","c2",")",")","=","K_cont_1","(","x1",",","x2",")","+","K_cat_1","(","c1",",","c2",")","+","K_cont_2","(","x1",",","x2",")","*","K_cat_2","(","c1",",","c2",")","where","`","xi","`","and","`","ci","`","are","the","continuous","and","categorical","features","of","the","input",",","respectively",".","The","suffix","`","_i","`","indicates","that","we","fit","different","lengthscales","for","the","kernels","in","the","sum","and","product","terms",".","Since","this","model","does","not","provide","gradients","for","the","categorical","features",",","optimization","of","the","acquisition","function","will","need","to","be","performed","in","a","mixed","fashion",",","i.e.",",","treating","the","categorical","features","properly","as","discrete","optimization","variables",".","We","recommend","using","`","optimize_acqf_mixed.","`","Example",":",">",">",">","train_X","=","torch.cat","(","[","torch.rand","(","20",",","2",")",",","torch.randint","(","3",",","(","20",",","1",")",")","]",",","dim=-1",")",")",">",">",">","train_Y","=","(","torch.sin","(","train_X","[","...",",",":","-1","]",")",".sum","(","dim=1",",","keepdim=True",")","+","train_X","[","...",",","-1",":","]",")",">",">",">","model","=","MixedSingleTaskGP","(","train_X",",","train_Y",",","cat_dims=","[","-1","]",")"]
docstr: Construct `Model` keyword arguments from a dict of `SupervisedDataset`.
  
  Args:
      training_data: A `SupervisedDataset` containing the training data.
      categorical_features: Column indices of categorical features.
      likelihood: Optional likelihood used to constuct the model.
docstr_tok: ["Construct","`","Model","`","keyword","arguments","from","a","dict","of","`","SupervisedDataset","`",".","Args",":","training_data",":","A","`","SupervisedDataset","`","containing","the","training","data",".","categorical_features",":","Column","indices","of","categorical","features",".","likelihood",":","Optional","likelihood","used","to","constuct","the","model","."]
code: def construct_inputs(
      cls,
      training_data: SupervisedDataset,
      categorical_features: List[int],
      likelihood: Optional[Likelihood] = None,
      **kwargs: Any,
  ) -> Dict[str, Any]:
      r"""Construct `Model` keyword arguments from a dict of `SupervisedDataset`.
  
      Args:
          training_data: A `SupervisedDataset` containing the training data.
          categorical_features: Column indices of categorical features.
          likelihood: Optional likelihood used to constuct the model.
      """
      base_inputs = super().construct_inputs(
          training_data=training_data, **kwargs
      )
      return {
          **base_inputs,
          "cat_dims": categorical_features,
          "likelihood": likelihood,
      }
  
imports: from __future__ import annotations
  from typing import Any, Callable, Dict, List, Optional
  import torch
  from botorch.models.gp_regression import SingleTaskGP
  from botorch.models.kernels.categorical import CategoricalKernel
  from botorch.models.transforms.input import InputTransform
  from botorch.models.transforms.outcome import OutcomeTransform
  from botorch.utils.datasets import SupervisedDataset
  from botorch.utils.transforms import normalize_indices
  from gpytorch.constraints import GreaterThan
  from gpytorch.kernels.kernel import Kernel
  from gpytorch.kernels.matern_kernel import MaternKernel
  from gpytorch.kernels.scale_kernel import ScaleKernel
  from gpytorch.likelihoods.gaussian_likelihood import GaussianLikelihood
  from gpytorch.likelihoods.likelihood import Likelihood
  from gpytorch.priors import GammaPrior
  from torch import Tensor
label_desc: Use image node_id 2 for calling the MixedSingleTaskGP obj's underlying member method code with example usage: obj.construct_inputs(cls, training_data, categorical_features, likelihood) and returns: dict