class_docstr: Defines the top-level Model Analysis API.
  Use RAIInsights to analyze errors, explain the most important
  features, compute counterfactuals and run causal analysis in a
  single API.
class_docstr_tok: ["Defines","the","top-level","Model","Analysis","API",".","Use","RAIInsights","to","analyze","errors",",","explain","the","most","important","features",",","compute","counterfactuals","and","run","causal","analysis","in","a","single","API","."]
docstr: Validate the features are unmodified on the DataFrame.
  
  :param sfeatures_before: The features saved before
      an operation was performed.
  :type features_before: list[str]
  :param train_data: The DataFrame after the operation.
  :type train_data: pandas.DataFrame
  :param function: The name of the operation performed.
  :type function: str
docstr_tok: ["Validate","the","features","are","unmodified","on","the","DataFrame",".",":","param","sfeatures_before",":","The","features","saved","before","an","operation","was","performed",".",":","type","features_before",":","list","[","str","]",":","param","train_data",":","The","DataFrame","after","the","operation",".",":","type","train_data",":","pandas.DataFrame",":","param","function",":","The","name","of","the","operation","performed",".",":","type","function",":","str"]
code: def _validate_features_same(
      self, features_before, train_data, function
  ):
      """Validate the features are unmodified on the DataFrame.
  
      :param sfeatures_before: The features saved before
          an operation was performed.
      :type features_before: list[str]
      :param train_data: The DataFrame after the operation.
      :type train_data: pandas.DataFrame
      :param function: The name of the operation performed.
      :type function: str
      """
      exc_msg = (
          f"Calling model {function} function modifies input dataset"
          f" features. Please check if {function} function is "
          "defined correctly."
      )
      features_after = list(train_data.columns)
      if (
          len(features_before) != len(features_after)
          or (features_before != features_after).any()
      ):
          raise UserConfigValidationException(exc_msg)
  
imports: import json
  import pickle
  import warnings
  from enum import Enum
  from pathlib import Path
  from typing import Any, List, Optional, Union
  import numpy
  import pandas
  from erroranalysis._internal.cohort_filter import FilterDataWithCohortFilters
  from erroranalysis._internal.process_categoricals import process_categoricals
  from raiutils.data_processing import convert_to_list
  from raiutils.exceptions import SystemErrorException, UserConfigValidationException
  from raiutils.models import Forecasting, ModelTask, SKLearn
  from responsibleai._interfaces import Dataset, RAIInsightsData, TabularDatasetMetadata
  from responsibleai._internal._forecasting_wrappers import _wrap_model
  from responsibleai._internal.constants import FileFormats, ManagerNames, Metadata, SerializationAttributes
  from responsibleai.feature_metadata import FeatureMetadata
  from responsibleai.managers.causal_manager import CausalManager
  from responsibleai.managers.counterfactual_manager import CounterfactualManager
  from responsibleai.managers.data_balance_manager import DataBalanceManager
  from responsibleai.managers.error_analysis_manager import ErrorAnalysisManager
  from responsibleai.managers.explainer_manager import ExplainerManager
  from responsibleai.rai_insights.rai_base_insights import RAIBaseInsights
label_desc: Use image node_id 14 for calling the RAIInsights obj's underlying member method code with example usage: obj._validate_features_same(features_before, train_data, function) without return types