(self)
return self.response
Return metrics previously calculated during fit
Return metrics previously calculated during fit
Return metrics previously calculated during fit
def get_metrics(self):
        """
        Return metrics previously calculated during fit
        """
        
        # Get the model from cache or disk based on the model_name in request
        self._get_model_by_name()
        
        # Prepare the response data frame
        self.response = self.model.metrics_df
        
        # Send the reponse table description to Qlik
        if self.model.validation == "hold-out":
            if self.model.estimator_type == "classifier":
                self._send_table_description("metrics_clf")
            elif self.model.estimator_type == "regressor":
                self._send_table_description("metrics_reg")
        elif self.model.validation in ["k-fold", "timeseries"]:
            if self.model.estimator_type == "classifier":
                self._send_table_description("metrics_clf_cv")
            elif self.model.estimator_type == "regressor":
                self._send_table_description("metrics_reg_cv")
        else:
            err = "Metrics are not available. Make sure the machine learning pipeline includes K-fold cross validation or hold-out testing."
            raise Exception(err)
        
        # 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_metrics ( self ) : # Get the model from cache or disk based on the model_name in request self . _get_model_by_name ( ) # Prepare the response data frame self . response = self . model . metrics_df # Send the reponse table description to Qlik if self . model . validation == "hold-out" : if self . model . estimator_type == "classifier" : self . _send_table_description ( "metrics_clf" ) elif self . model . estimator_type == "regressor" : self . _send_table_description ( "metrics_reg" ) elif self . model . validation in [ "k-fold" , "timeseries" ] : if self . model . estimator_type == "classifier" : self . _send_table_description ( "metrics_clf_cv" ) elif self . model . estimator_type == "regressor" : self . _send_table_description ( "metrics_reg_cv" ) else : err = "Metrics are not available. Make sure the machine learning pipeline includes K-fold cross validation or hold-out testing." raise Exception ( err ) # 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