class_docstr: A supervised learning algorithm used in classification and regression.
  
  Factorization Machines combine the advantages of Support Vector Machines
  with factorization models. It is an extension of a linear model that is
  designed to capture interactions between features within high dimensional
  sparse datasets economically.
docstr: Factorization Machines is :class:`Estimator` for general-purpose supervised learning.
  
  Amazon SageMaker Factorization Machines is a general-purpose
  supervised learning algorithm that you can use for both classification
  and regression tasks. It is an extension of a linear model that is
  designed to parsimoniously capture interactions between features within
  high dimensional sparse datasets.
  
  This Estimator may be fit via calls to
  :meth:`~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.fit`.
  It requires Amazon :class:`~sagemaker.amazon.record_pb2.Record` protobuf
  serialized data to be stored in S3. There is an utility
  :meth:`~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.record_set`
  that can be used to upload data to S3 and creates
  :class:`~sagemaker.amazon.amazon_estimator.RecordSet` to be passed to
  the `fit` call.
  
  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.FactorizationMachinesPredictor` object
  that can be used for inference calls using the trained model hosted in
  the SageMaker Endpoint.
  
  FactorizationMachines Estimators can be configured by setting
  hyperparameters. The available hyperparameters for FactorizationMachines
  are documented below.
  
  For further information on the AWS FactorizationMachines algorithm,
  please consult AWS technical documentation:
  https://docs.aws.amazon.com/sagemaker/latest/dg/fact-machines.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_factors (int): Dimensionality of factorization.
      predictor_type (str): Type of predictor 'binary_classifier' or
          'regressor'.
      epochs (int): Number of training epochs to run.
      clip_gradient (float): Optimizer parameter. Clip the gradient by
          projecting onto the box [-clip_gradient, +clip_gradient]
      eps (float): Optimizer parameter. Small value to avoid division by
          0.
      rescale_grad (float): Optimizer parameter. If set, multiplies the
          gradient with rescale_grad before updating. Often choose to be
          1.0/batch_size.
      bias_lr (float): Non-negative learning rate for the bias term.
      linear_lr (float): Non-negative learning rate for linear terms.
      factors_lr (float): Noon-negative learning rate for factorization
          terms.
      bias_wd (float): Non-negative weight decay for the bias term.
      linear_wd (float): Non-negative weight decay for linear terms.
      factors_wd (float): Non-negative weight decay for factorization
          terms.
      bias_init_method (str): Initialization method for the bias term:
          'normal', 'uniform' or 'constant'.
      bias_init_scale (float): Non-negative range for initialization of
          the bias term that takes effect when bias_init_method parameter
          is 'uniform'
      bias_init_sigma (float): Non-negative standard deviation for
          initialization of the bias term that takes effect when
          bias_init_method parameter is 'normal'.
      bias_init_value (float): Initial value of the bias term that takes
          effect when bias_init_method parameter is 'constant'.
      linear_init_method (str): Initialization method for linear term:
          'normal', 'uniform' or 'constant'.
      linear_init_scale (float): Non-negative range for initialization of
          linear terms that takes effect when linear_init_method parameter
          is 'uniform'.
      linear_init_sigma (float): Non-negative standard deviation for
          initialization of linear terms that takes effect when
          linear_init_method parameter is 'normal'.
      linear_init_value (float): Initial value of linear terms that takes
          effect when linear_init_method parameter is 'constant'.
      factors_init_method (str): Initialization method for
          factorization term: 'normal', 'uniform' or 'constant'.
      factors_init_scale (float): Non-negative range for initialization of
          factorization terms that takes effect when factors_init_method
          parameter is 'uniform'.
      factors_init_sigma (float): Non-negative standard deviation for
          initialization of factorization terms that takes effect when
          factors_init_method parameter is 'normal'.
      factors_init_value (float): Initial value of factorization terms
          that takes effect when factors_init_method parameter is
          'constant'.
      **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: ["Factorization","Machines","is",":","class",":","`","Estimator","`","for","general-purpose","supervised","learning",".","Amazon","SageMaker","Factorization","Machines","is","a","general-purpose","supervised","learning","algorithm","that","you","can","use","for","both","classification","and","regression","tasks",".","It","is","an","extension","of","a","linear","model","that","is","designed","to","parsimoniously","capture","interactions","between","features","within","high","dimensional","sparse","datasets",".","This","Estimator","may","be","fit","via","calls","to",":","meth",":","`","~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.fit","`",".","It","requires","Amazon",":","class",":","`","~sagemaker.amazon.record_pb2.Record","`","protobuf","serialized","data","to","be","stored","in","S3",".","There","is","an","utility",":","meth",":","`","~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.record_set","`","that","can","be","used","to","upload","data","to","S3","and","creates",":","class",":","`","~sagemaker.amazon.amazon_estimator.RecordSet","`","to","be","passed","to","the","`","fit","`","call",".","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.FactorizationMachinesPredictor","`","object","that","can","be","used","for","inference","calls","using","the","trained","model","hosted","in","the","SageMaker","Endpoint",".","FactorizationMachines","Estimators","can","be","configured","by","setting","hyperparameters",".","The","available","hyperparameters","for","FactorizationMachines","are","documented","below",".","For","further","information","on","the","AWS","FactorizationMachines","algorithm",",","please","consult","AWS","technical","documentation",":","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/fact-machines.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_factors","(","int",")",":","Dimensionality","of","factorization",".","predictor_type","(","str",")",":","Type","of","predictor","'binary_classifier","'","or","'regressor","'",".","epochs","(","int",")",":","Number","of","training","epochs","to","run",".","clip_gradient","(","float",")",":","Optimizer","parameter",".","Clip","the","gradient","by","projecting","onto","the","box","[","-clip_gradient",",","+clip_gradient","]","eps","(","float",")",":","Optimizer","parameter",".","Small","value","to","avoid","division","by","0.","rescale_grad","(","float",")",":","Optimizer","parameter",".","If","set",",","multiplies","the","gradient","with","rescale_grad","before","updating",".","Often","choose","to","be","1.0\/batch_size",".","bias_lr","(","float",")",":","Non-negative","learning","rate","for","the","bias","term",".","linear_lr","(","float",")",":","Non-negative","learning","rate","for","linear","terms",".","factors_lr","(","float",")",":","Noon-negative","learning","rate","for","factorization","terms",".","bias_wd","(","float",")",":","Non-negative","weight","decay","for","the","bias","term",".","linear_wd","(","float",")",":","Non-negative","weight","decay","for","linear","terms",".","factors_wd","(","float",")",":","Non-negative","weight","decay","for","factorization","terms",".","bias_init_method","(","str",")",":","Initialization","method","for","the","bias","term",":","'normal","'",",","'uniform","'","or","'constant","'",".","bias_init_scale","(","float",")",":","Non-negative","range","for","initialization","of","the","bias","term","that","takes","effect","when","bias_init_method","parameter","is","'uniform'","bias_init_sigma","(","float",")",":","Non-negative","standard","deviation","for","initialization","of","the","bias","term","that","takes","effect","when","bias_init_method","parameter","is","'normal","'",".","bias_init_value","(","float",")",":","Initial","value","of","the","bias","term","that","takes","effect","when","bias_init_method","parameter","is","'constant","'",".","linear_init_method","(","str",")",":","Initialization","method","for","linear","term",":","'normal","'",",","'uniform","'","or","'constant","'",".","linear_init_scale","(","float",")",":","Non-negative","range","for","initialization","of","linear","terms","that","takes","effect","when","linear_init_method","parameter","is","'uniform","'",".","linear_init_sigma","(","float",")",":","Non-negative","standard","deviation","for","initialization","of","linear","terms","that","takes","effect","when","linear_init_method","parameter","is","'normal","'",".","linear_init_value","(","float",")",":","Initial","value","of","linear","terms","that","takes","effect","when","linear_init_method","parameter","is","'constant","'",".","factors_init_method","(","str",")",":","Initialization","method","for","factorization","term",":","'normal","'",",","'uniform","'","or","'constant","'",".","factors_init_scale","(","float",")",":","Non-negative","range","for","initialization","of","factorization","terms","that","takes","effect","when","factors_init_method","parameter","is","'uniform","'",".","factors_init_sigma","(","float",")",":","Non-negative","standard","deviation","for","initialization","of","factorization","terms","that","takes","effect","when","factors_init_method","parameter","is","'normal","'",".","factors_init_value","(","float",")",":","Initial","value","of","factorization","terms","that","takes","effect","when","factors_init_method","parameter","is","'constant","'",".","*","*","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_factors: Optional[int] = None,
      predictor_type: Optional[str] = None,
      epochs: Optional[int] = None,
      clip_gradient: Optional[float] = None,
      eps: Optional[float] = None,
      rescale_grad: Optional[float] = None,
      bias_lr: Optional[float] = None,
      linear_lr: Optional[float] = None,
      factors_lr: Optional[float] = None,
      bias_wd: Optional[float] = None,
      linear_wd: Optional[float] = None,
      factors_wd: Optional[float] = None,
      bias_init_method: Optional[str] = None,
      bias_init_scale: Optional[float] = None,
      bias_init_sigma: Optional[float] = None,
      bias_init_value: Optional[float] = None,
      linear_init_method: Optional[str] = None,
      linear_init_scale: Optional[float] = None,
      linear_init_sigma: Optional[float] = None,
      linear_init_value: Optional[float] = None,
      factors_init_method: Optional[str] = None,
      factors_init_scale: Optional[float] = None,
      factors_init_sigma: Optional[float] = None,
      factors_init_value: Optional[float] = None,
      **kwargs,
  ):
      """Factorization Machines is :class:`Estimator` for general-purpose supervised learning.
  
      Amazon SageMaker Factorization Machines is a general-purpose
      supervised learning algorithm that you can use for both classification
      and regression tasks. It is an extension of a linear model that is
      designed to parsimoniously capture interactions between features within
      high dimensional sparse datasets.
  
      This Estimator may be fit via calls to
      :meth:`~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.fit`.
      It requires Amazon :class:`~sagemaker.amazon.record_pb2.Record` protobuf
      serialized data to be stored in S3. There is an utility
      :meth:`~sagemaker.amazon.amazon_estimator.AmazonAlgorithmEstimatorBase.record_set`
      that can be used to upload data to S3 and creates
      :class:`~sagemaker.amazon.amazon_estimator.RecordSet` to be passed to
      the `fit` call.
  
      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.FactorizationMachinesPredictor` object
      that can be used for inference calls using the trained model hosted in
      the SageMaker Endpoint.
  
      FactorizationMachines Estimators can be configured by setting
      hyperparameters. The available hyperparameters for FactorizationMachines
      are documented below.
  
      For further information on the AWS FactorizationMachines algorithm,
      please consult AWS technical documentation:
      https://docs.aws.amazon.com/sagemaker/latest/dg/fact-machines.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_factors (int): Dimensionality of factorization.
          predictor_type (str): Type of predictor 'binary_classifier' or
              'regressor'.
          epochs (int): Number of training epochs to run.
          clip_gradient (float): Optimizer parameter. Clip the gradient by
              projecting onto the box [-clip_gradient, +clip_gradient]
          eps (float): Optimizer parameter. Small value to avoid division by
              0.
          rescale_grad (float): Optimizer parameter. If set, multiplies the
              gradient with rescale_grad before updating. Often choose to be
              1.0/batch_size.
          bias_lr (float): Non-negative learning rate for the bias term.
          linear_lr (float): Non-negative learning rate for linear terms.
          factors_lr (float): Noon-negative learning rate for factorization
              terms.
          bias_wd (float): Non-negative weight decay for the bias term.
          linear_wd (float): Non-negative weight decay for linear terms.
          factors_wd (float): Non-negative weight decay for factorization
              terms.
          bias_init_method (str): Initialization method for the bias term:
              'normal', 'uniform' or 'constant'.
          bias_init_scale (float): Non-negative range for initialization of
              the bias term that takes effect when bias_init_method parameter
              is 'uniform'
          bias_init_sigma (float): Non-negative standard deviation for
              initialization of the bias term that takes effect when
              bias_init_method parameter is 'normal'.
          bias_init_value (float): Initial value of the bias term that takes
              effect when bias_init_method parameter is 'constant'.
          linear_init_method (str): Initialization method for linear term:
              'normal', 'uniform' or 'constant'.
          linear_init_scale (float): Non-negative range for initialization of
              linear terms that takes effect when linear_init_method parameter
              is 'uniform'.
          linear_init_sigma (float): Non-negative standard deviation for
              initialization of linear terms that takes effect when
              linear_init_method parameter is 'normal'.
          linear_init_value (float): Initial value of linear terms that takes
              effect when linear_init_method parameter is 'constant'.
          factors_init_method (str): Initialization method for
              factorization term: 'normal', 'uniform' or 'constant'.
          factors_init_scale (float): Non-negative range for initialization of
              factorization terms that takes effect when factors_init_method
              parameter is 'uniform'.
          factors_init_sigma (float): Non-negative standard deviation for
              initialization of factorization terms that takes effect when
              factors_init_method parameter is 'normal'.
          factors_init_value (float): Initial value of factorization terms
              that takes effect when factors_init_method parameter is
              'constant'.
          **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(FactorizationMachines, self).__init__(
          role, instance_count, instance_type, **kwargs
      )
  
      self.num_factors = num_factors
      self.predictor_type = predictor_type
      self.epochs = epochs
      self.clip_gradient = clip_gradient
      self.eps = eps
      self.rescale_grad = rescale_grad
      self.bias_lr = bias_lr
      self.linear_lr = linear_lr
      self.factors_lr = factors_lr
      self.bias_wd = bias_wd
      self.linear_wd = linear_wd
      self.factors_wd = factors_wd
      self.bias_init_method = bias_init_method
      self.bias_init_scale = bias_init_scale
      self.bias_init_sigma = bias_init_sigma
      self.bias_init_value = bias_init_value
      self.linear_init_method = linear_init_method
      self.linear_init_scale = linear_init_scale
      self.linear_init_sigma = linear_init_sigma
      self.linear_init_value = linear_init_value
      self.factors_init_method = factors_init_method
      self.factors_init_scale = factors_init_scale
      self.factors_init_sigma = factors_init_sigma
      self.factors_init_value = factors_init_value
  
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, ge
  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 FactorizationMachines object from inherited base classes: AmazonAlgorithmEstimatorBase with example: obj = FactorizationMachines(role, instance_count, instance_type, num_factors, predictor_type, epochs, clip_gradient, eps, rescale_grad, bias_lr, linear_lr, factors_lr, bias_wd, linear_wd, factors_wd, bias_init_method, bias_init_scale, bias_init_sigma, bias_init_value, linear_init_method, linear_init_scale, linear_init_sigma, linear_init_value, factors_init_method, factors_init_scale, factors_init_sigma, factors_init_value)