:doc:`Personalize <../../personalize>` / Client / create_solution_version

***********************
create_solution_version
***********************



.. py:method:: Personalize.Client.create_solution_version(**kwargs)

  

  Trains or retrains an active solution in a Custom dataset group. A solution is created using the `CreateSolution <https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolution.html>`__ operation and must be in the ACTIVE state before calling ``CreateSolutionVersion``. A new version of the solution is created every time you call this operation.

   

  **Status**

   

  A solution version can be in one of the following states:

   

  
  * CREATE PENDING
   
  * CREATE IN_PROGRESS
   
  * ACTIVE
   
  * CREATE FAILED
   
  * CREATE STOPPING
   
  * CREATE STOPPED
  

   

  To get the status of the version, call `DescribeSolutionVersion <https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolutionVersion.html>`__. Wait until the status shows as ACTIVE before calling ``CreateCampaign``.

   

  If the status shows as CREATE FAILED, the response includes a ``failureReason`` key, which describes why the job failed.

   

  **Related APIs**

   

  
  * `ListSolutionVersions <https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutionVersions.html>`__
   
  * `DescribeSolutionVersion <https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolutionVersion.html>`__
   
  * `ListSolutions <https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutions.html>`__
   
  * `CreateSolution <https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolution.html>`__
   
  * `DescribeSolution <https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolution.html>`__
   
  * `DeleteSolution <https://docs.aws.amazon.com/personalize/latest/dg/API_DeleteSolution.html>`__
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateSolutionVersion>`_  


  **Request Syntax**
  ::

    response = client.create_solution_version(
        name='string',
        solutionArn='string',
        trainingMode='FULL'|'UPDATE'|'AUTOTRAIN',
        tags=[
            {
                'tagKey': 'string',
                'tagValue': 'string'
            },
        ]
    )
    
  :type name: string
  :param name: 

    The name of the solution version.

    

  
  :type solutionArn: string
  :param solutionArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the solution containing the training configuration information.

    

  
  :type trainingMode: string
  :param trainingMode: 

    The scope of training to be performed when creating the solution version. The default is ``FULL``. This creates a completely new model based on the entirety of the training data from the datasets in your dataset group.

     

    If you use `User-Personalization <https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html>`__, you can specify a training mode of ``UPDATE``. This updates the model to consider new items for recommendations. It is not a full retraining. You should still complete a full retraining weekly. If you specify ``UPDATE``, Amazon Personalize will stop automatic updates for the solution version. To resume updates, create a new solution with training mode set to ``FULL`` and deploy it in a campaign. For more information about automatic updates, see `Automatic updates <https://docs.aws.amazon.com/personalize/latest/dg/use-case-recipe-features.html#maintaining-with-automatic-updates>`__.

     

    The ``UPDATE`` option can only be used when you already have an active solution version created from the input solution using the ``FULL`` option and the input solution was trained with the `User-Personalization <https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html>`__ recipe or the legacy `HRNN-Coldstart <https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-hrnn-coldstart.html>`__ recipe.

    

  
  :type tags: list
  :param tags: 

    A list of `tags <https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html>`__ to apply to the solution version.

    

  
    - *(dict) --* 

      The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see `Tagging Amazon Personalize resources <https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html>`__.

      

    
      - **tagKey** *(string) --* **[REQUIRED]** 

        One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.

        

      
      - **tagValue** *(string) --* **[REQUIRED]** 

        The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key).

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'solutionVersionArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **solutionVersionArn** *(string) --* 

        The ARN of the new solution version.

        
  
  **Exceptions**
  
  *   :py:class:`Personalize.Client.exceptions.InvalidInputException`

  
  *   :py:class:`Personalize.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`Personalize.Client.exceptions.LimitExceededException`

  
  *   :py:class:`Personalize.Client.exceptions.ResourceInUseException`

  
  *   :py:class:`Personalize.Client.exceptions.TooManyTagsException`

  
  *   :py:class:`Personalize.Client.exceptions.ResourceAlreadyExistsException`

  