class_docstr: An unsupervised machine learning algorithm to reduce feature dimensionality.
  
  As a result, number of features within a dataset is reduced but the dataset still
  retain as much information as possible.
docstr: A Principal Components Analysis (PCA)
  
  :class:`~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase`.
  
  This Estimator may be fit via calls to
  :meth:`~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.fit_ndarray`
  or
  :meth:`~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.fit`.
  The former allows a PCA model to be fit on a 2-dimensional numpy array.
  The latter requires Amazon :class:`~sagemaker.amazon.record_pb2.Record`
  protobuf serialized data to be stored in S3.
  
  To learn more about the Amazon protobuf Record class and how to
  prepare bulk data in this format, please consult AWS technical
  documentation:
  https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-training.html
  
  After this Estimator is fit, model data is stored in S3. The model
  may be deployed to an Amazon SageMaker Endpoint by invoking
  :meth:`~sagemaker.amazon.estimator.EstimatorBase.deploy`. As well as
  deploying an Endpoint, deploy returns a
  :class:`~sagemaker.amazon.pca.PCAPredictor` object that can be used to
  project input vectors to the learned lower-dimensional representation,
  using the trained PCA model hosted in the SageMaker Endpoint.
  
  PCA Estimators can be configured by setting hyperparameters. The
  available hyperparameters for PCA are documented below. For further
  information on the AWS PCA algorithm, please consult AWS technical
  documentation: https://docs.aws.amazon.com/sagemaker/latest/dg/pca.html
  
  This Estimator uses Amazon SageMaker PCA to perform training and host
  deployed models. To learn more about Amazon SageMaker PCA, please read:
  https://docs.aws.amazon.com/sagemaker/latest/dg/how-pca-works.html
  
  Args:
      role (str): An AWS IAM role (either name or full ARN). The Amazon
          SageMaker training jobs and APIs that create Amazon SageMaker
          endpoints use this role to access training data and model
          artifacts. After the endpoint is created, the inference code
          might use the IAM role, if accessing AWS resource.
      instance_count (int or PipelineVariable): Number of Amazon EC2 instances to use
          for training.
      instance_type (str or PipelineVariable): Type of EC2 instance to use for training,
          for example, 'ml.c4.xlarge'.
      num_components (int): The number of principal components. Must be
          greater than zero.
      algorithm_mode (str): Mode for computing the principal components.
          One of 'regular' or 'randomized'.
      subtract_mean (bool): Whether the data should be unbiased both
          during train and at inference.
      extra_components (int): As the value grows larger, the solution
          becomes more accurate but the runtime and memory consumption
          increase linearly. If this value is unset or set to -1, then a
          default value equal to the maximum of 10 and num_components will
          be used. Valid for randomized mode only.
      **kwargs: base class keyword argument values.
  
  .. tip::
  
      You can find additional parameters for initializing this class at
      :class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
      :class:`~sagemaker.estimator.EstimatorBase`.
