code: def project_feature_values_1d(
      feature_values,
      col,
      x_init,
      x_encoded,
      preprocessing,
      features_dict,
      how="tsne",
  ):
      """
      Project feature values of a group of features in 1 dimension.
      If feature_values contains categorical features, use preprocessing to get
      the corresponding encoded variables.
  
      Parameters
      ----------
      feature_values : pd.DataFrame
          DataFrame that contains the feature values
      col : str
          Name of the group of features.
      preprocessing : category_encoders, ColumnTransformer, list, dict, optional
          Preprocessing used to encode categorical variables.
      x_init : pd.DataFrame
          Pandas dataframe before preprocessing transformations
      x_encoded : pd.DataFrame
          Pandas dataframe after preprocessing transformations
      preprocessing : category_encoders or ColumnTransformer or list or dict or list of dict
          The processing apply to the original data
      features_dict: dict, optional (default: None)
          Dictionary mapping technical feature names to domain names.
      how : str
          Method used to compute groups of features values in one column.
  
      Returns
      -------
      feature_values : pd.Series
          Series containing the projected feature values.
      """
      # Getting mapping of variables to transform categorical features with corresponding encoded variables
      encoding_mapping = get_features_transform_mapping(
          x_init, x_encoded, preprocessing
      )
      col_names_in_xinit = list()
      for c in feature_values.columns:
          col_names_in_xinit.extend(encoding_mapping.get(c, [c]))
      feature_values = x_encoded.loc[
          feature_values.index, col_names_in_xinit
      ]
      # Project in 1D the feature values
      if how == "tsne":
          try:
              feature_values_proj_1d = TSNE(
                  n_components=1, random_state=1
              ).fit_transform(feature_values)
              feature_values = pd.Series(
                  feature_values_proj_1d[:, 0],
                  name=col,
                  index=feature_values.index,
              )
          except Exception as e:
              warnings.warn(
                  f"Could not project group features values : {e}",
                  UserWarning,
              )
              feature_values = pd.Series(
                  feature_values.iloc[:, 0],
                  name=col,
                  index=feature_values.index,
              )
      elif how == "dict_of_values":
          feature_values.columns = [
              features_dict.get(x, x) for x in feature_values.columns
          ]
          feature_values = pd.Series(
              feature_values.apply(lambda x: x.to_dict(), axis=1),
              name=col,
              index=feature_values.index,
          )
      else:
          raise NotImplementedError(f"Unknown method : {how}")
      return feature_values
  
file_path: shapash/shapash/manipulation/summarize.py
imports: import warnings
  import numpy
  import pandas
  from pandas.core.common import flatten
  from sklearn.manifold import TSNE
  from shapash.utils.transform import get_features_transform_mapping
label_desc: Use image node_id 5 for calling a global function with example usage: project_feature_values_1d(feature_values, col, x_init, x_encoded, preprocessing, features_dict, how) and returns: feature_values