code: def __init__(
      self,
      userResourceFeatureVectorMapping: _UserResourceFeatureVectorMapping,
      outputCol: str,
  ):
      super().__init__()
      self.user_res_feature_vector_mapping = (
          userResourceFeatureVectorMapping
      )
  
      has_user2component_mappings = (
          self.user_res_feature_vector_mapping.user2component_mappings_df
          is not None
      )
      has_res2component_mappings = (
          self.user_res_feature_vector_mapping.res2component_mappings_df
          is not None
      )
  
      assert has_user2component_mappings == has_res2component_mappings
  
      self.has_components = (
          has_user2component_mappings and has_res2component_mappings
      )
      self.preserve_history = True
  
      if self.has_components:
          self._user_mapping_df = (
              self.user_res_feature_vector_mapping.user_feature_vector_mapping_df.join(
                  self.user_res_feature_vector_mapping.user2component_mappings_df,
                  [self.tenant_col, self.user_col],
              )
              .select(
                  self.tenant_col,
                  self.user_col,
                  self.user_vec_col,
                  f.col("component").alias("user_component"),
              )
              .cache()
          )
  
          self._res_mapping_df = (
              self.user_res_feature_vector_mapping.res_feature_vector_mapping_df.join(
                  self.user_res_feature_vector_mapping.res2component_mappings_df,
                  [self.tenant_col, self.res_col],
              )
              .select(
                  self.tenant_col,
                  self.res_col,
                  self.res_vec_col,
                  f.col("component").alias("res_component"),
              )
              .cache()
          )
      else:
          self._user_mapping_df = (
              self.user_res_feature_vector_mapping.user_feature_vector_mapping_df
          )
          self._res_mapping_df = (
              self.user_res_feature_vector_mapping.res_feature_vector_mapping_df
          )
  
      spark_utils.ExplainBuilder.build(self, outputCol=outputCol)
  
imports: import os
  from typing import List, Optional, Tuple
  from synapse.ml.cyber.anomaly.complement_access import ComplementAccessTransformer
  from synapse.ml.cyber.feature import indexers, scalers
  from synapse.ml.cyber.utils import spark_utils
  import numpy
  from pyspark import SQLContext
  from pyspark.ml import Estimator, Transformer
  from pyspark.ml.param.shared import Param, Params
  from pyspark.ml.recommendation import ALS
  from pyspark.sql import DataFrame, functions, types
label_desc: Use image node_id 1 to create a new AccessAnomalyModel object from inherited base classes: Transformer with example: obj = AccessAnomalyModel(userResourceFeatureVectorMapping, outputCol)