class_docstr: `FeatureScaled` kernel for continuous and embedded categorical data.
  
  This kernel is an extension of `FeatureScaled` that handles categorical data
  (encoded as integers, not one-hot) in addition to continuous (float) data.
  `ContinuousAndCategoricalValues` structures, containing arrays of continuous
  and categorical data, are passed to the `apply`, `matrix` and `tensor`
  methods. The continuous inputs are scaled and then passed to the distance
  function, like in `FeatureScaled`. Categorical data, encoded as integers,
  is continuously embedded using `LinearOperator`s. When all `LinearOperator`s
  are either `LinearOperatorIdentity` or `LinearOperatorScaledIdentity`
  instances, this kernel is the same as `FeatureScaledWithCategorical`, though
  in that case the latter should be used since it will be more efficient.
  
  #### Examples
  
  Compute the kernel matrix on synthetic data.
  
  ```python
  import numpy as np
  
  continuous_dim = 3
  categorical_dim = 2
  
  # Define an ARD kernel that takes a structure of continuous and categorical
  # data as inputs, with randomly-sampled `continuous_scale_diag` values and
  # diagonal embeddings of categorical data.
  base_kernel = tfpk.MaternFiveHalves()
  continuous_scale_diag = np.random.uniform(size=[continuous_dim])
  
  # Categorical `scale_diag`s are passed as an iterable of `LinearOperator`s,
  # where each `LinearOperator` applies to a categorical feature and has number
  # of rows equivalent to the cardinality of that feature. Categorical data is
  # assumed to be represented as integers between 0 and `n - 1` inclusive, which
  # are used to index into the `inverse_scale_diag` vectors.
  num_categories = [5, 4]
  categorical_embedding_operators = [
      tf.linalg.LinearOperatorDiag(np.random.uniform(size=[n]))
      for n in num_categories]
  
  kernel = tfpke.FeatureScaledWithEmbeddedCategorical(
      base_kernel,
      categorical_embedding_operators=categorical_embedding_operators,
      continuous_scale_diag=continuous_scale_diag,
      validate_args=True)
  
  # Create `num_points` examples in the continuous/categorical feature space.
  num_points = 12
  categorical_data_1 = np.stack(
      [np.random.randint(n, size=(num_points,)) for n in num_categories])
  categorical_data_2 = np.stack(
      [np.random.randint(n, size=(num_points,)) for n in num_categories])
  x1 = tfpke.ContinuousAndCategoricalValues(
      continuous=np.random.normal(size=(num_points, continuous_dim)),
      categorical=categorical_data_1)
  x2 = tfpke.ContinuousAndCategoricalValues(
      continuous=np.random.normal(size=(num_points, continuous_dim)),
      categorical=categorical_data_2)
  
  # Evaluate the kernel matrix for `x1` and `x2`.
  kernel.matrix(x1, x2)  # has shape `[num_points, num_points]`
  
  ```
class_docstr_tok: ["`","FeatureScaled","`","kernel","for","continuous","and","embedded","categorical","data",".","This","kernel","is","an","extension","of","`","FeatureScaled","`","that","handles","categorical","data","(","encoded","as","integers",",","not","one-hot",")","in","addition","to","continuous","(","float",")","data",".","`","ContinuousAndCategoricalValues","`","structures",",","containing","arrays","of","continuous","and","categorical","data",",","are","passed","to","the","`","apply","`",",","`","matrix","`","and","`","tensor","`","methods",".","The","continuous","inputs","are","scaled","and","then","passed","to","the","distance","function",",","like","in","`","FeatureScaled","`",".","Categorical","data",",","encoded","as","integers",",","is","continuously","embedded","using","`","LinearOperator","`","s",".","When","all","`","LinearOperator","`","s","are","either","`","LinearOperatorIdentity","`","or","`","LinearOperatorScaledIdentity","`","instances",",","this","kernel","is","the","same","as","`","FeatureScaledWithCategorical","`",",","though","in","that","case","the","latter","should","be","used","since","it","will","be","more","efficient",".","#","#","#","#","Examples","Compute","the","kernel","matrix","on","synthetic","data",".","``","`","python","import","numpy","as","np","continuous_dim","=","3","categorical_dim","=","2","#","Define","an","ARD","kernel","that","takes","a","structure","of","continuous","and","categorical","#","data","as","inputs",",","with","randomly-sampled","`","continuous_scale_diag","`","values","and","#","diagonal","embeddings","of","categorical","data",".","base_kernel","=","tfpk.MaternFiveHalves","(",")","continuous_scale_diag","=","np.random.uniform","(","size=","[","continuous_dim","]",")","#","Categorical","`","scale_diag","`","s","are","passed","as","an","iterable","of","`","LinearOperator","`","s",",","#","where","each","`","LinearOperator","`","applies","to","a","categorical","feature","and","has","number","#","of","rows","equivalent","to","the","cardinality","of","that","feature",".","Categorical","data","is","#","assumed","to","be","represented","as","integers","between","0","and","`","n","-","1","`","inclusive",",","which","#","are","used","to","index","into","the","`","inverse_scale_diag","`","vectors",".","num_categories","=","[","5",",","4","]","categorical_embedding_operators","=","[","tf.linalg.LinearOperatorDiag","(","np.random.uniform","(","size=","[","n","]",")",")","for","n","in","num_categories","]","kernel","=","tfpke.FeatureScaledWithEmbeddedCategorical","(","base_kernel",",","categorical_embedding_operators=categorical_embedding_operators",",","continuous_scale_diag=continuous_scale_diag",",","validate_args=True",")","#","Create","`","num_points","`","examples","in","the","continuous\/categorical","feature","space",".","num_points","=","12","categorical_data_1","=","np.stack","(","[","np.random.randint","(","n",",","size=","(","num_points",",",")",")","for","n","in","num_categories","]",")","categorical_data_2","=","np.stack","(","[","np.random.randint","(","n",",","size=","(","num_points",",",")",")","for","n","in","num_categories","]",")","x1","=","tfpke.ContinuousAndCategoricalValues","(","continuous=np.random.normal","(","size=","(","num_points",",","continuous_dim",")",")",",","categorical=categorical_data_1",")","x2","=","tfpke.ContinuousAndCategoricalValues","(","continuous=np.random.normal","(","size=","(","num_points",",","continuous_dim",")",")",",","categorical=categorical_data_2",")","#","Evaluate","the","kernel","matrix","for","`","x1","`","and","`","x2","`",".","kernel.matrix","(","x1",",","x2",")","#","has","shape","`","[","num_points",",","num_points","]","`","``","`"]
code: def kernel(self):
      return self._kernel
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.psd_kernels import feature_scaled_with_categorical
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math.psd_kernels import positive_semidefinite_kernel
  from tensorflow_probability.python.math.psd_kernels.internal import util
label_desc: Use image node_id 2 for calling the FeatureScaledWithEmbeddedCategorical obj's underlying member method code with example usage: obj.kernel() and returns: self