How to use the pycm.pycm_param.CLASS_NUMBER_ERROR function in pycm

To help you get started, we’ve selected a few pycm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sepandhaghighi / pycm / pycm / pycm_obj.py View on Github external
self.predict_vector = predict_vector
        self.digit = digit
        self.weights = None
        if isinstance(transpose, bool):
            self.transpose = transpose
        else:
            self.transpose = False
        if isfile(file):
            matrix_param = __obj_file_handler__(self, file)
        elif isinstance(matrix, dict):
            matrix_param = __obj_matrix_handler__(matrix, transpose)
        else:
            matrix_param = __obj_vector_handler__(
                self, actual_vector, predict_vector, threshold, sample_weight)
        if len(matrix_param[0]) < 2:
            raise pycmVectorError(CLASS_NUMBER_ERROR)
        self.classes = matrix_param[0]
        self.table = matrix_param[1]
        self.matrix = self.table
        self.normalized_table = normalized_table_calc(self.classes, self.table)
        self.normalized_matrix = self.normalized_table
        self.TP = matrix_param[2]
        self.TN = matrix_param[3]
        self.FP = matrix_param[4]
        self.FN = matrix_param[5]
        statistic_result = class_statistics(
            TP=matrix_param[2],
            TN=matrix_param[3],
            FP=matrix_param[4],
            FN=matrix_param[5],
            classes=matrix_param[0],
            table=matrix_param[1])