class_docstr: Principal Components Analysis
class_docstr_tok: ["Principal","Components","Analysis"]
docstr: Returns H2OPCA object which implements fit and transform method to be used in sklearn.Pipeline properly.
  All parameters defined in self.__params, should be input parameters in H2OPCA.__init__ method.
  
  :returns: H2OPCA object
  
  :examples:
  
  >>> from sklearn.pipeline import Pipeline
  >>> from h2o.transforms.preprocessing import H2OScaler
  >>> from h2o.estimators import H2ORandomForestEstimator
  >>> iris = h2o.import_file("http://h2o-public-test-data.s3.amazonaws.com/smalldata/iris/iris_wheader.csv")
  >>> pipe = Pipeline([("standardize", H2OScaler()),
  ...                  ("pca", H2OPrincipalComponentAnalysisEstimator(k=2).init_for_pipeline()),
  ...                  ("rf", H2ORandomForestEstimator(seed=42,ntrees=5))])
  >>> pipe.fit(iris[:4], iris[4])
docstr_tok: ["Returns","H2OPCA","object","which","implements","fit","and","transform","method","to","be","used","in","sklearn.Pipeline","properly",".","All","parameters","defined","in","self.__params",",","should","be","input","parameters","in","H2OPCA.__init__","method",".",":","returns",":","H2OPCA","object",":","examples",":",">",">",">","from","sklearn.pipeline","import","Pipeline",">",">",">","from","h2o.transforms.preprocessing","import","H2OScaler",">",">",">","from","h2o.estimators","import","H2ORandomForestEstimator",">",">",">","iris","=","h2o.import_file","(","``","http",":","\/\/h2o-public-test-data.s3.amazonaws.com\/smalldata\/iris\/iris_wheader.csv","''",")",">",">",">","pipe","=","Pipeline","(","[","(","``","standardize","''",",","H2OScaler","(",")",")",",","...","(","``","pca","''",",","H2OPrincipalComponentAnalysisEstimator","(","k=2",")",".init_for_pipeline","(",")",")",",","...","(","``","rf","''",",","H2ORandomForestEstimator","(","seed=42",",","ntrees=5",")",")","]",")",">",">",">","pipe.fit","(","iris","[",":4","]",",","iris","[","4","]",")"]
code: def init_for_pipeline(self):
      """
      Returns H2OPCA object which implements fit and transform method to be used in sklearn.Pipeline properly.
      All parameters defined in self.__params, should be input parameters in H2OPCA.__init__ method.
  
      :returns: H2OPCA object
  
      :examples:
  
      >>> from sklearn.pipeline import Pipeline
      >>> from h2o.transforms.preprocessing import H2OScaler
      >>> from h2o.estimators import H2ORandomForestEstimator
      >>> iris = h2o.import_file("http://h2o-public-test-data.s3.amazonaws.com/smalldata/iris/iris_wheader.csv")
      >>> pipe = Pipeline([("standardize", H2OScaler()),
      ...                  ("pca", H2OPrincipalComponentAnalysisEstimator(k=2).init_for_pipeline()),
      ...                  ("rf", H2ORandomForestEstimator(seed=42,ntrees=5))])
      >>> pipe.fit(iris[:4], iris[4])
      """
      import inspect
      from h2o.transforms.decomposition import H2OPCA
  
      # check which parameters can be passed to H2OPCA init
      var_names = list(
          dict(inspect.getmembers(H2OPCA.__init__.__code__))[
              "co_varnames"
          ]
      )
      parameters = {
          k: v for k, v in self._parms.items() if k in var_names
      }
      return H2OPCA(**parameters)
  
imports: from h2o.estimators.estimator_base import H2OEstimator
  from h2o.exceptions import H2OValueError
  from h2o.frame import H2OFrame
  from h2o.utils.typechecks import assert_is_type, Enum, numeric
label_desc: Use image node_id 34 for calling the H2OPrincipalComponentAnalysisEstimator obj's underlying member method code with example usage: obj.init_for_pipeline() and returns: H2OPCA