(self)
return self.response
Returns a confusion matrix calculated previously using testing data with fit or calculate_metrics
Returns a confusion matrix calculated previously using testing data with fit or calculate_metrics
Returns a confusion matrix calculated previously using testing data with fit or calculate_metrics
def get_confusion_matrix(self):
        """
        Returns a confusion matrix calculated previously using testing data with fit or calculate_metrics
        """
        
        # Get the model from cache or disk based on the model_name in request
        self._get_model_by_name()
        
        try:
            # Prepare the output
            self.response = self.model.confusion_matrix
        except AttributeError:
            err = "The confusion matrix is only avaialble for classifiers, and when hold-out testing " + \
            "or K-fold cross validation has been performed."
            raise Exception(err)
        
        # Send the reponse table description to Qlik
        if "step" in self.response.columns:
            self._send_table_description("confusion_matrix_multi")
        else:
            self._send_table_description("confusion_matrix")
        
        # Debug information is printed to the terminal and logs if the paramater debug = true
        if self.model.debug:
            self._print_log(4)
        
        # Finally send the response
        return self.response
def get_confusion_matrix ( self ) : # Get the model from cache or disk based on the model_name in request self . _get_model_by_name ( ) try : # Prepare the output self . response = self . model . confusion_matrix except AttributeError : err = "The confusion matrix is only avaialble for classifiers, and when hold-out testing " + "or K-fold cross validation has been performed." raise Exception ( err ) # Send the reponse table description to Qlik if "step" in self . response . columns : self . _send_table_description ( "confusion_matrix_multi" ) else : self . _send_table_description ( "confusion_matrix" ) # Debug information is printed to the terminal and logs if the paramater debug = true if self . model . debug : self . _print_log ( 4 ) # Finally send the response return self . response