def show(self, output: OutputFormat = OutputFormat.TABLE): """ Display the current algorithm configuration on std out :param ouput: The output format """ if output == OutputFormat.JSON: print(json.dumps(self.json_dict)) else: description_dict = { k: v for k, v in self.json_dict.items() if k not in ['hyperparameters'] } TablePrinter.print_dict('ALGORITHMS', description_dict) print( TablePrinter.get_table(Hyperparameter, self.get_hyperparameters()))
def show_result(self) -> 'ServingPayload': """ Display the result of the serving payload on std out :return: The current serving payload """ if len(self.get_result_probabilities()) != 0: from prescience_client.bean.serving.serving_payload_batch import ServingPayloadBatch batch = ServingPayloadBatch(model_id=self.get_model_id(), flow_type=self.flow_type, batch_serving_payload=[self], model_evaluator=self.model_evaluator, prescience=self.prescience) batch.show_result() else: TablePrinter.print_dict( title=f'PREDICTIONS RESULTS FROM \'{self.get_model_id()}\'', json_dict=self.get_result_dict()) return self