docstr_tok: ["A","Principal","Components","Analysis","(","PCA",")",":","class",":","`","~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase","`",".","This","Estimator","may","be","fit","via","calls","to",":","meth",":","`","~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.fit_ndarray","`","or",":","meth",":","`","~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.fit","`",".","The","former","allows","a","PCA","model","to","be","fit","on","a","2-dimensional","numpy","array",".","The","latter","requires","Amazon",":","class",":","`","~sagemaker.amazon.record_pb2.Record","`","protobuf","serialized","data","to","be","stored","in","S3",".","To","learn","more","about","the","Amazon","protobuf","Record","class","and","how","to","prepare","bulk","data","in","this","format",",","please","consult","AWS","technical","documentation",":","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/cdf-training.html","After","this","Estimator","is","fit",",","model","data","is","stored","in","S3",".","The","model","may","be","deployed","to","an","Amazon","SageMaker","Endpoint","by","invoking",":","meth",":","`","~sagemaker.amazon.estimator.EstimatorBase.deploy","`",".","As","well","as","deploying","an","Endpoint",",","deploy","returns","a",":","class",":","`","~sagemaker.amazon.pca.PCAPredictor","`","object","that","can","be","used","to","project","input","vectors","to","the","learned","lower-dimensional","representation",",","using","the","trained","PCA","model","hosted","in","the","SageMaker","Endpoint",".","PCA","Estimators","can","be","configured","by","setting","hyperparameters",".","The","available","hyperparameters","for","PCA","are","documented","below",".","For","further","information","on","the","AWS","PCA","algorithm",",","please","consult","AWS","technical","documentation",":","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/pca.html","This","Estimator","uses","Amazon","SageMaker","PCA","to","perform","training","and","host","deployed","models",".","To","learn","more","about","Amazon","SageMaker","PCA",",","please","read",":","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/how-pca-works.html","Args",":","role","(","str",")",":","An","AWS","IAM","role","(","either","name","or","full","ARN",")",".","The","Amazon","SageMaker","training","jobs","and","APIs","that","create","Amazon","SageMaker","endpoints","use","this","role","to","access","training","data","and","model","artifacts",".","After","the","endpoint","is","created",",","the","inference","code","might","use","the","IAM","role",",","if","accessing","AWS","resource",".","instance_count","(","int","or","PipelineVariable",")",":","Number","of","Amazon","EC2","instances","to","use","for","training",".","instance_type","(","str","or","PipelineVariable",")",":","Type","of","EC2","instance","to","use","for","training",",","for","example",",","'ml.c4.xlarge","'",".","num_components","(","int",")",":","The","number","of","principal","components",".","Must","be","greater","than","zero",".","algorithm_mode","(","str",")",":","Mode","for","computing","the","principal","components",".","One","of","'regular","'","or","'randomized","'",".","subtract_mean","(","bool",")",":","Whether","the","data","should","be","unbiased","both","during","train","and","at","inference",".","extra_components","(","int",")",":","As","the","value","grows","larger",",","the","solution","becomes","more","accurate","but","the","runtime","and","memory","consumption","increase","linearly",".","If","this","value","is","unset","or","set","to","-1",",","then","a","default","value","equal","to","the","maximum","of","10","and","num_components","will","be","used",".","Valid","for","randomized","mode","only",".","*","*","kwargs",":","base","class","keyword","argument","values",".","..","tip",":",":","You","can","find","additional","parameters","for","initializing","this","class","at",":","class",":","`","~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase","`","and",":","class",":","`","~sagemaker.estimator.EstimatorBase","`","."]
code: def __init__(
      self,
      role: Optional[Union[str, PipelineVariable]] = None,
      instance_count: Optional[Union[int, PipelineVariable]] = None,
      instance_type: Optional[Union[str, PipelineVariable]] = None,
      num_components: Optional[int] = None,
      algorithm_mode: Optional[str] = None,
      subtract_mean: Optional[bool] = None,
      extra_components: Optional[int] = None,
      **kwargs,
  ):
      """A Principal Components Analysis (PCA)
  
      :class:`~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase`.
  
      This Estimator may be fit via calls to
      :meth:`~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.fit_ndarray`
      or
      :meth:`~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.fit`.
      The former allows a PCA model to be fit on a 2-dimensional numpy array.
      The latter requires Amazon :class:`~sagemaker.amazon.record_pb2.Record`
      protobuf serialized data to be stored in S3.
  
      To learn more about the Amazon protobuf Record class and how to
      prepare bulk data in this format, please consult AWS technical
      documentation:
      https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-training.html
  
      After this Estimator is fit, model data is stored in S3. The model
      may be deployed to an Amazon SageMaker Endpoint by invoking
      :meth:`~sagemaker.amazon.estimator.EstimatorBase.deploy`. As well as
      deploying an Endpoint, deploy returns a
      :class:`~sagemaker.amazon.pca.PCAPredictor` object that can be used to
      project input vectors to the learned lower-dimensional representation,
      using the trained PCA model hosted in the SageMaker Endpoint.
  
      PCA Estimators can be configured by setting hyperparameters. The
      available hyperparameters for PCA are documented below. For further
      information on the AWS PCA algorithm, please consult AWS technical
      documentation: https://docs.aws.amazon.com/sagemaker/latest/dg/pca.html
  
      This Estimator uses Amazon SageMaker PCA to perform training and host
      deployed models. To learn more about Amazon SageMaker PCA, please read:
      https://docs.aws.amazon.com/sagemaker/latest/dg/how-pca-works.html
  
      Args:
          role (str): An AWS IAM role (either name or full ARN). The Amazon
              SageMaker training jobs and APIs that create Amazon SageMaker
              endpoints use this role to access training data and model
              artifacts. After the endpoint is created, the inference code
              might use the IAM role, if accessing AWS resource.
          instance_count (int or PipelineVariable): Number of Amazon EC2 instances to use
              for training.
          instance_type (str or PipelineVariable): Type of EC2 instance to use for training,
              for example, 'ml.c4.xlarge'.
          num_components (int): The number of principal components. Must be
              greater than zero.
          algorithm_mode (str): Mode for computing the principal components.
              One of 'regular' or 'randomized'.
          subtract_mean (bool): Whether the data should be unbiased both
              during train and at inference.
          extra_components (int): As the value grows larger, the solution
              becomes more accurate but the runtime and memory consumption
              increase linearly. If this value is unset or set to -1, then a
              default value equal to the maximum of 10 and num_components will
              be used. Valid for randomized mode only.
          **kwargs: base class keyword argument values.
  
      .. tip::
  
          You can find additional parameters for initializing this class at
          :class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
          :class:`~sagemaker.estimator.EstimatorBase`.
      """
      super(PCA, self).__init__(
          role, instance_count, instance_type, **kwargs
      )
      self.num_components = num_components
      self.algorithm_mode = algorithm_mode
      self.subtract_mean = subtract_mean
      self.extra_components = extra_components
  
imports: from __future__ import absolute_import
  from typing import Union, Optional
  from sagemaker import image_uris
  from sagemaker.amazon.amazon_estimator import AmazonAlgorithmEstimatorBase
  from sagemaker.amazon.common import RecordSerializer, RecordDeserializer
  from sagemaker.amazon.hyperparameter import Hyperparameter
  from sagemaker.amazon.validation import gt, isin
  from sagemaker.predictor import Predictor
  from sagemaker.model import Model
  from sagemaker.session import Session
  from sagemaker.utils import pop_out_unused_kwarg
  from sagemaker.vpc_utils import VPC_CONFIG_DEFAULT
  from sagemaker.workflow.entities import PipelineVariable
label_desc: Use image node_id 1 to create a new PCA object from inherited base classes: AmazonAlgorithmEstimatorBase with example: obj = PCA(role, instance_count, instance_type, num_components, algorithm_mode, subtract_mean, extra_components)