def poll_model_training()

in getting_started/utils/lookout_equipment_utils.py [0:0]


    def poll_model_training(self, sleep_time=60):
        """
        This function polls the model describe API and print a status until the
        training is done.
        
        PARAMS
        ======
            sleep_time: integer (default: 60)
                How many seconds should we wait before polling again
        """
        describe_model_response = self.client.describe_model(
            ModelName=self.model_name
        )
        
        status = describe_model_response['Status']
        while status == 'IN_PROGRESS':
            time.sleep(sleep_time)
            describe_model_response = self.client.describe_model(
                ModelName=self.model_name
            )
            status = describe_model_response['Status']
            print(
                str(pd.to_datetime(datetime.now()))[:19],
                "| Model training:", 
                status
            )