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

***************
update_solution
***************



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

  

  Updates an Amazon Personalize solution to use a different automatic training configuration. When you update a solution, you can change whether the solution uses automatic training, and you can change the training frequency. For more information about updating a solution, see `Updating a solution <https://docs.aws.amazon.com/personalize/latest/dg/updating-solution.html>`__.

   

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

   

  CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

   

  To get the status of a solution update, call the `DescribeSolution <https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolution.html>`__ API operation and find the status in the ``latestSolutionUpdate``.

  

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


  **Request Syntax**
  ::

    response = client.update_solution(
        solutionArn='string',
        performAutoTraining=True|False,
        performIncrementalUpdate=True|False,
        solutionUpdateConfig={
            'autoTrainingConfig': {
                'schedulingExpression': 'string'
            },
            'eventsConfig': {
                'eventParametersList': [
                    {
                        'eventType': 'string',
                        'eventValueThreshold': 123.0,
                        'weight': 123.0
                    },
                ]
            }
        }
    )
    
  :type solutionArn: string
  :param solutionArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the solution to update.

    

  
  :type performAutoTraining: boolean
  :param performAutoTraining: 

    Whether the solution uses automatic training to create new solution versions (trained models). You can change the training frequency by specifying a ``schedulingExpression`` in the ``AutoTrainingConfig`` as part of solution configuration.

     

    If you turn on automatic training, the first automatic training starts within one hour after the solution update completes. If you manually create a solution version within the hour, the solution skips the first automatic training. For more information about automatic training, see `Configuring automatic training <https://docs.aws.amazon.com/personalize/latest/dg/solution-config-auto-training.html>`__.

     

    After training starts, you can get the solution version's Amazon Resource Name (ARN) with the `ListSolutionVersions <https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutionVersions.html>`__ API operation. To get its status, use the `DescribeSolutionVersion <https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolutionVersion.html>`__.

    

  
  :type performIncrementalUpdate: boolean
  :param performIncrementalUpdate: 

    Whether to perform incremental training updates on your model. When enabled, this allows the model to learn from new data more frequently without requiring full retraining, which enables near real-time personalization. This parameter is supported only for solutions that use the semantic-similarity recipe.

    

  
  :type solutionUpdateConfig: dict
  :param solutionUpdateConfig: 

    The new configuration details of the solution.

    

  
    - **autoTrainingConfig** *(dict) --* 

      The automatic training configuration to use when ``performAutoTraining`` is true.

      

    
      - **schedulingExpression** *(string) --* 

        Specifies how often to automatically train new solution versions. Specify a rate expression in rate(*value* *unit*) format. For value, specify a number between 1 and 30. For unit, specify ``day`` or ``days``. For example, to automatically create a new solution version every 5 days, specify ``rate(5 days)``. The default is every 7 days.

         

        For more information about auto training, see `Creating and configuring a solution <https://docs.aws.amazon.com/personalize/latest/dg/customizing-solution-config.html>`__.

        

      
    
    - **eventsConfig** *(dict) --* 

      Describes the configuration of an event, which includes a list of event parameters. You can specify up to 10 event parameters. Events are used in solution creation.

      

    
      - **eventParametersList** *(list) --* 

        A list of event parameters, which includes event types and their event value thresholds and weights.

        

      
        - *(dict) --* 

          Describes the parameters of events, which are used in solution creation.

          

        
          - **eventType** *(string) --* 

            The name of the event type to be considered for solution creation.

            

          
          - **eventValueThreshold** *(float) --* 

            The threshold of the event type. Only events with a value greater or equal to this threshold will be considered for solution creation.

            

          
          - **weight** *(float) --* 

            The weight of the event type. A higher weight means higher importance of the event type for the created solution.

            

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

    
    ::

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

    

    - *(dict) --* 
      

      - **solutionArn** *(string) --* 

        The same solution Amazon Resource Name (ARN) as given in the request.

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

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

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

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

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

  