class_docstr: Class for applying PCA and kernel PCA models from sklearn
  
  Args:
      params: OpearationParameters with the arguments
class_docstr_tok: ["Class","for","applying","PCA","and","kernel","PCA","models","from","sklearn","Args",":","params",":","OpearationParameters","with","the","arguments"]
docstr: The method trains the PCA model
  
  Args:
      input_data: data with features, target and ids for PCA training
  
  Returns:
      trained PCA model (optional output)
docstr_tok: ["The","method","trains","the","PCA","model","Args",":","input_data",":","data","with","features",",","target","and","ids","for","PCA","training","Returns",":","trained","PCA","model","(","optional","output",")"]
code: def fit(self, input_data: InputData):
      """The method trains the PCA model
  
      Args:
          input_data: data with features, target and ids for PCA training
  
      Returns:
          trained PCA model (optional output)
      """
  
      self.number_of_samples, self.number_of_features = np.array(
          input_data.features
      ).shape
  
      if self.number_of_features > 1:
          self.check_and_correct_params()
          self.pca.fit(input_data.features)
  
      return self.pca
  
imports: import random
  from typing import Optional
  import numpy
  import pandas
  from sklearn.decomposition import FastICA, KernelPCA, PCA
  from sklearn.impute import SimpleImputer
  from sklearn.preprocessing import MinMaxScaler, PolynomialFeatures, StandardScaler
  from fedot.core.data.data import InputData, OutputData, data_type_is_table
  from fedot.core.data.data_preprocessing import convert_into_column, data_has_categorical_features, divide_data_categorical_numerical, find_categorical_columns, replace_inf_with_nans
  from fedot.core.operations.evaluation.operation_implementations.implementation_interfaces import DataOperationImplementation, EncodedInvariantImplementation
  from fedot.core.operations.operation_parameters import OperationParameters
  from fedot.preprocessing.data_types import TYPE_TO_ID
label_desc: Use image node_id 2 for calling the ComponentAnalysisImplementation obj's underlying member method code with example usage: obj.fit(input_data) and returns: self